[FFmpeg-user] Muxing Video from Cam1 with Audio from Cam2?

Steven Kan steven at kan.org
Sat Feb 20 20:14:10 EET 2021


Thank you Carl and DEF! Works perfectly!

I’m using out.mp4 just for syntax testing. In the actual application I’ll be outputting to:

-f flv "rtmp://a.rtmp.youtube.com/live2/my-youtube-streaming-key”

But it’s good to know about container issues!

> On Feb 19, 2021, at 7:14 PM, Carl Zwanzig <cpz at tuunq.com> wrote:
> 
> On 2/19/2021 6:23 PM, Steven Kan wrote:
>> What’s the correct syntax to mux the video from new Cam1 with the audio
>> from older Cam2, while completely discarding the unwanted video from
>> Cam2? Preferably without transcoding anything, since I want to minimize
>> CPU usage. 
> 
> It's all about the mapping (and this is answered at https://stackoverflow.com/questions/12938581/ffmpeg-mux-video-and-audio-from-another-video-mapping-issue/12943003)
> 
> but the command will look something like
> 
> ffmpeg -i VIDEOSOURCE -i AUDIOSOURCE -map 0.0 -map 1.1 -t 00:00:10 out.mp4
> (assume that the video is stream 0 in both and audio is stream 1)
> 
> Also look up the options -shortest and -apad to see if they may apply (https://ffmpeg.org/documentation.html).
> 
> I'd consider whether .mkv is better output container than .mp4, which can become corrupt if the file isn't closed properly.
> 
> Later,
> 
> z!
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-user mailing list