Log in

View Full Version : Avisynth/vdub - how to set a video codec for encoding


pinkshiro
29th April 2010, 06:29
Hi,

I'm slowly making my way through Avisynth, using vdub.exe (virtual dub) at a command line level to execute my script and generate a video.

However, I am stuck at how to select a codec to encode the video with during this process. Not sure if I am supposed to set it inside AviSynth or with a vdub command.

This is the command line code I am using for vdub at the moment:

vdub.exe /p example.avs example.avi

vdub.exe /r

Vitaliy Gorbatenko
29th April 2010, 09:38
If you want a command line- use a mencoder.

encoder_lagarith.cmd:
X:\System\Video\megui\tools\mencoder\mencoder.exe %1.avs -o %1.avi -nosound -ovc vfw -xvfwopts codec=lagarith.dll

run as: encoder_lagarith.cmd you_file

dr.schanker
29th April 2010, 10:39
You can't normally select the codec in your Avisynth script (the only exception known to me is QTSource.dll, which can output to .mov while frameserving).
Your .avs will simply create a videostream and frameserve it to a requesting application.

I found to be the easiest way to batch encode with virtualdub is to use its "processing settings":

1.) Open VDub and load your .avs. Choose the settings you want (codec, filter, etc.).
Save these with [CRTL]+S or in the menu "File\Save processing settings".
This will give you a .vcf file.

2.) Use the commandline version of VDub with this .vcf file.
Example: "vdub.exe" /min /s "vdub_settings.vcf" /c /p "input.avs" "output.avi" /r /x

Good luck.

pinkshiro
29th April 2010, 10:59
:thanks:

dr.schanker: That did the trick, thank you! I have a rudimentary VCF file setup and I see it is encoding with the set codec. Good one.

Vitaliy Gorbatenko: Thanks alot for that information. May be a better alternative to vdub if I run into any more brick walls.