1

第三天!

新的输出文件 txt:

Filename          : %FILENAME%.%EXTENSION%
Sizes             : 1.66 GiB for 1h 58mn 0s 615ms at 2 014 Kbps
Writing_App       : VirtualDubMod 1.5.10.2 (build 2542/release)

Video_#0          : DivX 5 MPEG-4 Visual at 1 812 Kbps, with 1.49 GiB (90%)
Aspect            : 704 x 368 (1.913) at 23.976 fps
Writing_App_V     : DivX 6.8.5 (UTC 2009-08-20)

Audio_#0          : AC3
Mode_#0           : Constant
Sample_#0         : 48000
Channels_#0       : 2
Size_#0           : 162 MiB (10%)
Title_#0          : 

Audio_#1          : MP3
Mode_#1           : Constant
Sample_#1         : 44100
Channels_#1       : 2
Size_#1           : 101 MiB (11%)
Title_#1          : 

rem Required to use Delayed !Variable! Expansion
setlocal EnableDelayedExpansion
rem Create all text files (copied from your example)
rem for %%T in ("*.avi") do "C:\Meus Programas\MEDIA\MediaInfo CLI\MediaInfo.exe" --output=file://"C:\Meus Programas\MEDIA\MediaInfo CLI\luis4.csv" --logfile="%%~nT.cod" "%%T"
rem echo.>TXTCollector.lst
rem for %%Z in ("*.cod") do type "%%~Z">>TXTCollector.lst && echo ===========================================>>TXTCollector.lst && echo.>>TXTCollector.lst
rem ren TXTCollector.lst TXTCollector.txt
rem Process each file
for %%F in (*.cod) do (
   rem Delete variables that may not exist in certain files
   set Audio_#1=
   rem Read variables from this text file (explained above)
   for /F "usebackq tokens=1* delims=:" %%a in ("%%F") do (
      for %%c in (%%a) do set %%c=%%b
      set %%c=!%%c:~1!
   )
   ECHO VirtualDub.Open("r:\\%%~nF.avi","",0);>"%%~nF.vcf"
   ECHO VirtualDub.RemoveInputStreams();>>"%%~nF.vcf"
)

写完所有的bat文件,开始调试。我的前两行开始出现问题。这批是创建一个脚本文件 (.vcf) 并且使用 >> 的重定向不再起作用。
ECHO VirtualDub.Open("r:\%%~nF.avi","",0);>"%%~nF.vcf"
使用参数 %%~nF.vcf 创建了一个名称正确但已刷新的文件在文件中所有由
for /F "usebackq tokens=1* delims=:" %%a in ("%%F")
ECHO VirtualDub.RemoveInputStreams();>>"%%~nF.vcf" 生成的工作一个名为 %~nF.vcf 的文件(这意味着该参数不再起作用。)
尝试关闭 EnableDelayedExpansion,结果相同。也许是因为括号。
又卡住了!


第二天!

好的,@Aacini,谢谢...将尝试恢复...我有很多文件要处理...我为每个文件生成一个 .txt。我正在尝试做一个批处理来读取每个 .txt 并决定如何处理原始文件。

文本文件:

General
ORIGINAL_FILENAME.avi
818 MiB for 1h 46mn 25s 14ms
AVI-Mux GUI 1.16.11, Dec 15 2004  14:51:34

Video #0
XviD MPEG-4 Visual, with 624 MiB (76%),  at 23.976 fps
XviD 1.2.1 (UTC 2008-12-04)

Audio #0
MPEG Audio Version 1 Layer 3
Variable
44.1 KHz
2 channels
85.8 MiB (10%)
Portuguese BR - 3LT0N
LAME3.93a

Audio #1
MPEG Audio Version 1 Layer 3
Variable
48.0 KHz
2 channels
97.5 MiB (12%)
English - 3LT0N
LAME3.98r

到目前为止我一直在考虑的批次...

IF DOESNT EXIST "Audio #1" in TXT goto :ONEAUDIO
IF EXIST "AC-3" in TXT goto :AC3

Set Value 0 from txt line 02 = filename

"for audio 1"
Set Value 1 from txt line 12 = Variable OR Constant
Set Value 2 from txt line 13 = 44.1 OR 48.0

