I'm trying to get multiple snapshots of a single input file using Input Seeking. I want to seek to different keyframes and save each to different output images.
I can use this using multiple calls:
ffmpeg -ss 280 -i sample.mp4 -aspect 1.7777777777778 -vframes 1 -qmax 9 -qmin 8 -bt 10000000 -y -pix_fmt yuv420p out1.jpg
ffmpeg -ss 300 -i sample.mp4 -aspect 1.7777777777778 -vframes 1 -qmax 9 -qmin 8 -bt 10000000 -y -pix_fmt yuv420p out2.jpg
ffmpeg -ss 302 -i sample.mp4 -aspect 1.7777777777778 -vframes 1 -qmax 9 -qmin 8 -bt 10000000 -y -pix_fmt yuv420p out3.jpg
Unfortunately I have to call ffmpeg programmatically using exec. Is there a way to batch process the tasks above? It has to use input seeking. Thanks.