Log in

View Full Version : source: avi -> target: bmp


chameleon
23rd November 2009, 02:19
I am totally new to avisynth.

Can write a script which converts VIDEO.AVI (any encoding) to a sequence of BMP files? (FILE00001.BMP FILE00002.BMP etc)

Leak
23rd November 2009, 10:25
Can write a script which converts VIDEO.AVI (any encoding) to a sequence of BMP files? (FILE00001.BMP FILE00002.BMP etc)
While the answer is mostly yes you're probably better off with a program like VirtualDub that supports creating image files from a video (or AviSynth script, in this case), since even if you use AviSynth's ImageWriter (http://avisynth.org/mediawiki/ImageWriter) plugin you'd still have to play the whole movie anyway to get AviSynth to process all frames...

smok3
23rd November 2009, 11:02
vdubtga.bat (a bit ugly, since it renames the original file temporarily):

rem purpose - to transcode any avi into targa sequence


@ECHO OFF


rem edit the path to video script file here:
echo ------------------------------------ vdub video to targa seq
:: strip .avi from original file
rename "%1" "%~n1"

:: make subdir
md %~p1%~n1_dir

:: vdub
@vdub /i "t:\path\vdubtarga.script" "%~n1" "%~p1%~n1.tga"

:: add avi back to original file
rename "%~n1" "%~n1.avi"

:: move targas to subdir
move %~n1*.tga %~p1%~n1_dir

t:\path\vdubtarga.script :


VirtualDub.Open(VirtualDub.params[0]);
VirtualDub.audio.SetSource(0);
VirtualDub.audio.SetInterleave(1,500,1,0,0);
VirtualDub.audio.SetClipMode(1,1);
VirtualDub.audio.SetConversion(0,0,0,0,0);
VirtualDub.audio.SetVolume();
VirtualDub.audio.SetCompression();
VirtualDub.audio.EnableFilterGraph(0);
VirtualDub.video.SetInputFormat(0);
VirtualDub.video.SetOutputFormat(7);
VirtualDub.video.SetMode(3);
VirtualDub.video.SetFrameRate(0,1);
VirtualDub.video.SetIVTC(0,0,-1,0);
VirtualDub.video.SetRange(0,0);
VirtualDub.video.SetCompression();
VirtualDub.video.filters.Clear();
VirtualDub.audio.filters.Clear();


VirtualDub.SaveImageSequence(VirtualDub.params[0], ".tga", 4, 1, 95);

VirtualDub.Close();

Mounir
2nd December 2009, 15:03
More precisely, you need virtualdub mpeg2 which handle images sequences correctly, especially for Export.
Otherwise, you may have to rename manually or with a tool like "batch rename" in photoshop (bridge) which takes time and probably (lot of) space.

wonkey_monkey
2nd December 2009, 17:19
More precisely, you need virtualdub mpeg2 which handle images sequences correctly

In what way does regular VirtualDub handle them incorrectly?

David

Mounir
3rd December 2009, 01:43
I don't use vdub but vdub mod and vdub mpeg2 actually.If vdub has an option like vdub mpeg2 "minimum number digits"(set it to 4) it's cool otherwise use vdub mpeg2. Discard this friendly advice if you don't work with photoshop/paintshop tho.