[FFmpeg-trac] #8452(undetermined:new): slow png decode starting with ffmpeg-3.3.1

FFmpeg trac at avcodec.org
Tue Dec 31 02:12:03 EET 2019

#8452: slow png decode starting with ffmpeg-3.3.1
             Reporter:  DonMoir      |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
 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.

Ticket URL: <https://trac.ffmpeg.org/ticket/8452>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list