slow png decode starting with ffmpeg-3.3.1
|Reported by:||DonMoir||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
It had been a long time since I have used the latest ffmpeg and have been using an old version. So recently I modified my code to use the latest ffmpeg 4.2.x. Ran a few test with some mp4 files and seemed ok. Then I ran a test with a 1920x1080 mov video that used AV_CODEC_ID_PNG. I noticed the CPU seemed high so I cross checked with older ffmpeg version and decoding was faster. I narrowed it down and last known good was ffmpeg-3.2.9.
Using ffmpeg 3.2.9 and ffmpeg 3.3.1 I came up with some stats. I used a 1920x1080 RGBA 30 FPS video. Windows 7, i7 CPU, 1060 GPU. I checked the time to decode 30 frames of video. This is just the decoding time and nothing else.
decoding 30 frames of png video
threads decode time CPU% ffmpeg 3.2.9 1 745ms 8-10% ffmpeg 3.2.9 2 35ms 8-10% ffmpeg 3.3.1 1 1500ms 10-12% ffmpeg 3.3.1 2 540ms 18-20%
I am assuming the problem comes from the use of the atomic functions added to pthread_frame.c in 3.3.1. Not sure but seems most likely case.
Here is the commitdiff where that was added:
The ffmpeg source was downloaded from here:
Best way to check this is to time the decode only as I did using an appropriate sample file which I will put up. Just looking at the playback is probably not enough to verify.
The slow_png_decode_cut.mov sample is not as complex and decodes a bit faster but still slow.
Change History (11)
follow-up: 9 comment:4 by , 2 years ago
|Status:||closed → reopened|