我正在尝试使用ffmpeg连接django中的两个音频文件,但在filtergraph描述[0][1]concat=a=1:n=中收到此错误流说明符'' 1:v=1[s0] 不匹配任何流。`
这是我的功能
def audiomarge(request):
recorded_audio = request.FILES['audio']
new = tempSong(tempSongFile=recorded_audio)
new.tempSongFile.name = 'test.wav'
new.save()
record_file_path = new.tempSongFile.path
record_file_path = str(record_file_path)
recorded_audio = request.POST.get('audio')
songslug = request.POST.get('songslug')
current_song = Song.objects.filter(slug=songslug)[0]
current_song_path = current_song.songFile.url
current_song_path = '.'+(str(current_song_path))
input_first = ffmpeg.input(current_song_path)
input_second = ffmpeg.input(record_file_path)
ffmpeg.concat(input_first, input_second, v=1, a=1).output('./finished_video.wav').run()
return HttpResponse('okay')
我也尝试过 .compile() 而不是 .run() 在这种情况下什么也没有发生
最佳答案
您要将 2 个音频文件连接在一起,因此 v=1 参数应为 0 因为它代表“输出视频流”
我自己尝试过,这个改变对我有用。让我知道它是否也适合您。
ffmpeg.concat(input_first, input_second, v=0, a=1).output('./finished_video.wav').run()
关于javascript - Filtergraph描述中的流说明符 '' [0][1]concat=a=1 :n=1:v=1[s0] matches no streams,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63321345/