我正在使用ffmpeg进行视频合并。因为它包含3-4个步骤。在一个步骤中,我想从多个视频中提取音频部分并获得单个合并的音频。我面临错误:
[avs @ 6c370838 JAVIFileOpen faild with error - 2147221164E:\mypath\bin\debug\videos\video.avs: Error while opening file
我使用下面的命令(使用c#)来获取音频部分:<<<<>>>
ffmpeg.exe -i "E:\mypath\bin\Debug\Videos\video.avs" -acodec pcm_s16le -ar 41000 -ab 64k -y -ac 2 "E:\mypath\bin\Debug\Videos\audio.wav"
和video.avs中的文字是:
video = UnalignedSplice(DirectShowSource("bumper.wmv", fps = 25, Convertfps = true), DirectShowSource("video.wmv", fps = 25, Convertfps = true, audio = false), DirectShowSource("trailer.wmv", fps = 25, Convertfps =true))
audio = DirectShowSource("video.wmv", video = false)
Clip = AudioDub(video, audio)
DelayAudio(Clip, +1)
我使用下面的代码编写video.avs文件:
StreamWriter writer2 = new StreamWriter(Application.StartupPath + "\\Videos\\videoPart.avs");
writer2.WriteLine("UnalignedSplice(DirectShowSource(\"" + "bumper.wmv" + "\", fps = 25, Convertfps = true),"
+ " DirectShowSource(\"" + "video.wmv" + "\", fps = 25, Convertfps = true, audio = false),"
+ " DirectShowSource(\"" + "trailer.wmv" + "\", fps = 25, Convertfps =true))");
writer2.Close();
请帮帮我。
答案 0 :(得分:0)
最后我得到了答案。 我收到此错误是因为我使用的是ffmpeg无法读取的.avs文件。要使ffmpeg使用.avs文件,我们将不得不安装“Avisynth”。
下载“Avisynth”