Extracting every frame from video file as image in OS X

13

4

What I want to do is extract every frame of a video file and output the images.

I tried using VLC's commands through terminal, however it seems to be skipping frames, even though I turned off "skip frames." I guess my MacBook Pro i7 is too slow. It seems weird that I can't play a video file without skipping frames. Anyways, are there any alternatives that would allow me to get every frame? It seems vlc tries to do it in real time which could be a problem if working on a slow machine.

Here is the VLC command I used:

/Applications/VLC.app/Contents/MacOS/VLC /Users/name/Downloads/complete/video.mkv --video-filter=scene --scene-prefix=movie --scene-ratio=1 --scene-path=/folder --start-time=1035 --stop-time=1100 --no-skip-frames

Adam

Posted 2012-02-17T18:25:20.090

Reputation: 287

Download and Register Apple's QuickTime 7, one of the Export options is to export each frame as JPEG, PNG, etc. – MicroMachine – 2018-04-18T23:22:30.543

[@MicroMachine] Note: Export is only available in the Pro version of Apple's QuickTime 7. https://goo.gl/LLmCHE

– emallove – 2018-12-07T16:03:27.903

Answers

16

I'd do it with FFmpeg, which you can get through Homebrew, or alternatively ffmpegX.

In the first case, install Homebrew and then run brew install ffmpeg. This will require Xcode and building from source, which might be a bit of an overhead for your simple requirement.

In the second case, install the .app, and use the ffmpeg version bundled with it – however be advised that this version is from 2006, and therefore might not work with all input files.

/Applications/ffmpegX.app/Contents/Resources/ffmpeg

It worked for a h.264/MP4 clip for me.


Regardless, use FFmpeg to output each frame individually:

ffmpeg -i /path/to/video.mkv /path/to/output-%04d.jpg

You can also use png instead of jpg for lossless results, and change the number in %04d if you need more digits when the file is longer.

slhck

Posted 2012-02-17T18:25:20.090

Reputation: 182 472