Piping mjpeg drops frames
|Reported by:||Sig||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
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 frames.
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 detected:
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.
Change History (7)
comment:2 by , 3 years ago
|Status:||new → closed|