For this purpose, we need vlc in order to convert the video. If you are on Ubuntu:
sudo apt-get install vlc
Note: if you go on the terminal before running this command, ubuntu will recommend to install vnc-nox. This installation will not contain the image encoders so it is better to install vlc package with its dependencies
Now that we have the command available. Let's convert the video using the following command:
cvlc --video-filter scene -V dummy --scene-format="png" --scene-ratio=24 --scene-prefix=test --scene-path=<folder> <path-to-video> vlc://quit
A few comments on what this command does:
- We use cvlc and not vlc as this command we want to run as a command-line utility and avoid opening a new windows
- --video-filter scene: informs vlc that we want to use the scene module
- -V dummy: to avoid opening a window to show the video
- --scene-format=png: describes that we want to export the images in PNG format
- --scene-ratio=24: determines that 1 frame every 24 must be captured
- --scene-prefix=test: every new image will start with the string "test"
- --scene-path=<folder>: the images will be created in the folder test
- <path-to-video>: the path containing the video
- vlc://quit: to make sure that the we leave the command-line when all the images have been converted
No comments:
Post a Comment