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

DEF shaker.doc at gmail.com
Sat Feb 20 05:14:21 EET 2021


On Sat, 20 Feb 2021 at 03:56, Steven Kan <steven at kan.org> 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. I ran the following command, but it just stalls at time=00:00:09.58 and never returns, and the resulting out.mp4 is an invalid movie with a size of 44 bytes. How do apply “-vn” to Input #1 only? Thanks!
>
> ffmpeg -re -thread_queue_size 1024 -rtsp_transport tcp -i "rtsp://anonymous:password1@192.168.1.13:554/cam/realmonitor?channel=1&subtype=0" -i "rtsp://anonymous:password@192.168.1.39:554" -vn -acodec copy -t 00:00:10 out.mp4
>
>
you can just use the map option

ffmpeg -re -thread_queue_size 1024 -rtsp_transport tcp -i
"rtsp://anonymous:password1@192.168.1.13:554/cam/realmonitor?channel=1&subtype=0"
-i "rtsp://anonymous:password@192.168.1.39:554" -map 0:v -map 1:a
-acodec copy -t 00:00:10 out.mp4


More information about the ffmpeg-user mailing list