[FFmpeg-user] Multiple Streams using ffmpeg (got 2 working, need 4)
Moritz Barsnick
barsnick at gmx.net
Mon Sep 3 12:56:42 EEST 2018
Hi Rad,
On Thu, Aug 30, 2018 at 11:10:58 -0500, Rad J wrote:
> I would like to stream 4 cams to YouTube using ffmpeg.
> I was able to get 2 to work as follows:
>
> ffmpeg -rtsp_transport tcp
> -i "rtsp://xxxx:xxxx@10.1.10.125:554/cam/realmonitor?channel=1&subtype=0"
> -i "rtsp://xxxx:xxxx@10.1.10.125:554/cam/realmonitor?channel=2&subtype=0"
> -f lavfi -i anullsrc
> -filter_complex "
> [0:v] setpts=PTS-STARTPTS, scale=800x448,setsar=1[upperleft];
> [1:v] setpts=PTS-STARTPTS, scale=800x448,setsar=1[upperright];
> [upperleft][upperright]hstack[base]"
> -map [base] -map 2 -f flv rtmp://
> x.rtmp.youtube.com/live2/xxxx:xxxx-xxxx:xxxx
>
> But how do I add two more below those two?
Untested:
ffmpeg -rtsp_transport tcp
-i "rtsp://xxxx:xxxx@10.1.10.125:554/cam/realmonitor?channel=1&subtype=0"
-i "rtsp://xxxx:xxxx@10.1.10.125:554/cam/realmonitor?channel=2&subtype=0"
-i "rtsp://xxxx:xxxx@10.1.10.125:554/cam/realmonitor?channel=3&subtype=0"
-i "rtsp://xxxx:xxxx@10.1.10.125:554/cam/realmonitor?channel=4&subtype=0"
-f lavfi -i anullsrc
-filter_complex "
[0:v] setpts=PTS-STARTPTS, scale=800x448,setsar=1[upperleft];
[1:v] setpts=PTS-STARTPTS, scale=800x448,setsar=1[upperright];
[2:v] setpts=PTS-STARTPTS, scale=800x448,setsar=1[bottomleft];
[3:v] setpts=PTS-STARTPTS, scale=800x448,setsar=1[bottomright];
[upperleft][upperright]hstack[topbase];
[bottomleft][bottomright]hstack[bottombase];
[topbase][bottombase]vstack[base]"
-map [base] -map 4 -f flv rtmp://x.rtmp.youtube.com/live2/xxxx:xxxx-xxxx:xxxx
> https://www.youtube.com/channel/UCxyIPYgLqtqLl2one2J7goQ/live
No, I can't. It's not online.
Moritz
More information about the ffmpeg-user
mailing list