romgohan
29th June 2006, 12:22
I have written a simple dos batch file for creating a series o screenshots from a videoclip. It uses avs2avi (http://daveel.dnsalias.com/software/avs2avi-135.zip) for processing avs file.
@echo off
SET FILENAME=%1
SET DIR=%2
SET INT=%3
if .%INT%==. SET INT=60
echo DirectShowSource("%FILENAME%", audio=false)> batch.avs
echo SelectEvery(25*%INT%, 25*%INT%)>> batch.avs
echo AssumeFPS(25*%INT%)>> batch.avs
echo ConvertToRGB()>> batch.avs
echo ImageWriter("%DIR%", 0, 0, "jpg", info=false)>> batch.avs
echo crop(0,0,8,8)>> batch.avs
avs2avi batch.avs -o n -c XVID
del batch.avs
It takes 3 parameters filename, target directory for images and number of seconds between pictures.
It works but I would like to improve it a little:
- I have assumed 25fps, it is possible to get the real fps from the clip instead of specifing it?
- I would like to choose the best method for opening a clip DirectShowSource, avisource...
- add a posibility to give number of pictures(instead of an interval) as a parameter
I have also a small problem with windows processing filenames with spaces, it encloses them in "", and it breaks the script (it gets ""file name"").
I will appreciate any advice or help in improving the script.
@echo off
SET FILENAME=%1
SET DIR=%2
SET INT=%3
if .%INT%==. SET INT=60
echo DirectShowSource("%FILENAME%", audio=false)> batch.avs
echo SelectEvery(25*%INT%, 25*%INT%)>> batch.avs
echo AssumeFPS(25*%INT%)>> batch.avs
echo ConvertToRGB()>> batch.avs
echo ImageWriter("%DIR%", 0, 0, "jpg", info=false)>> batch.avs
echo crop(0,0,8,8)>> batch.avs
avs2avi batch.avs -o n -c XVID
del batch.avs
It takes 3 parameters filename, target directory for images and number of seconds between pictures.
It works but I would like to improve it a little:
- I have assumed 25fps, it is possible to get the real fps from the clip instead of specifing it?
- I would like to choose the best method for opening a clip DirectShowSource, avisource...
- add a posibility to give number of pictures(instead of an interval) as a parameter
I have also a small problem with windows processing filenames with spaces, it encloses them in "", and it breaks the script (it gets ""file name"").
I will appreciate any advice or help in improving the script.