Monday, August 2, 2010

Code: Create Thumbnail from Video using VLC command line

If you want to create a thumbnail from a video, you can use VLC and its command line arguments as seen below. This was tested using VLC 1.1.2

C:\Users\amiller.NG>"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" --video-filter scene -V dummy --scene-width=80 --scene-format=jpeg --scene-replace --scene-ratio 24 --start-time=6 --stop-time=7 --scene-path=D:\ --scene-prefix=thumb D:\1.mp4 vlc://quit

--scene-path is the output directory
--scene-prefix is the output filename
--scene-format can be jpeg, jpg, or png
--start-time is the location in the video (in seconds) to grab the image from
--stop-time tells the vlc to stop playing the video at that point
--scene-width specifies the output width of the thumbnail in pixels, you can optionally include --scene-height, but the image will be stretched to fit that dimension.