<div dir="ltr"><div>  Hi!<div><br></div><div>TL;DR h264_qsv is waiting until the next frame before decoding--how do I make it decode immediately?</div><div><br></div><div>I recently implemented h264_qsv decode after following this <a href="https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/qsvdec.c">example</a>. The problem I'm having is that I'm experiencing some latency when playing back frames, and I believe I have figured out why. According to this <a href="https://software.intel.com/en-us/forums/media/topic/704136?fbclid=IwAR1ZxtVVgz5dtNoZ2TVwxfDPtRsQxlWbOj20DtiQIZk-xt6zrhw0-d0v8-c">post</a>, Intel QSV SDK will wait until the next frame is received before starting the decode process, because it's not sure if the frame is a full frame or not. The answer says that the solution is to pass in a <span style="color:rgb(96,96,96);font-family:Arial,宋体,Tahoma,Helvetica,sans-serif;font-size:13.008px">MFX_BITSTREAM_COMPLETE_FRAME parameter, to set AsyncDepth = 1, and to set </span><span style="color:rgb(96,96,96);font-family:Arial,宋体,Tahoma,Helvetica,sans-serif;font-size:13.008px">SEI.pic_timing.dpb_output_delay. </span></div><div><br></div><div>Does anyone know how to use these settings in Libavcodec/how to resolve the frame delay decoding issue? I thought maybe they would be passed into the AVHwFramesContext struct but I can't find them anywhere.</div><div><br></div><div>Thank you! </div></div><div><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Philippe<br></div></div></div></div></div></div></div></div></div></div></div>