Code: Select all
vlc -V image --start-time 0 --stop-time 1 --image-out-format jpg --image-out-ratio 24 --image-out-prefix snap test.mpg vlc:quit
When Vlc runs it 'plays' the video for one second without actually showing the video on screen, and then quits, leaving us with a file named 'snap000000.jpg', containing an image of the first frame (?) of the video.
How its works:
First select the image output with: -V image.
Next set the interval (in seconds) you want an image from with: --start-time 0 --stop-time 1
In my example the first second of the video. In that case you could omit the parameter --start-time. If you want an image from the 5th second fill in: --start-time 5 --stop-time 6
The image format will be .jpg because i provided: --image-out-format jpg. You could specify --image-out-format png to get a .png-image instead.
--image-out-ratio 24 specifies we want one image out of 24. In my case the video contains 24 images per second so this is the right value. If your video has more images per seconds you should increase this value to prevend you get more images as one. If the number is too high (for example 500) it still produces only one image, so the actual value is not so important as long as it is higher then the images per second.
--image-out-prefix snap specifies the filename must start with 'snap'. I tried to fill in a path but that doesn't work: the prefix specifies the basename of the file only.
You could specify --no-image-out-replace. In that case Vlc produces the file 'snap.jpg'.
test.mpg specifies the video to play and finally vlc:quit forces vlc to quit when ready.
I hope this explaination helps all people wanting thumbnails of a video.
One question remains: If you want to make thumbnails of many files each file takes one second to take an image from. Is there any commandline-option to 'play' videos with enhanched velocity? And is there a possibility to run Vlc completely in the background (now it leaves me with the player)?