0

I saw "https://superuser.com/questions/277642/how-to-merge-audio-and-video-file-in-ffmpeg" and for a project we need to retrieve video stream (RTMP) from a camera and an icecast audiostream and merge them into a video+audio stream. The original camera audio can be ignored. We'll have to make this available for live viewing, so it's crucial there's not too much delay.

Would ffmpeg -i https://path/to/videostream -i https://path/to/audiostream.stream -c:v copy -c:a aac output.mp4 that was suggested in the original thread work?

Thom
  • 1
  • 2
  • The merging should work, but you are writing to a file instead of a stream. Your output seems not to be set right. – FelixJN Sep 21 '20 at 13:38
  • Thanks, something like "-f rtp rtp://127.0.0.1:1234" instead of "-c:a aac output.mp4" ? – Thom Sep 21 '20 at 17:46

1 Answers1

0

Not much info to work with but assuming both input formats are compatible with the output and suitable for your target player/device you can try stream copy (-c copy).

ffmpeg -i https://path/to/videostream -i https://path/to/audiostream.stream -map 0:v -map 1:a -c copy -f flv rtp://output

-map option is used so it knows which streams you want. Otherwise it may choose the unwanted audio from https://path/to/videostream. See FFmpeg Wiki: Map.

llogan
  • 57,139
  • 15
  • 118
  • 145