"for audio 2"
Set Value 3 from txt line 21 = Variable or Constant
Set Value 4 from txt line 22 = 44.1 or 48.0

if value 1 = variable goto :variable1 ELSE goto :constant1

:variable1
(will execute some commands here)
if value 2 = 44.1 goto :22 ELSE goto :24

:22
(will execute some commands here)
goto :jump24

:24
(will execute some commands here)

:jump24
if value 3 = variable goto :variable2 ELSE goto :constant2

:variable2
(will execute some commands here)
if value 4 = 44.1 goto :44 ELSE goto :48

:44
(will execute some commands here)
goto :end

:48
(will execute some commands here)
goto :end

:constant1
(will execute some commands here)
goto :end

:constant2
(will execute some commands here)
goto :end


:ONEAUDIO
later
goto :end

:AC3
later
goto :end

:end

这会遇到一些麻烦...我只了解 FOR (LOOP) 并且据我所知它不能与 GOTO 一起使用:EXAMPLE。也许使用两个批处理文件工作......调用第二批解析filename.txt的循环

我在想的另一种方法是批量为每个视频文件生成一个“批处理模型”,然后读取视频文件的 .txt,然后替换“批处理模型”中的字符串。但这对我来说太先进了。


第一天:

我需要帮助才能将我的批处理文件合并到一个文件中,并为该批处理添加读取文件 .txt 并决定同一目录中一堆视频的后续步骤的能力。这一切都是关于将音频从 avi 转换为生成与编辑程序的兼容性......

步骤是:

1) 为每个视频文件生成一个 .txt,其中包含有关视频和音频的基本信息。

for %%a in ("*.avi") do "C:\Meus Programas\MEDIA\MediaInfo CLI\MediaInfo.exe" --output=file://"C:\Meus Programas\MEDIA\MediaInfo CLI\luis.csv" --logfile="%%~na.txt" "%%a"

或生成一个包含所有小文件的大文件:

for %%a in ("*.avi") do "C:\Meus Programas\MEDIA\MediaInfo CLI\MediaInfo.exe" --output=file://"C:\Meus Programas\MEDIA\MediaInfo CLI\luis.csv" --logfile="%%~na.txt" "%%a"
echo.>TXTCollector.lst
for %%i in ("*.txt") do type "%%~i">>TXTCollector.lst && echo ===========================================>>TXTCollector.lst && echo.>>TXTCollector.lst && del "%%~i"
ren TXTCollector.lst TXTCollector.txt

输出文件示例:

General           : ORIGINAL NAME FOR THE VIDEO FILES.avi
Format            : 820 MiB for 1h 26mn 38s 777ms at 1 324 Kbps
Writing App.      : VirtualDubMod 1.5.10.2 (build 2540/release)

Video #0          : XviD MPEG-4 Visual at 925 Kbps, with 574 MiB (70%)
Aspect            : 608 x 336 (16:9) at 23.976 fps
Writing App.      : XviD 1.2.1 (UTC 2008-12-04)

Audio #0          : 119 MiB (15%), AC-3  ,  
Infos             : Constant at 192 Kbps, 48.0 KHz, 1 channel
Writing App.      : , 

Audio #1          : 110 MiB (12%), MPEG Audio Version 1 Layer 3,  
Infos             : Constant at 128 Kbps, 48.0 KHz, 2 channels
Writing App.      : LAME3.97 , -m j -V 4 -q 2 -lowpass 17 -b 128

2)从那里,从文件中读取音频格式,我将文件移动到特定文件夹并在该文件夹中执行批处理以运行转换。

以蝙蝠为例。

