[FFmpeg-trac] #10622(avcodec:new): AMF encoder uses sleep() function, which is not precise on WIndows
FFmpeg
trac at avcodec.org
Mon Oct 16 11:45:34 EEST 2023
#10622: AMF encoder uses sleep() function, which is not precise on WIndows
-------------------------------------+-------------------------------------
Reporter: Evgeny | Type: defect
Status: new | Priority: important
Component: avcodec | Version: git-
| master
Keywords: AMF encoder | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Summary of the bug:
1. AMF encoder has av_usleep(1000) when AMF encoder input queue is full.
2. Inside av_usleep() function the standalone “sleep()” function is used,
which is not very accurate on windows OS. For a sleep of 1 ms, we observe
an actual sleep time of 13 to 14ms.
3. For low resolution encoding (e.g. 480x360 video) av_usleep() executes
frequently, so performance degradation is quite big (about 15%).
4. We will create a patch for fix this performance degradation by changing
av_usleep(1000) -> av_usleep(0) on Windows OS.
How to reproduce:
{{{
% ffmpeg.exe -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i input.mp4
-c:v h264_amf out.mp4
ffmpeg master branch
built on Windows
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/10622>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list