On Mon, Sep 9, 2024 at 6:48 PM Cameron Gutman <aicomman...@gmail.com> wrote: > > On Mon, Sep 9, 2024 at 11:05 AM Araz <primeadv...@gmail.com> wrote: > >> > >> > I took a look at this using AMD's AMF EncoderLatency sample and found > >> > that > >> > setting the QUERY_TIMEOUT option to 50 ms (as is default for the new AMF > >> > HQ and HQLL usage values) results in latency that is better than the > >> > current AMF code in FFmpeg *and* this patch without having to touch > >> > the process's timer precision. > >> > > >> > Here are the results from QUERY_TIMEOUT=0, amf_sleep(1), 1ms timer > >> > period: > >> > Encoder: AMFVideoEncoderVCE_AVC > >> > Total : Frames = 500 Duration = 1157.16ms FPS = 432.09frames > >> > Latency: First,Min,Max = 7.12ms, 1.53ms, 3.73ms > >> > Latency: Average = 1.99ms > >> > > >> > and the results from QUERY_TIMEOUT=50, default timer period: > >> > Encoder: AMFVideoEncoderVCE_AVC > >> > Total : Frames = 500 Duration = 933.03ms FPS = 535.89frames > >> > Latency: First,Min,Max = 5.80ms, 1.49ms, 2.50ms > >> > Latency: Average = 1.58ms > >> > > >> > This seems to clearly demonstrate that QUERY_TIMEOUT is a better approach > >> > than adjusting timer resolution. It avoids process-wide effects *and* > >> > it even performs better on top of that. > >> > > >> > > >> > Cameron > > > > > > Thanks everyone and Cameron, > > TIMEOUT might be a possible solution. > > Need some time for evaluating the performance impact of using it. > > The problem is that FFmpeg calls SubmitInput and QueryOutput > > from the same thread and if B-frames and/or look-ahead enabled, initially > > not enough input submitted and QueryOutput will wait till timeout value. > > Ah I see, I guess we can just replace the fixed 1 ms sleep with a fixed > 1 ms QUERY_TIMEOUT. We won't get the full power gains of waking exactly > once per frame when encoding is complete, but it should solve the issue > of having to wait a full 15.6ms to realize output data is available. > > How about something like this? >
Ugh, email client mangled it. Let's try that again.
patch.diff
Description: Binary data
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".