Tanmoy Bhowmick
Tanmoy Bhowmick

Reputation: 1481

Stream specifier '' in filtergraph description [0][1]concat=a=1:n=1:v=1[s0] matches no streams

i am trying to concatenate two audio files in django with ffmpeg but getting this error Stream specifier '' in filtergraph description [0][1]concat=a=1:n=1:v=1[s0] matches no streams.`

here is my function

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')

i have also tried .compile() instead of .run() in this case nothing is happening

Upvotes: 2

Views: 2080

Answers (1)

MSR974
MSR974

Reputation: 682

You are concating 2 audio files together so the v=1 parameter should be at 0 since it stand for "output video streams"

I tried it myself and this changed worked for me. Let me know if it worked for you too.

ffmpeg.concat(input_first, input_second, v=0, a=1).output('./finished_video.wav').run()

Upvotes: 3

Related Questions