banner



How To Stream On Youtube With Obs Studio

UPD 17 Mar 2021: At present that the amazing SoraYuki published their obs-multi-rtmp plugin, you probably don't need this guide anymore, as the plugin is a lot easier to use. Like, a lot easier. But if you lot need FFmpeg filters, or yous need to output at different frame rates, continue reading.

Before you lot read, please note that this is only useful if a third political party service similar https://restream.io doesn't suit your needs. Also, some of the more than complicated setups might require a skilful understanding of command-line FFmpeg. If you demand aid for your specific setup, ping Nakajima Megumi#7432 in the obsproject back up Discord.

The general idea is as follows: host a RTMP server on your PC, stream to that server, then utilize FFmpeg to copy the stream to as many streaming platforms as you need to, with or without reencoding.

Stride 1. Host a RTMP server

There are multiple solutions for this. The one I recommend personally for Windows is MonaServer, as it's relatively painless to set up - just excerpt and run.
Become it hither: http://sourceforge.net/projects/monaserver/files/MonaServer_Win32.zip/download
Excerpt it, so launch MonaServer.exe from the command line. Example command:

Code:

              cd /D C:\Apps\mona monaserver.exe            

1_mona_running.png

Feel gratis to ignore error messages not relevant to the RTMP server running on port 1935.
This will host a RTMP server on your Windows PC; by default, only you should be able to stream to it unless yous forward port 1935. If y'all're using Linux, or yous'd like to set upwardly a more feature-rich server, y'all can use the guide from dodgepong, here https://obsproject.com/forum/resources/how-to-set-upwards-your-ain-private-rtmp-server-using-nginx.50/

Pace 2. Configure OBS Studio to stream to your server and starting time streaming

In OBS Studio, copy your electric current live-streaming profile by clicking Profiles > Duplicate. This will let you easily undo all changes, if yous need to.

2_obs_copy_profile.png

Later on that, get to Settings > Stream, change streaming service to "Custom" and paste the following:
In the Server field:
rtmp://localhost:1935/live
In the Stream Primal field:
stream

3_settings-stream.png

Press OK to apply changes and Start streaming to start your local stream. MonaServer volition recognize a new client now:

4_mona_rtmp.png

You should run into "i clients". That's us.

Step 3. Set up FFmpeg and test

If y'all don't have FFmpeg installed yet, to go https://ffmpeg.zeranoe.com/ and download the 64-bit static build. Excerpt ffmpeg.exe, ffprobe.exe and ffplay.exe to the same folder where you lot have MonaServer.exe.
At present, let's verify that the stream is live. To do that, create a new CMD or Powershell window and utilize ffplay from your download of ffmpeg:

Code:

              cd /D C:\Apps\mona ffplay -i rtmp://localhost:1935/live/stream            

5_droste.png
Since I'g watching my ain stream, I see a video feedback effect. Don't worry near the loftier stream delay, most of information technology came from ffplay's buffering, RTMP should introduce about 800 ms of extra latency at worst, 100-200 ms on average.
Quit ffplay by hitting q in its window or Ctrl+C in the command line window where you spawned information technology.

Step 4. Get your stream keys

Now you demand your stream keys and the exact full path for each circulate you intend to run.
For example, Twitch's ingest server in France is available at rtmp://live-fra.twitch.television set/app/ and Youtube'southward main ingest server is rtmp://a.rtmp.youtube.com/live2 . What this ways is that your full play path for broadcasting on Twitch would be rtmp://live-fra.twitch.tv/app/my-stream-key, where my-stream-key is your total stream central.
To see the full list of ingest servers OBS Studio exposes, read https://github.com/obsproject/obs-studio/blob/master/plugins/rtmp-services/data/services.json .

Pace 5. Starting time streaming

Note that I could be using line breaks for more convenient reading in instance commands; you will need to remove them.

Option 1. Outset and stop streams independently of each other per-service, no reencoding

For this, you need to launch a separate FFmpeg instance for each service. This increases the total RAM and CPU footprint slightly. Hither's an example command to start streaming to a single platform:
ffmpeg -i rtmp://localhost:1935/alive/stream -c:v copy -c:a copy -f flv rtmp://live-fra.twitch.tv/app/my-stream-key
You can stop the stream by either closing the CMD/PowerShell window, or by pressing Ctrl+C. FFmpeg will try to exit cleanly, which may exist dull; if you need to force-quit FFmpeg, sending Ctrl+C four or more times will crusade a force-quit.

Selection 2. Showtime and stop multiple livestreams simultaneously, all services/channels will receive the same video quality, no reencoding

To circulate to multiple platforms or channels at once, we tin can use the "tee" protocol and separate play paths with the | grapheme.
Permit's test it start by remuxing the local stream and re-streaming it to our own server:

Code:

              ffmpeg -i rtmp://localhost:1935/alive/stream -c:5 copy -c:a copy -map 0 -f tee "[f=flv]rtmp://localhost:1935/live/stream2|[f=flv]rtmp://localhost:1935/live/stream3|[f=flv]rtmp://localhost:1935/live/stream4"            

