I’m creating a script to pull a video off the web, create an image of the first frame, and save the image as a file. My script is handling grabbing a lot of videos and giving the file names a sequential number.
My problem is in using VLC to grab the video and actually save the file. Experimenting with the command-line and just a local file before I put it into my script, I’ve tried:
vlc -vvv -I dummy --video-filter=scene --start-time=1 --stop-time=1 --scene-format=jpeg --scene-ratio=24 --scene-prefix=EXEC samp.mp4 vlc://quit
-> uncaught exception
vlc -vvv -I dummy --no-audio --video-filter=scene --start-time=1 --stop-time=1 --scene-format=jpeg --scene-ratio=24 --scene-prefix=EXEC samp.mp4 vlc://quit
-> uncaught exception
vlc -vvv -I rc --video-filter=scene --start-time=1 --stop-time=1 --scene-format=jpeg --scene-ratio=24 --scene-prefix=EXEC samp.mp4 vlc://quit
-> uncaught exception; looks like I can’t do without a -V option
vlc -vvv -I rc -V snapshot --video-filter=scene --start-time=1 --stop-time=1 --scene-format=jpeg --scene-ratio=24 --scene-prefix=EXEC samp.mp4 vlc://quit
-> no vout display module matched “snapshot”; similarly for attempts with module “image”, “scene”, “opengl”
I’m running VLC 2.0.1 on Mac OS X 10.7.3. Has anybody got VLC to work on the command line (so it’s scriptable) to do image capture from videos?
BTW, I’ve done extensive googling on this – the VLC documentation is hopelessly out of date and most suggestions on the web don’t actually work with the latest version of VLC.
If the result is important, but not the video player, you can do this with mplayer:
The
VIDEO-FILENAMEcan be a local file, or an HTTP URL.To get the command-line mplayer on OSX, just install the graphical one then find the command-line binary in one of these locations:
or