Search code examples
ffmpegmjpeg

ffmpeg - showinfo in combination with vcodec copy


I am trying to extract the frames from an mjpeg video and simoultanously getting timestamps for the individuall frames with ffmpeg.

I can do it with

ffmpeg.exe" -i mjpegvideo.avi -filter:v "showinfo" frame%d.jpg

but this is pretty slow compared to

ffmpeg.exe" -i mjpegvideo.avi -vcodec copy frame%d.jpg

because in the first command, a conversion is done. However, if i try to use -filter:v "showinfo with -vcodec copy, I get an error: Filtering and streamcopy cannot be used together.

Is there any way to get the frame-timestamps while using vcodec copy?


Solution

  • If you simply copy the encoding of the input the timestamps should remain untouched so you can just do:

    ffprobe -select_streams v -show_frames mjpegvideo.avi

    The command can also output JSON or XML, see the documentation. This can take a while for large files but at least it won't transcode.