intel / libyami

Yet Another Media Infrastructure. it is core part of media codec with hardware acceleration, it is yummy to your video experience on Linux like platform.
Apache License 2.0
146 stars 106 forks source link

h264 low latency decoding #847

Open angelo-p opened 6 years ago

angelo-p commented 6 years ago

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

xuguangxin commented 6 years ago

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

angelo-p commented 6 years ago

@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 ?

xuguangxin commented 6 years ago

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