我正在制作一段一段的视频,用文件名scene1.avi、scene2.avi等保存。
我想要一个简单的方法,把视频建在一个街区和配音在音频轨道。为此,我使用VirtualDub。
现在,我可以很简单地打开VirtualDub,通过文件=>打开,加载第一个场景,到文件=>附加视频片段,选择第二个场景,检查“通过文件名自动检测附加片段”选项,将视频设置为直接流复制,将音频设置为“从其他文件”并选择配音,然后将整个场景保存为out.avi.但这需要四句话来解释这一切!
我想要的是一个VCF脚本来一起构建所有这些文件。不幸的是,编码语言糟透了。
当我创建这个脚本语言时,我不知道我在想什么。它非常松散地基于C,但它更糟糕。在我创造Bubblegum危机之前,我一定是在看它。 所有语句都是声明或表达式,所有语句都必须以分号结尾。没有流量控制-没有功能,没有程序,没有如果,没有时间,没有为,没有开关,没有后藤。
没有if没有while没有for..。所以我想while file exists("scene"+i+".avi") {VirtualDub.Append("scene"+i+".avi"); i++;}是完全不可能的。
我使用批处理脚本来检查VCF文件的存在,并使用正确的命令行运行VirtualDub来运行脚本,所以也许我可以使用该脚本“构建”包含所有文件所需的VCF文件?是否有任何方法自动检测VCF文件中的段,还是必须使用批处理脚本自定义构建VCF?
发布于 2014-02-23 20:28:20
我只是在研究了做类似事情的方法之后,遇到了这个问题。在我看来,最好的方法是编写一个小脚本或程序,生成一个VirtualDub脚本文件供一次使用,然后执行它。
例如,我手工编写了以下脚本,将三个.avi文件连接在一起:
// Set Video and Audio to Direct Stream Copy
VirtualDub.video.SetMode(0);
VirtualDub.audio.SetMode(0);
VirtualDub.Open(U"D:\path\to\file1.avi");
VirtualDub.Append(U"D:\path\to\file2.avi");
VirtualDub.Append(U"D:\path\to\file3.avi");
VirtualDub.SaveAVI(U"D:\path\to\concatenatedFile.avi");
VirtualDub.Close();你可以用这个作为模板,然后从那里开始。
发布于 2013-05-16 00:26:47
我刚刚写了一些相关的/类似的东西,可以让您开始编写代码。它是一个批处理文件,因此将以下内容复制到something.bat:
Set Mfps=23.976
Set Bpath="E:\- Video Extractions\Virtualdub\1920x1280 (23.976fps pure,93%%,MPEG2,deinterlaced)auto openNsave.vcf"
rem Set Bpath="E:\- Video Extractions\Virtualdub\852x480 DAR3 (16x9) (24fps,96%%,MPEG2,deinterlaced).vcf"
Set Vdpath="E:\- Video Extractions\Virtualdub\VirtualDub-1.8.8\"
Set Svpath="D:\"
for %%A in (*.mkv *.avi *.mpg *.mpeg *.m2ts *.vob) do >%%~nA.avs echo # M2ts file & >>%%~nA.avs echo SetMemoryMax(128) & >>%%~nA.avs echo DirectShowSource("%%~dA%%~pA%%~nA%%~xA", fps=%Mfps%, audio=true, seekzero = true, convertfps=true) & >>%%~nA.avs echo EnsureVBRMP3Sync() & start /d %Vdpath% VirtualDub.exe /i %Bpath% "%%~dA%%~pA%%~nA.avs" "%Svpath%%%~nA.avi"
rem ---Notes---
rem code requires: Avisynth, virtualdub, pre-existing (.vcf) config file
rem most people prefer to use virtualdub with jobs in queue; run them in sequence. This runs jobs in parallel by searching the directory of the script, finding all listed wildcard masked files below, generating a simple avisynth script file for each file, then opening virtualdub and autosaving the video to .avi
rem caution, this will stress your system. you may only be able to handle 1 file at a time. I can input 30 blueray .m2ts files just fine, so long as i set vdub process to idle or low. Modify the code to your hearts content ~ TigerWild
rem create a unique .vcf that you will use with this batch file only. Do this by running Virtualdub, opening a video file, configuring all your settings as you want them, then selecting File->save processing settings->.vcf
rem use a text editor to open the vcf file you made, and add these 2 lines: VirtualDub.Open(VirtualDub.params[0]); VirtualDub.SaveAVI(VirtualDub.params[1]);
rem ---References---
rem http://stackoverflow.com/questions/8749637/dos-command-to-sperate-file-name-and-extension-into-variables
rem http://forum.doom9.org/archive/index.php/t-152842.html with a nod to stax76https://stackoverflow.com/questions/12379412
复制相似问题