[FFmpeg-trac] #8014(ffmpeg:new): Piping mjpeg drops frames

FFmpeg trac at avcodec.org
Fri Jul 12 22:36:10 EEST 2019

#8014: Piping mjpeg drops frames
             Reporter:  sig          |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:  ffmpeg       |                  Version:  git-
             Keywords:  h264 mjpeg   |  master
  pipe dropped frames                |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
 It seems switching output from jpeg image files to a pipe results in
 frames not being outputted to the pipe.

 Attached is 100-frames.mp4 which is a video of 100 sequentially numbered

 As expected running the below outputs all 100 frames correctly.
 ffmpeg -i 100-frames.mp4 -f image2 -vcodec mjpeg "out%05d.jpg"

 However running this next command results in only 53 frames being
 ffmpeg -i 100-frames.mp4 -f image2 -vcodec mjpeg -update 1 pipe:1 | xxd |
 grep "ffd8" | wc -l

 This one uses xxd to convert the outputted binary into hex then uses grep
 to search for the jpeg start bytes ("ffd8"). Finally wc counts the search
 hits and prints the total at the end. So the number output at the end is
 the number of JPEGs seen in the stream.

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

More information about the FFmpeg-trac mailing list