If MonaServer is reporting five clients (that's 4 broadcasters and 1 viewer), it's working.
Hither'southward an instance with three Twitch channels:

Code:

              ffmpeg -i rtmp://localhost:1935/alive/stream -c:v re-create -c:a copy -map 0 -f tee "[f=flv]rtmp://live-fra.twitch.tv/app/my-stream-central|[f=flv]rtmp://live-fra.twitch.tv set/app/my-2d-stream-key|[f=flv]rtmp://alive-fra.twitch.tv/app/my-third-stream-key"            

Each URL will receive a copy of the stream, without reencoding.

Option iii. Two (or more) services, each receives its ain reencode

Let's say yous want to stream to Twitch in 720p 60fps vi mbps, and to Youtube in 1080p 60fps twenty mbps. In that location are two ways to approach this - either stream locally in high quality (target 100-230 mbps, or use CQP) and practise ii reencodes, slightly increasing the performance footprint, or stream in a chip rate high plenty for Youtube and reencode information technology for Twitch, pain the quality of Twitch's stream.

If nosotros have a loftier-quality local stream and want to do 2 x264 reencodes, keeping our 160kbps audio for both streams, we'd be specifying outputs 1 after another, similar this:

Code:

              ffmpeg -hide_banner -i rtmp://localhost:1935/live/stream -c:v libx264 -b:v 20000k -preset veryfast -c:a re-create -f flv rtmp://a.rtmp.youtube.com/live2/my-youtube-stream-key -c:v libx264 -b:v 6000k -preset veryfast -c:a copy -vf "scale=1280:720" -f flv rtmp://live-fra.twitch.tv/app/my-stream-key            

Annotation the add-on of -vf "scale=1280:720" - this adds a video filter to downscale the stream to 720p for Twitch. I'm assuming the input will exist 1080p 60fps, and that is what Youtube volition receive.

Here'due south another example using NVENC for Youtube'due south reencode and x264 for Twitch:

Code:

              ffmpeg -hide_banner -i rtmp://localhost:1935/live/stream -c:v nvenc_h264 -b:5 20000k -preset dull -c:a copy -f flv  rtmp://a.rtmp.youtube.com/live2/my-youtube-stream-cardinal -c:v libx264 -b:v 6000k -preset veryfast -c:a re-create -vf "scale=1280:720" -f flv  rtmp://live-fra.twitch.tv/app/my-stream-key            

Or, let's say you lot're streaming from OBS Studio at twenty mbps 1080p 60fps and want to copy the stream equally-is to Youtube, and reencode to four mbps 720p 30 fps for Twitch:

Code:

              ffmpeg -hide_banner -i rtmp://localhost:1935/live/stream -c:five copy -c:a re-create rtmp://a.rtmp.youtube.com/live2/my-youtube-stream-fundamental -c:v libx264 -preset veryfast -b:five 6000k -c:a copy -r 30 -vf "scale=1280:720" -f flv rtmp://live-fra.twitch.television/app/my-stream-key            

Annotation the addition of -r 30 to driblet from 60 fps to 30 fps. If your input is 59.94fps (60000/1001), you can drop to 29.97 by using -r 30000/1001.

Note on FFmpeg options and preset selection:
-preset veryfast selects the x264 preset, "veryfast".
FFmpeg tin also use NVENC with -c:five h264_nvenc- in that case, I'd recommend using -preset boring (ii-pass loftier quality) on all cards except Turing cards; on Turing cards I'd recommend -preset hq (single pass high quality). Note that due to NVIDIA's marketing limitations you can only use ii concurrent NVENC sessions on GeForce cards; trying to showtime a 3rd one will throw an "out of memory" error (even if y'all have enough spare VRAM).
FFmpeg tin also use AMD AMF with -c:five h264_amf, please refer to this documentation for using AMF:
ffmpeg -hide_banner -h encoder=h264_amf

Option 4. Re-encode some or all of the streams

This selection requires a expert understanding of the command line interface and FFmpeg. I'll try to depict it and provide examples, but if that doesn't aid, you lot might still have to dig through FFmpeg's documentation.

Permit's say we take a loftier quality input, save it as-is to file, then reencode to 2 mbps and send to ii services:
Grab the stream
ffmpeg -hide_banner -i rtmp://localhost:1935/live/stream
Save locally
-c:v re-create -c:a re-create -f mp4 source.mp4
Reencode with two outputs
-c:v libx264 -b:v 2000k -c:a copy -map 0 -f tee "[f=flv]rtmp://live-fra.twitch.tv set/app/my-stream-key|[f=flv]rtmp://alive-fra.twitch.idiot box/app/my-second-stream-key"

If y'all need help for your specific setup, or some parts of the guide are unclear, ping Nakajima Megumi#7432 in the obsproject Discord with your questions.

You can learn more most the tee muxer for more advanced utilize cases here: https://trac.ffmpeg.org/wiki/Creating multiple outputs

Source: https://obsproject.com/forum/resources/obs-studio-stream-to-multiple-platforms-or-channels-at-once.932/

Posted by: blanknothad1946.blogspot.com

0 Response to "How To Stream On Youtube With Obs Studio"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel