I’m trying to create a Mac App for internal use, that grabs a movie file specified by the user, converts it to a specific format and saves every frame as an image on the hard drive.
I’ve got the converting part done, using the awesome Handbrake CLI.
Now I’m trying to find a way to save each frame as an image, but I can’t find a way of doing it.
It seems ffmpeg has a command to extract frames into images. The following pulls a single frame five seconds in:
ffmpeg -i "infile.mp4" -r 1 -ss 00:00:05 -t 00:00:01 -vframes 1 -f image2 -y "image.jpg"
However, I’d rather use QTKit or the Handbrake CLI, so I won’t have to add both ffmpeg and Handbrake to the app.
Any ideas would be much appreciated!
So, I’ve found out for sure that you can’t do it with Handbrake, after a discussion on their IRC channel.
However, here’s a relatively painless way of doing it with ffmpeg:
So, i’m using a task for Handbrake (to convert video) and then another task to save a still.
I could use just ffmpeg, but I like Handbrake, so I’ll leverage the 2 this way.
Hope this helps anyone out there.