I work with FFMpeg and process some .mkv videos that can have more than one videostream. How I can extract frame from other videostream (not from primary)? I want to extract one frame from each videostream using FFMPeg. Any ideas?
From 30 second timestamp (-ss 30
).
ffmpeg -ss 30 -i input.mkv -map 0:2 -frames:v 1 output.jpg
Same result as above with this particular input. 0:v:1
is translated as "from input #0 choose video stream #1". Note that ffmpeg
starts counting from 0, so video stream #1 is actually the 2nd video stream.
ffmpeg -ss 30 -i input.mkv -map 0:v:1 -frames:v 1 output.jpg
I prefer using this method because you can be lazy and not have to know the actual stream map numbers.
ffmpeg -ss 30 -i input.mkv -map 0:v:0 -frames:v 1 output0.jpg -map 0:v:1 -frames:v 1 output1.jpg -map 0:v:2 -frames:v 1 output2.jpg