Skip to content Skip to sidebar Skip to footer

Recoding One H.264 Video To Another Using Opengl Surfaces Is Very Slow On My Android

I'm developing function of translating one video into another with additional effects for each frame. I decided to use opengl-es for applying effects on each frame. My input and ou

Solution 1:

Your issue probably is in how you synchronously wait for events on one single thread, with a nonzero timeout.

You could probably get better throuhput if you lower the timeout. Most of the hardware codecs work with a bit of latency; you can have a good total throughput, but don't expect to have a result (a frame encoded or decoded) immediately.

Ideally, you would use a zero timeout to check all inputs/outputs of both encoder and decoder, and in case there's no free buffers on either points, wait with a nonzero timeout on e.g. encoder output or decoder output.

If you can target Android 5.0, with asynchronous mode in MediaCodec, it's much easier to get this done right. See e.g. https://github.com/mstorsjo/android-decodeencodetest for an example on how to do this. See also https://stackoverflow.com/a/35885471/3115956 for a longer discussion on this issue.

You can also have a look at somesimilarquestions.

Post a Comment for "Recoding One H.264 Video To Another Using Opengl Surfaces Is Very Slow On My Android"