libyami icon indicating copy to clipboard operation
libyami copied to clipboard

h264 low latency decoding

Open angelo-p opened this issue 7 years ago • 3 comments

Hello, I updated to libyami tag 1.3.0 to bring in the LowLatency mode for AVC/H264 playback. I am playing a mp4 file: 'Serenity_720p.mp4' AVC High profile 1280x720 and I don't see any difference when playing in low latency.

According to my logging, It takes between 1 to 8 input frames to generate an output frame. To test low latency, I am just setting the VideoConfigBuffer enableLowLatency to true. Do I need to do anything else?

Thanks Angelo

angelo-p avatar May 10 '18 19:05 angelo-p

It may relate to stream, we have a fix at https://github.com/intel/libyami/issues/844 Could you help try it? thanks

xuguangxin avatar May 11 '18 01:05 xuguangxin

@xuguangxin Thanks, adding the VIDEO_DECODE_BUFFER_FLAG_FRAME_END improves decoding latency. Our application always feeds the codec full frames. Can we set the flag all the time or only when enableLowLatency is set ?

angelo-p avatar May 11 '18 15:05 angelo-p

Hi @angelo-p , It depends on your use case. Without this flag, we need to search the bitstream and detect frame boundary. We only start to decode current frame when we see next frame started. This introduces one frame delay. But in some case you know exactly we have the entire frame.So you can pass the flag to the decoder. No need be an entire frame at one time. A frame contains N units, you can send N-1 nal unit without this flags. send Nth nal with this flag.

thanks

xuguangxin avatar May 14 '18 02:05 xuguangxin