REM @echo off
:: create the virtual drives and go to the root of drive r:
set ORIGINALDIR=%~d0
subst r: "%cd%"
md JobDone
subst s: "%cd%\JobDone"
r:
cd\
for %%w in ("*.avi") do ECHO VirtualDub.Open("r:\\%%~w","",0);>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.RemoveInputStreams();>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[0].SetSource(0x73647561,0,1);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[0].DeleteComments(1);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[0].AddComment(0x00000003,"","Portuguese");>>"%%~nw.vcf"
REM for %%w in ("*.avi") do ECHO VirtualDub.stream[0].AddComment(0x00000003,"","English");>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[0].AdjustChapters(1);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[0].SetMode(1);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[0].SetInterleave(1,500,1,0,0);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[0].SetClipMode(1,1);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[0].SetConversion(0,0,0,0,0);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[0].SetVolume();>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[0].SetCompression(85,48000,2,0,16000,1,12,"AQAEAAAAgAEBAAAA");>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[0].EnableFilterGraph(0);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[0].filters.Clear();>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[1].SetSource(0x73647561,1,1);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[1].DeleteComments(1);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[1].AddComment(0x00000003,"","English");>>"%%~nw.vcf"
REM for %%w in ("*.avi") do ECHO VirtualDub.stream[1].AddComment(0x00000003,"","Portuguese");>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[1].AdjustChapters(1);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[1].SetMode(1);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[1].SetInterleave(1,500,1,0,0);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[1].SetClipMode(1,1);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[1].SetConversion(0,0,0,0,0);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[1].SetVolume();>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[1].SetCompression(85,48000,2,0,16000,1,12,"AQAEAAAAgAEBAAAA");>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[1].EnableFilterGraph(0);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.stream[1].filters.Clear();>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.video.DeleteComments(1);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.video.AddComment(0x00000002,"ISFT","VirtualDubMod 1.5.10.2 (build 2542/release)");>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.video.AdjustChapters(1);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.video.SetDepth(24,24);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.video.SetMode(0);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.video.SetFrameRate(0,1);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.video.SetIVTC(0,0,-1,0);>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.video.SetCompression();>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.video.filters.Clear();>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.SaveAVI("s:\\%%~nw.avi");>>"%%~nw.vcf"
for %%w in ("*.avi") do ECHO VirtualDub.Close();>>"%%~nw.vcf"

:: Execute the script file just created
for %%a in ("*.vcf") do "C:\VirtualDubMod\VirtualDubMod.exe" /r /s"%%~fa" /x && del "%%~fa"

:: go back to previous folder and delete the virtual drives.
%ORIGINALDIR%
REM %~d0
subst r: /d
subst s: /d

:end

我有一个文件夹和每个作业的批次。基本上它是 3 个不同的过程: 带有 AC3 音频的视频文件需要不同的方法......带有 MP3 的视频文件将所有内容转换为恒定比特率和 48000 采样率。具有恒定比特率的视频文件不需要转换,只需重新混合即可。

ONE AUDIO
+AC3 AUDIO
--2 CHANNELS
--6 CHANNELS
+MP3 AUDIO
--44100 SAMPLING RATE
--48000 SAMPLING RATE
+JUST REMUX AUDIO

TWO AUDIOS
+AC3
--2ch-2ch
--2ch-6ch
--6ch-2ch
--6ch-6ch
+1ST AUDIO ONLY
--44100
--48000
+2ND AUDIO ONLY
--44100
--48000
+44100-44100
+44100-48000
+48000-41000
+48000-48000
+INVERT AUDIO (just change the order of the audio tracks, no converting)
+JUST REMUX

这是乐趣开始的地方:

只有一个音频的视频文件很少见……可以排除在批次之外。如果...有一个 bat 文件可以完成所有操作...那么 (*.avi) 的 LOOP 将不再起作用,因为每个视频文件都有自己的属性...然后再次...批处理将具有根据文件名创建脚本(或创建脚本的新 bat)。

Audio #0          : 119 MiB (15%), AC-3  ,  
Infos             : Constant at 192 Kbps, 48.0 KHz, 1 channel
Writing App.      : , 

