{"id":7361,"date":"2020-06-25T23:23:51","date_gmt":"2020-06-25T21:23:51","guid":{"rendered":"https:\/\/monodes.com\/predaelli\/?p=7361"},"modified":"2020-06-25T23:23:51","modified_gmt":"2020-06-25T21:23:51","slug":"how-to-easily-stream-to-two-or-more-locations-the-helping-squad","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2020\/06\/25\/how-to-easily-stream-to-two-or-more-locations-the-helping-squad\/","title":{"rendered":"How to easily stream to two or more locations? \u2013 The Helping Squad"},"content":{"rendered":"<blockquote><p>Streaming to more than one service can be done using an RTMP Server that relays your input to several outputs or using an external service. Services like restream.io offer free and paid options to send your stream to several services at the same time.<\/p><\/blockquote>\n<p>Source: <em><a href=\"https:\/\/helping-squad.com\/how-to-easily-stream-to-two-or-more-locations\/\">How to easily stream to two or more locations? \u2013 The Helping Squad<\/a><\/em><\/p>\n<p><!--more--><!--nextpage--><\/p>\n<blockquote>\n<h1 class=\"post-title entry-title fittexted_for_single_post_title\">How to easily stream to two or more locations?<\/h1>\n<p class=\"post-byline\">by <span class=\"vcard author\"> <span class=\"fn\"><a title=\"Posts by RobinJack0r\" href=\"https:\/\/helping-squad.com\/author\/jack0r\/\" rel=\"author\">RobinJack0r<\/a><\/span> <\/span> \u00b7 Published <time class=\"published\" datetime=\"January 27, 2014\">January 27, 2014<\/time> \u00b7 Updated <time class=\"updated\" datetime=\"April 13, 2019\">April 13, 2019<\/time><\/p>\n<div class=\"clear\"><\/div>\n<div class=\"entry themeform fittexted_for_entry\">\n<div class=\"entry-inner\">\n<div>\n<div>\n<p>Streaming to more than one service can be done using an RTMP Server that relays your input to several outputs or using an external service. Services like restream.io offer free and paid options to send your stream to several services at the same time. This can be a viable option if you have not enough upload speed or bandwidth limitations on your internet connection.<\/p>\n<p>Assuming you prefer doing it yourself nginx with the addition of arut\u2019s rtmp module can do the job for us.\u00a0So let me quickly explain a few things first:<\/p>\n<ul>\n<li>your upload bandwidth is \u201cthe\u201d limit: (your upload \u2013 some free room) \/ stream bitrate = maximum number of streams<\/li>\n<li>nginx-rtmp on windows cannot transcode for you, so input = output BUT\n<ul>\n<li>the linux version can send different streams from one input<\/li>\n<li>for windows you need a workaround (manual ffmpeg setup, or similar)<\/li>\n<\/ul>\n<\/li>\n<li>in contrast to xsplit you can save a lot of cpu power if you send the <strong>same<\/strong> stream to several locations over nginx<\/li>\n<li>one downside is that you get no info about dropped frames or disconnects as this is all handled by the nginx server<\/li>\n<li>as always, there are different ways to reach your perfect solution, but this is a quick and easy one<\/li>\n<\/ul>\n<p>Now to get started, you can compile nginx yourself (the standard download\/binary does <strong>not<\/strong> include the rtmp-module). If you are familiar with docker you can also get docker <a href=\"https:\/\/hub.docker.com\/search\/?isAutomated=0&amp;isOfficial=0&amp;page=1&amp;pullCount=0&amp;q=nginx+rtmp&amp;starCount=0\" target=\"_blank\" rel=\"noopener noreferrer\">nginx-rtmp<\/a> containers. And on <a href=\"https:\/\/github.com\/sergey-dryabzhinsky\/nginx-rtmp-module\" target=\"_blank\" rel=\"noopener noreferrer\">github<\/a> you can find a few people rying to keep the nginx-rtmp module alive.<\/p>\n<p>To receive a stream and send it to out different locations we have to change the \u201cnginx.conf\u201d. It is located in the conf folder and should look something like this afterwards:<\/p>\n<pre lang=\"\">#user  nobody;\nworker_processes  1;\n\nerror_log  logs\/rtmp_error.log debug;\npid        logs\/nginx.pid;\n\nevents {\n    worker_connections  1024;\n}\n\nrtmp {\n    server {\n        listen 1935;\n        chunk_size 8192;\n\n        application stream {\n            live on;\n            meta copy;\n            push rtmp:\/\/live-ams.twitch.tv\/app\/live_XYZ_ZXY;\n            push rtmp:\/\/live.hitbox.tv\/push\/username?key=XYZ;\n        }\n    }\n}<\/pre>\n<p>You can overwrite the nginx.conf with the above or just copy over the application stream to my included config (if you want to use the http stuff for statistics etc). This very simple config just includes one application called stream which waits for you to send a stream to it.<\/p>\n<p>The really important part are the two \u201cpush\u201d directives I defined. As soon as the application receives your stream it will start sending it to both locations I set after the push. In this example to twitch.tv amsterdam server and to the hitbox.tv master. In OBS, XSplit or whatever program you use you would just setup a stream to a custom location (in xsplit custom rtmp) and choose rtmp:\/\/your.ip\/stream as your server address and just enter anything for the streamkey\/playpath.<\/p>\n<p>This server is not secured in any way, so anyone that finds out your application name and ip address could use your application to stream to the services you setup in the push directive. But luckily you can check out my guide on how to secure your nginx server if you are afraid of something like that happening. So the only downside of this whole setup, remember the big plus of less cpu usage compared to two or more encodings xsplit would do, is that you get less information about the connection to your services.<\/p>\n<p>In OBS or Xsplit you will only see how good your connection to the nginx server is. And especially on a local hosted one, this should be always fine. So you will have to ask your viewers sometimes if everythings fine and regularly check that both or all streams are still online.<\/p>\n<p>Last but not least the nginx error logging capabilities can give you a lot of info of what went wrong, so always check them if you have problems, and see you soon for the next tutorial!<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">Streaming to more than one service can be done using an RTMP Server that relays your input to several outputs or using an external service. Services like restream.io offer free and paid options to send your stream to several services at the same time. Source: How to easily stream to two or more locations? \u2013&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2020\/06\/25\/how-to-easily-stream-to-two-or-more-locations-the-helping-squad\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[72,278],"tags":[],"class_list":["post-7361","post","type-post","status-publish","format-standard","hentry","category-documentations","category-tricks"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-1UJ","jetpack-related-posts":[{"id":9614,"url":"https:\/\/monodes.com\/predaelli\/2022\/09\/18\/self-hosted-streaming-server-nginx-rtmp-youtube-facebook-live\/","url_meta":{"origin":7361,"position":0},"title":"Self-Hosted Streaming Server \u2013 NGINX + RTMP \u2013 YouTube + Facebook Live","author":"Paolo Redaelli","date":"2022-09-18","format":false,"excerpt":"Copying this here in case the original goes offline Self-Hosted Streaming Server \u2013 NGINX + RTMP \u2013 YouTube + Facebook Live Published by Anthony on 14th April 2020 I\u2019m writing these notes up, mainly as a reference for me in the future \u2013 but they might just help others looking\u2026","rel":"","context":"In &quot;Basilica's website&quot;","block_context":{"text":"Basilica's website","link":"https:\/\/monodes.com\/predaelli\/category\/basilicas-website\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2015\/06\/screenshot-2015-06-10-16-01-521.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2015\/06\/screenshot-2015-06-10-16-01-521.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2015\/06\/screenshot-2015-06-10-16-01-521.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":5267,"url":"https:\/\/monodes.com\/predaelli\/2019\/02\/20\/how-streaming-music-could-be-harming-the-planet-slashdot\/","url_meta":{"origin":7361,"position":1},"title":"How Streaming Music Could Be Harming the Planet &#8211; Slashdot","author":"Paolo Redaelli","date":"2019-02-20","format":"link","excerpt":"Source: How Streaming Music Could Be Harming the Planet - Slashdot An anonymous reader quotes a report from the BBC: Current digital technology gives us flawless music quality without physical deterioration. Music is easy to copy and upload, and can be streamed online without downloading. Since our digital music is\u2026","rel":"","context":"In &quot;Ethics&quot;","block_context":{"text":"Ethics","link":"https:\/\/monodes.com\/predaelli\/category\/ethics\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5026,"url":"https:\/\/monodes.com\/predaelli\/2018\/12\/10\/exploiting-developer-infrastructure-is-ridiculously-easy\/","url_meta":{"origin":7361,"position":2},"title":"Exploiting Developer Infrastructure Is Ridiculously Easy","author":"Paolo Redaelli","date":"2018-12-10","format":false,"excerpt":"The open-source ecosystem is broken Source: Exploiting Developer Infrastructure Is Ridiculously Easy That's why Debian has its own repositories. Exploiting Developer Infrastructure Is Ridiculously Easy The open-source ecosystem is broken Jarrod Overson Nov 27 Photo: Charles Deluvio\/Unsplash In late October, an issue was opened on an extremely popular node.js tool,\u2026","rel":"","context":"In &quot;Ethics&quot;","block_context":{"text":"Ethics","link":"https:\/\/monodes.com\/predaelli\/category\/ethics\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6743,"url":"https:\/\/monodes.com\/predaelli\/2020\/02\/25\/muses-radio-player-the-html5-mp3-ogg-aac-live-stream-player\/","url_meta":{"origin":7361,"position":3},"title":"Muses Radio Player &#8211; The HTML5 MP3\/OGG\/AAC Live Stream Player!","author":"Paolo Redaelli","date":"2020-02-25","format":"link","excerpt":"Muses Radio Player - The HTML5 MP3\/OGG\/AAC Live Stream Player!","rel":"","context":"In &quot;Basilica's website&quot;","block_context":{"text":"Basilica's website","link":"https:\/\/monodes.com\/predaelli\/category\/basilicas-website\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7987,"url":"https:\/\/monodes.com\/predaelli\/2021\/01\/03\/broadcast-live-video-live-streaming-html5-webrtc-hls-rtsp-rtmp-wordpress-plugin-wordpress-org\/","url_meta":{"origin":7361,"position":4},"title":"Broadcast Live Video \u2013 Live Streaming : HTML5, WebRTC, HLS, RTSP, RTMP \u2013 WordPress plugin | WordPress.org","author":"Paolo Redaelli","date":"2021-01-03","format":false,"excerpt":"Live video streaming, webcam broadcasting app and player with chat, external apps support, 24\/7 IP cameras, video playlists, video archiving & vod \u2026 I shall someday add this Broadcast Live Video \u2013 Live Streaming : HTML5, WebRTC, HLS, RTSP, RTMP \u2013 WordPress plugin to www.pastoraledesio.it. Or maybe I'll just use\u2026","rel":"","context":"In &quot;Basilica's website&quot;","block_context":{"text":"Basilica's website","link":"https:\/\/monodes.com\/predaelli\/category\/basilicas-website\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7993,"url":"https:\/\/monodes.com\/predaelli\/2021\/01\/03\/audio-how-to-transform-live-rtmp-video-to-live-mp3-icecast-stream-stack-overflow\/","url_meta":{"origin":7361,"position":5},"title":"audio &#8211; how to transform live RTMP video to live mp3 Icecast stream &#8211; Stack Overflow","author":"Paolo Redaelli","date":"2021-01-03","format":false,"excerpt":"Source: audio - how to transform live RTMP video to live mp3 Icecast stream - Stack Overflow I have RTMP live stream with video and audio. I can get ogg audio live stream from RTMP and translate it to Icecast2 and get it on my site using JPlayer. Now i\u2026","rel":"","context":"In &quot;Basilica's website&quot;","block_context":{"text":"Basilica's website","link":"https:\/\/monodes.com\/predaelli\/category\/basilicas-website\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/7361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=7361"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/7361\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=7361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=7361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=7361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}