javascript - Filtergraph描述中的流说明符 '' [0][1]concat=a=1 :n=1:v=1[s0] matches no streams

标签 javascript python django ffmpeg

我正在尝试使用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/

相关文章:

html - 控制导航栏开关 django

javascript - 将函数相互嵌套是不好的做法吗?

javascript - 回调必须是 Node 中的函数

javascript - addEventListener 重复自身

python - 大数的模幂

python - 当我尝试运行我的服务器时,我有一个程序,它是一个非常简单的服务器,因为我对 Django 还很陌生

Django 可以将 tabularinline 字段拆分为多行吗?

javascript - v-on 指令可以直接修改父级的 data() 属性吗?

Python:将字符串中的字符替换为另一个字符串中的等效字符

python - Eclipse - Pydev,无法识别未导入的方法