Log in

View Full Version : Batch remux AVIs/strip audio stream?


Chetwood
23rd May 2010, 08:18
I've got a dir full of AVIs with two VBR audio streams. I want to strip the second audio from each file. How do I do that in Windows? TIA!

s4
23rd May 2010, 18:33
Use sthing like this

@echo off
set vdmod=C:\VirtualDub\VirtualDubMod.exe
dir /B/S *.avi > files.txt
set /a num=1
@Setlocal ENABLEDELAYEDEXPANSION
for /F "" %%I in (files.txt) do (
set temp=%%I
set /a test=!temp!
set videofiles=%test:\=\\%
echo VirtualDub.Open("%videofiles%","",0); > muxing.vcf
VirtualDub.RemoveInputStreams(); >> muxing.vcf
VirtualDub.stream[0].SetSource(0x73647561,0,1); >> muxing.vcf
VirtualDub.video.SetMode(0); >> muxing.vcf
VirtualDub.SaveAVI("newavi_%num%.avi"); >> muxing.vcf
VirtualDub.Close(); >> muxing.vcf
set /a num=!num!+1
%vdmod% /smuxing.vcf /x
)
@endlocal

I'm not sure its 100% working, but u can modify it
1. list avi files to a text files
2. make a for cycle reading this text file
3. set the path into a variable
4. replace \ to \\ for virtualdub can read it
5. generate a .vcf file which disable the second audio track
6. call virtualdub & vcf for working
7. the for cycle repeat it to the last file

PS: i used the num variable for making easier the saving process, first video files gives newavi_1.avi, the secon -> newavi_2.avi

Chetwood
24th May 2010, 09:41
Thanks. After looking at your script I read more about Vdub jobs and found DubMan (http://dubman.sourceforge.net) which automates job processing just fine so there's no need for manual scripting.