5
votes

I'm using MediaCodec to decode a H.264 video @ 30FPS that I receive from an RTSP live stream, the decoder runs on an android device.

However, I see a latency in the output of the MediaCodec's decoder. It looks like the decoder waits until it receives about 15 frames before providing the decoded frames, resulting in ~500ms latency in the rendered video. The latency is not accepted for my project, as the user expects to see the live video immediately when it arrives to his device.

Is there a way to configure the MediaCodec, so it doesn't buffer the incoming frames and outputs the decoded frames as soon as they are ready to be displayed?

Thanks for the help.

1
Hi, did you tried to set the timeouts to -1 (no timeout)?E.Abdel
I work with MediaCodec asynchronously, so there's no timeout parameter.Tomer Levi
Have you solved it?kar
can you share your source code?Ankit Dubey

1 Answers

0
votes

If possible, try to change the encoding of the videos.