0

I have a live video stream and a live audio stream. The audio stream has to get mixed into the video stream and the resulting stream is pushed to YouTube. I have this working ffmpeg -i videostream -i audiostream -map 0:1 -map 1:0 -shortest -c:a copy -c:v copy -f flv streamout-youtube; However I am losing the original audio in the videostream. I want to have the original audio playing at maybe 20% of the original volume. I looked around a lot and found maybe I can modify the above command to use -filter_complex to get ffmpeg -i videostream -i audiostream -filter_complex "volume=0.2" -map 0:1 -map 1:0 -shortest -c:a copy -c:v copy -f flv streamout-youtube;

However, when I add the -filter_complex option, the stream goes dead meaning it doesn't get pushed to youtube anymore. I have verified the stream keys are correct. This seems to be a rather simple thing but I can't put my finger on what's wrong.

I am using rtmp module of nginx to receive, mix and push out streams.

Core7s
  • 147
  • 4
  • 13
  • llogan I checked out the link you sent, does amix work with video too? I have tried that before but I didn't get any output. Further the overlaying or mixing of audio is taken care of by copy anyway. All I want to do is retain the volume. – Core7s Mar 18 '20 at 12:56
  • amix is only an audio filter. Your command will look something like: `ffmpeg -re -i video -re -i audio -filter_complex "[0:a][1:a]amix=inputs=2:weights=0.2 1[a]" -map 0:v -map "[a]" -c:v libx264 -c:a aac -b:v 4000k -maxrate 4000k -bufsize 8000k -g 2 -f flv rtmp://youtube` – llogan Mar 18 '20 at 17:33

0 Answers0