只是想......如果它只是一个音频......那么:有ac3(有2ch做2通道转换;如果没有做6通道转换)如果不是ac3(有常数->只是remux->否则(如果48.0进行 48.0 转换;否则进行 41000 转换)

这“很简单”但是文件有两个音频……现在对我来说很难。

Audio #0          : 119 MiB (15%), AC-3  ,  
Infos             : Constant at 192 Kbps, 48.0 KHz, 1 channel
Writing App.      : , 

Audio #1          : 110 MiB (12%), MPEG Audio Version 1 Layer 3,  
Infos             : Constant at 128 Kbps, 48.0 KHz, 2 channels
Writing App.      : LAME3.97 , -m j -V 4 -q 2 -lowpass 17 -b 128

让我解释一下:“Just remux”和“MP3s conversions”使用来自视频文件的内部音频。“AC3转换”并不是那么简单。必须从文件中提取音频,与其他应用程序进行第一次转换,然后在原始程序中进行第二次转换。

md audio1
for %%x in ("*.avi") do "C:\VirtualDubMod\ffmpeg.exe" -i "%%x" -vn -map 0:1 -acodec copy "%%~dpxaudio1\%%~nx.audio1.ac3"

md audio2
for %%u in ("*.avi") do "C:\VirtualDubMod\ffmpeg.exe" -i "%%u" -vn -map 0:2 -acodec copy "%%~dpuaudio2\%%~nu.audio2.ac3"

cd audio1
for %%y in ("*.ac3") do "c:\Meus Programas\AUDIO\BeSweet\BeSweet.exe" -core( -input "%%~fy" -output "%%~dpy%%~ny.wav" -2ch ) -azid( -c light ) -ota( -hybridgain ) && del "%%~y"

cd..
cd audio2
for %%y in ("*.ac3") do "c:\Meus Programas\AUDIO\BeSweet\BeSweet.exe" -core( -input "%%~fy" -output "%%~dpy%%~ny.wav" -2ch ) -azid( -c light -L -3db ) -ota( -hybridgain ) && del "%%~y"

为转换生成的脚本可以分成几部分:1)要处理的视频文件2)第一个音频和转换obs的选项:mp3(不需要指定文件,它是内部音频的代码)AC3(有指定 .wav 文件名)3)第二个音频和转换选项 4)视频和转换选项 5)保存新文件的文件名 6)在进程结束时关闭应用程序的命令。

批处理可以创建一个脚本(或一个新的批处理来生成脚本)一个一个地粘贴这些和平。并且该批次可以有一个“目录”,并通过有关音频的信息选择正确的一个....

这可能吗?

4

2 回答 2

0

好的。我会尝试从所有这些混乱中弄清楚一些事情......

您向我们展示了文本文件的两种不同格式。第一个(在输出文件示例下)更容易处理。我想您可以修改此文件,以便通过插入下划线或数字(作为有效的批处理变量名称)使每行的标题是唯一的并且没有空格。这是我的程序所需格式的示例文件:

General           : ORIGINAL NAME FOR THE VIDEO FILES.avi
Format            : 820 MiB for 1h 26mn 38s 777ms at 1 324 Kbps
Writing_App       : VirtualDubMod 1.5.10.2 (build 2540/release)

Video_#0          : XviD MPEG-4 Visual at 925 Kbps, with 574 MiB (70%)
Aspect            : 608 x 336 (16:9) at 23.976 fps
Writing_App_V0    : XviD 1.2.1 (UTC 2008-12-04)

Audio_#0          : 119 MiB (15%), AC-3  ,  
Infos_A0          : Constant at 192 Kbps, 48.0 KHz, 1 channel
Writing_App_A0    : , 

Audio_#1          : 110 MiB (12%), MPEG Audio Version 1 Layer 3,  
Infos_A1          : Constant at 128 Kbps, 48.0 KHz, 2 channels
Writing_App_A1    : LAME3.97 , -m j -V 4 -q 2 -lowpass 17 -b 128

以下代码将读取前一个文件并使用右侧的值定义冒号左侧的变量:

rem Read each line from the text file
for /F "tokens=1* delims=:" %%a in (thefile.txt) do (
   rem Eliminate spaces from variable name
   for %%c in (%%a) do set %%c=%%b
   rem Eliminate first character (space) from variable value
   set %%c=!%%c:~1!
)

上一个循环结束后,您可以直接获取每个变量的值。例如,ECHO !Format! IF NOT DEFINED Audio_#1 ECHO 一个音频IF "!Audio_#0:AC-3=!" EQU "!Audio_#0!" ECHO Audio #0 不是 AC-3"等。

这是将所有部分放在一起的第一次尝试:

