Discussion:
[FFmpeg-user] Multiple Streams using ffmpeg (got 2 working, need 4)
Rad J
2018-08-30 16:10:58 UTC
Permalink
Hello There,

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:***@10.1.10.125:554/cam/realmonitor?channel=1&subtype=0"
-i "rtsp://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?

You can view the two here:
https://www.youtube.com/channel/UCxyIPYgLqtqLl2one2J7goQ/live

Thanks,
Zarks
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-use
Moritz Barsnick
2018-09-03 09:56:42 UTC
Permalink
Hi Rad,
Post by Rad J
I would like to stream 4 cams to YouTube using ffmpeg.
ffmpeg -rtsp_transport tcp
-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:***@10.1.10.125:554/cam/realmonitor?channel=1&subtype=0"
-i "rtsp://xxxx:***@10.1.10.125:554/cam/realmonitor?channel=2&subtype=0"
-i "rtsp://xxxx:***@10.1.10.125:554/cam/realmonitor?channel=3&subtype=0"
-i "rtsp://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
Post by Rad J
https://www.youtube.com/channel/UCxyIPYgLqtqLl2one2J7goQ/live
No, I can't. It's not online.

Moritz
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ff
Rad J
2018-10-11 14:56:48 UTC
Permalink
Hi Mortiz,

That worked but I'm getting lot's of errors while streaming and youtube is
complaining about the frames and format, how can I adjust those?

[image: image.png]

https://www.screencast.com/t/Jdr7TdkL5

I have also changed the resolution to 1080p and it looks nice now:

ffmpeg -rtsp_transport tcp
-i "rtsp://xxx:***@10.1.10.125:554/cam/realmonitor?channel=1&subtype=0"
-i "rtsp://xxx:***@10.1.10.125:554/cam/realmonitor?channel=2&subtype=0"
-i "rtsp://xxx:***@10.1.10.125:554/cam/realmonitor?channel=3&subtype=0"
-i "rtsp://xxx:***@10.1.10.125:554/cam/realmonitor?channel=4&subtype=0"
-f lavfi -i anullsrc
-filter_complex "
[0:v] setpts=PTS-STARTPTS, scale=1920x1080,setsar=1[upperleft];
[1:v] setpts=PTS-STARTPTS, scale=1920x1080,setsar=1[upperright];
[2:v] setpts=PTS-STARTPTS, scale=1920x1080,setsar=1[bottomleft];
[3:v] setpts=PTS-STARTPTS, scale=1920x1080,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
Post by Rad J
Hello There,
I would like to stream 4 cams to YouTube using ffmpeg.
ffmpeg -rtsp_transport tcp
-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?
https://www.youtube.com/channel/UCxyIPYgLqtqLl2one2J7goQ/live
Thanks,
Zarks
Rad J
2018-10-11 15:03:02 UTC
Permalink
Sorry, wrong image here the correct one:

https://www.screencast.com/t/xrDfuJGtsT

And Thank you!
-Rad
Post by Rad J
Hi Mortiz,
That worked but I'm getting lot's of errors while streaming and youtube is
complaining about the frames and format, how can I adjust those?
[image: image.png]
https://www.screencast.com/t/Jdr7TdkL5
ffmpeg -rtsp_transport tcp
-f lavfi -i anullsrc
-filter_complex "
[0:v] setpts=PTS-STARTPTS, scale=1920x1080,setsar=1[upperleft];
[1:v] setpts=PTS-STARTPTS, scale=1920x1080,setsar=1[upperright];
[2:v] setpts=PTS-STARTPTS, scale=1920x1080,setsar=1[bottomleft];
[3:v] setpts=PTS-STARTPTS, scale=1920x1080,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
Post by Rad J
Hello There,
I would like to stream 4 cams to YouTube using ffmpeg.
ffmpeg -rtsp_transport tcp
"
"
-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?
https://www.youtube.com/channel/UCxyIPYgLqtqLl2one2J7goQ/live
Thanks,
Zarks
Continue reading on narkive:
Search results for '[FFmpeg-user] Multiple Streams using ffmpeg (got 2 working, need 4)' (Questions and Answers)
6
replies
what is the use of PAUSE/BREAK switch on keyboard?
started 2010-05-13 05:50:57 UTC
hardware
Loading...