@echo off
rem Required to use Delayed !Variable! Expansion
setlocal EnableDelayedExpansion
rem Create all text files (copied from your example)
for %%a in ("*.avi") do "C:\Meus Programas\MEDIA\MediaInfo CLI\MediaInfo.exe" --output=file://"C:\Meus Programas\MEDIA\MediaInfo CLI\luis.csv" --logfile="%%~na.txt" "%%a"
rem Process each file
for %%f in (*.txt) do (
   rem Delete variables that may not exist in certain files
   set Audio_#1=
   rem Read variables from this text file (explained above)
   for /F "usebackq tokens=1* delims=:" %%a in ("%%f") do (
      for %%c in (%%a) do set %%c=%%b
      set %%c=!%%c:~1!
   )
   rem Identify each case
   set AC-3=NO
   if "!Audio_#0:AC-3=!" neq "!Audio_#0!" set AC-3=YES
   if not defined Audio_#1 (
      rem One Audio
      if !AC-3! equ YES (
         rem Process One Audio with AC-3
      ) else (
         rem Process One Audio with no AC-3
      )
   ) else (
      rem Two Audios
      if "!Audio_#1:AC-3=!" neq "!Audio_#1!" set AC-3=YES
      if !AC-3! equ YES (
         rem Process Two Audios with AC-3
      ) else (
         rem Process Two Audios with no AC-3
      )
   )
)

试着理解这段代码并做几个测试,然后发布你的新问题。

安东尼奥

附录关于“从变量名中消除空格”的解释

如果这个 FOR 命令:

for /F "tokens=1* delims=:" %%a in (thefile.txt) do (
   set %%a=%%b
)

阅读这一行:

General           : ORIGINAL NAME FOR THE VIDEO FILES.avi

那么执行的 SET 命令是这样的:

   set General           = ORIGINAL NAME FOR THE VIDEO FILES.avi

这样,变量名正好是“General<11个空格>”,所以

echo %General%               does NOT work
echo %General           %    OK

为了避免这种混乱,必须删除变量名中的空格。

你必须知道,如果你执行这个命令:

for %%a in (    one        two         threee      ) do echo "%%a"

结果是:

"one"
"two"
"three"

因此可以使用 FOR 命令来消除空格。好的?

于 2012-11-01T05:18:18.223 回答
0

该批次正在运行,并针对所有类型的文件进行了测试。感谢所有的帮助。这批正在做预期的事情,但它还有一些工作要做。它可以清洗很多。之后...

@echo off
rem create the virtual drives needed to VirtualDubMod work
set ORIGINALDRIVE=%~d0
subst r: "%cd%"
md JobDone
subst s: "%cd%\JobDone"
r:
cd\
rem Required to use Delayed !Variable! Expansion
setlocal EnableDelayedExpansion
rem Create all text files (copied from your example)
for %%T in ("*.avi") do "C:\Meus Programas\MEDIA\MediaInfo CLI\MediaInfo.exe" --output=file://"C:\Meus Programas\MEDIA\MediaInfo CLI\luis4.csv" --logfile="%%~nT.cod" "%%T"
rem Create "catalogue" from all INFOs created.
echo.>TXTCollector.lst
for %%Z in ("*.cod") do type "%%~Z">>TXTCollector.lst && echo ===========================================>>TXTCollector.lst && echo.>>TXTCollector.lst
ren TXTCollector.lst TXTCollector.txt
rem Process each file
for %%F in (*.cod) do (
   rem Setting the variables needed!
   set NAMEFILE=%%~nF
   rem Delete variables that may not exist in certain files
   set Audio_#1=
   rem Read variables from this text file (explained above)
   for /F "usebackq tokens=1* delims=:" %%a in ("%%F") do (
      rem Eliminate spaces from variable name?????????
      for %%c in (%%a) do (
         set %%c=%%b
         rem Eliminate first character (space) from variable value
         set %%c=!%%c:~1!
      )
   )
   ECHO VirtualDub.Open^("r:\\!NAMEFILE!.avi","",0^);>"!NAMEFILE!.vcf"
   ECHO VirtualDub.RemoveInputStreams^(^);>>"!NAMEFILE!.vcf"
   rem PROCESS FIRST AUDIO
   if !Audio_#0! equ AC3 (
      rem PROCESS AC3
      if !Channels_#0! equ 6 (
         rem Process AC3 6 Channels
         ECHO -=-=-=-=-=-=-=-=-=-=-
         ECHO AC3_1 HAS 6 CHANNELS
         ECHO -=-=-=-=-=-=-=-=-=-=-
         "C:\VirtualDubMod\ffmpeg.exe" -i "!NAMEFILE!.avi" -vn -map 0:1 -acodec copy "r:\!NAMEFILE!.audio1.ac3"
         "c:\Meus Programas\AUDIO\BeSweet\BeSweet.exe" -core^( -input "r:\!NAMEFILE!.audio1.ac3" -output "r:\!NAMEFILE!.audio1.wav" -2ch ^) -azid^( -c light -L -3db ^) -ota^( -hybridgain ^)
         del "r:\!NAMEFILE!.audio1.ac3"
      ) else (
         rem Process AC3 2 or 1 Channels
         ECHO -=-=-=-=-=-=-=-=-=-=-
         ECHO AC3_1 HAS 2 CHANNELS
         ECHO -=-=-=-=-=-=-=-=-=-=-
         "C:\VirtualDubMod\ffmpeg.exe" -i "!NAMEFILE!.avi" -vn -map 0:1 -acodec copy "r:\!NAMEFILE!.audio1.ac3"
         "c:\Meus Programas\AUDIO\BeSweet\BeSweet.exe" -core^( -input "r:\!NAMEFILE!.audio1.ac3" -output "r:\!NAMEFILE!.audio1.wav" -2ch ^) -azid^( -c light ^) -ota^( -hybridgain ^)
         del "r:\!NAMEFILE!.audio1.ac3"
      )
      ECHO VirtualDub.stream[0].SetSource^("r:\\!NAMEFILE!.audio1.wav",0x00000201^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[0].DeleteComments^(1^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[0].AddComment^(0x00000003,"","Portuguese"^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[0].AdjustChapters^(1^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[0].SetMode^(1^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[0].SetInterleave^(1,500,1,0,0^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[0].SetClipMode^(1,1^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[0].SetConversion^(0,0,0,0,0^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[0].SetVolume^(^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[0].SetCompression^(85,48000,2,0,16000,1,12,"AQAEAAAAgAEBAAAA"^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[0].EnableFilterGraph^(0^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[0].filters.Clear^(^);>>"!NAMEFILE!.vcf"
   ) else (
      rem PROCESS MP3
      if !Mode_#0! equ Constant (
         rem JUST REMUX AUDIO
         ECHO VirtualDub.stream[0].SetSource^(0x73647561,0,0^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].DeleteComments^(1^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].AddComment^(0x00000003,"","Portuguese"^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].AdjustChapters^(1^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].SetMode^(0^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].SetInterleave^(1,500,1,0,0^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].SetClipMode^(1,1^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].SetConversion^(0,0,0,0,0^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].SetVolume^(^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].SetCompression^(^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].EnableFilterGraph^(0^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].filters.Clear^(^);>>"!NAMEFILE!.vcf"
      ) else (
         rem REDO AUDIO
         ECHO VirtualDub.stream[0].SetSource^(0x73647561,0,1^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].DeleteComments^(1^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].AddComment^(0x00000003,"","Portuguese"^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].AdjustChapters^(1^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].SetMode^(1^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].SetInterleave^(1,500,1,0,0^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].SetClipMode^(1,1^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].SetConversion^(0,0,0,0,0^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].SetVolume^(^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[0].SetCompression^(85,48000,2,0,16000,1,12,"AQAEAAAAgAEBAAAA"^);>>"!NAMEFILE!.vcf"
         if !Sample_#0! equ 44100 (
            rem REDO 44100 AUDIO
            ECHO VirtualDub.stream[0].EnableFilterGraph^(1^);>>"!NAMEFILE!.vcf"
            ECHO VirtualDub.stream[0].filters.Clear^(^);>>"!NAMEFILE!.vcf"
            ECHO VirtualDub.stream[0].filters.Add^("input"^);>>"!NAMEFILE!.vcf"
            ECHO VirtualDub.stream[0].filters.Add^("resample"^);>>"!NAMEFILE!.vcf"
            ECHO VirtualDub.stream[0].filters.Connect^(0, 0, 1, 0^);>>"!NAMEFILE!.vcf"
            ECHO VirtualDub.stream[0].filters.instance[1].SetInt^(0, 48000^);>>"!NAMEFILE!.vcf"
            ECHO VirtualDub.stream[0].filters.instance[1].SetInt^(1, 64^);>>"!NAMEFILE!.vcf"
            ECHO VirtualDub.stream[0].filters.Add^("output"^);>>"!NAMEFILE!.vcf"
            ECHO VirtualDub.stream[0].filters.Connect^(1, 0, 2, 0^);>>"!NAMEFILE!.vcf"
         ) else (
            rem REDO 48000 AUDIO
            ECHO VirtualDub.stream[0].EnableFilterGraph^(0^);>>"!NAMEFILE!.vcf"
            ECHO VirtualDub.stream[0].filters.Clear^(^);>>"!NAMEFILE!.vcf"
         )
      )
   )
   rem PROCESS SECOND AUDIO
   if !Audio_#1! equ AC3 (
      rem PROCESS AC3
      if !Channels_#1! equ 6 (
         rem Process AC3 6 Channels
         ECHO -=-=-=-=-=-=-=-=-=-=-
         ECHO AC3_2 HAS 6 CHANNELS
         ECHO -=-=-=-=-=-=-=-=-=-=-
         "C:\VirtualDubMod\ffmpeg.exe" -i "!NAMEFILE!.avi" -vn -map 0:1 -acodec copy "r:\!NAMEFILE!.audio2.ac3"
         "c:\Meus Programas\AUDIO\BeSweet\BeSweet.exe" -core^( -input "r:\!NAMEFILE!.audio2.ac3" -output "r:\!NAMEFILE!.audio2.wav" -2ch ^) -azid^( -c light -L -3db ^) -ota^( -hybridgain ^)
         del "r:\!NAMEFILE!.audio2.ac3"
      ) else (
         rem Process AC3 2 or 1 Channels
         ECHO -=-=-=-=-=-=-=-=-=-=-
         ECHO AC3_2 HAS 2 CHANNELS
         ECHO -=-=-=-=-=-=-=-=-=-=-
         "C:\VirtualDubMod\ffmpeg.exe" -i "!NAMEFILE!.avi" -vn -map 0:2 -acodec copy "r:\!NAMEFILE!.audio2.ac3"
         "c:\Meus Programas\AUDIO\BeSweet\BeSweet.exe" -core^( -input "r:\!NAMEFILE!.audio2.ac3" -output "r:\!NAMEFILE!.audio2.wav" -2ch ^) -azid^( -c light ^) -ota^( -hybridgain ^)
         del "r:\!NAMEFILE!.audio2.ac3"
      )
      ECHO VirtualDub.stream[1].SetSource^("r:\\!NAMEFILE!.audio2.wav",0x00000201^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[1].DeleteComments^(1^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[1].AddComment^(0x00000003,"","English"^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[1].AdjustChapters^(1^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[1].SetMode^(1^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[1].SetInterleave^(1,500,1,0,0^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[1].SetClipMode^(1,1^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[1].SetConversion^(0,0,0,0,0^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[1].SetVolume^(^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[1].SetCompression^(85,48000,2,0,16000,1,12,"AQAEAAAAgAEBAAAA"^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[1].EnableFilterGraph^(0^);>>"!NAMEFILE!.vcf"
      ECHO VirtualDub.stream[1].filters.Clear^(^);>>"!NAMEFILE!.vcf"
   ) else (
      rem PROCESS MP3
      if !Mode_#0! equ Constant (
         rem JUST REMUX AUDIO
         ECHO VirtualDub.stream[1].SetSource^(0x73647561,1,0^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].DeleteComments^(1^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].AddComment^(0x00000003,"","English"^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].AdjustChapters^(1^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].SetMode^(0^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].SetInterleave^(1,500,1,0,0^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].SetClipMode^(1,1^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].SetConversion^(0,0,0,0,0^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].SetVolume^(^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].SetCompression^(^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].EnableFilterGraph^(0^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].filters.Clear^(^);>>"!NAMEFILE!.vcf"
      ) else (
         rem REDO AUDIO
         ECHO VirtualDub.stream[1].SetSource^(0x73647561,1,1^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].DeleteComments^(1^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].AddComment^(0x00000003,"","English"^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].AdjustChapters^(1^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].SetMode^(1^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].SetInterleave^(1,500,1,0,0^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].SetClipMode^(1,1^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].SetConversion^(0,0,0,0,0^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].SetVolume^(^);>>"!NAMEFILE!.vcf"
         ECHO VirtualDub.stream[1].SetCompression^(85,48000,2,0,16000,1,12,"AQAEAAAAgAEBAAAA"^);>>"!NAMEFILE!.vcf"
         if !Sample_#0! equ 44100 (
            rem REDO 44100 AUDIO
            ECHO VirtualDub.stream[1].EnableFilterGraph^(1^);>>"!NAMEFILE!.vcf"
            ECHO VirtualDub.stream[1].filters.Clear^(^);>>"!NAMEFILE!.vcf"
            ECHO VirtualDub.stream[1].filters.Add^("input"^);>>"!NAMEFILE!.vcf"
            ECHO VirtualDub.stream[1].filters.Add^("resample"^);>>"!NAMEFILE!.vcf"
            ECHO VirtualDub.stream[1].filters.Connect^(0, 0, 1, 0^);>>"!NAMEFILE!.vcf"
            ECHO VirtualDub.stream[1].filters.instance[1].SetInt^(0, 48000^);>>"!NAMEFILE!.vcf"
            ECHO VirtualDub.stream[1].filters.instance[1].SetInt^(1, 64^);>>"!NAMEFILE!.vcf"
            ECHO VirtualDub.stream[1].filters.Add^("output"^);>>"!NAMEFILE!.vcf"
            ECHO VirtualDub.stream[1].filters.Connect^(1, 0, 2, 0^);>>"!NAMEFILE!.vcf"
         ) else (
            rem REDO 48000 AUDIO
            ECHO VirtualDub.stream[1].EnableFilterGraph^(0^);>>"!NAMEFILE!.vcf"
            ECHO VirtualDub.stream[1].filters.Clear^(^);>>"!NAMEFILE!.vcf"
         )
      )
   )
   ECHO VirtualDub.video.DeleteComments^(1^);>>"!NAMEFILE!.vcf"
   ECHO VirtualDub.video.AddComment^(0x00000002,"ISFT","VirtualDubMod 1.5.10.2 (build 2542/release)"^);>>"!NAMEFILE!.vcf"
   ECHO VirtualDub.video.AdjustChapters^(1^);>>"!NAMEFILE!.vcf"
   ECHO VirtualDub.video.SetDepth^(24,24^);>>"!NAMEFILE!.vcf"
   ECHO VirtualDub.video.SetMode^(0^);>>"!NAMEFILE!.vcf"
   ECHO VirtualDub.video.SetFrameRate^(0,1^);>>"!NAMEFILE!.vcf"
   ECHO VirtualDub.video.SetIVTC^(0,0,-1,0^);>>"!NAMEFILE!.vcf"
   ECHO VirtualDub.video.SetCompression^(^);>>"!NAMEFILE!.vcf"
   ECHO VirtualDub.video.filters.Clear^(^);>>"!NAMEFILE!.vcf"
   ECHO VirtualDub.SaveAVI^("s:\\!NAMEFILE!.avi"^);>>"!NAMEFILE!.vcf"
   ECHO VirtualDub.Close^(^);>>"!NAMEFILE!.vcf"
   "C:\VirtualDubMod\VirtualDubMod.exe" /r /s"R:\!NAMEFILE!.vcf" /x
   rem del "!NAMEFILE!.vcf"
   del "!NAMEFILE!.cod"
   rem del "!NAMEFILE!.audio1.wav"
   rem del "!NAMEFILE!.audio2.wav"
)
rem go back to original folder and delete the virtual drives.
%ORIGINALDRIVE%
subst r: /d
subst s: /d
于 2012-11-02T21:09:22.253 回答