For FFmpeg YouTube Live, use constant bitrate encoding, select a target from YouTube’s table for your ingest codec, resolution and frame rate, and set a two-second keyframe interval. For example, YouTube recommends 10 Mbps for H.264 at 1080p30 and 12 Mbps at 1080p60; these are encoder-to-YouTube ingest targets, not the bitrate every viewer receives.
A configuration is a starting point, not an uptime guarantee. Test the complete output with representative sound and movement, check YouTube’s stream health messages, and adjust if the encoder or upload connection cannot sustain the selected format.
Choose the ingest codec, resolution and frame rate
Start with the picture you can reliably produce, rather than choosing a high resolution first and trying to force the rest of the setup to fit it. YouTube’s encoder guidance lists H.264, H.265/HEVC and AV1 as supported video codecs, with frame rates up to 60 fps. The available options also depend on your FFmpeg build and encoding hardware or software. Check the YouTube Live encoder settings and confirm that your chosen encoder actually supports the intended codec.
For a familiar FFmpeg setup, H.264 with libx264 is a practical example. A static devotional image with slow transitions may not need 60 frames per second, while footage with frequent movement may call for a higher frame rate if your source and encoder can provide it cleanly. A higher frame rate can require a different bitrate target and more encoding work; it is not an automatic quality improvement for every source.
YouTube’s listed guidance also calls for progressive scan, square pixels and Rec. 709 for SDR video. Set output properties to match the material you are sending. Upscaling a small source does not restore detail, and changing frame rate without considering the source can produce duplicated or uneven-looking motion. If the stream is a loop of prepared video, verify how its actual frame rate and dimensions map to your output before setting encoder values.
A 720p output can be a sensible choice when the source is modest or upload capacity is limited. YouTube’s H.264 recommendation is 6 Mbps for both 720p30 and 720p60, but the greater frame count still requires the encoder to do more work. If you are building an always-on playback channel rather than operating a live camera feed, the practical workflow may also include how you keep the source material cycling: see this guide to keeping a YouTube playlist live while adding new videos.
Do not treat the codec tables as interchangeable. YouTube provides separate rows and columns for resolution, frame rate and codec; the H.264 row is not a universal rule for an AV1 or H.265 encoder. Select the actual output first, then read the matching recommendation in the current official table before you configure the command.
Set CBR and choose a target bitrate
YouTube lists CBR as its bitrate encoding mode. In FFmpeg, -b:v sets the video bitrate target; with libx264, -minrate and -maxrate can help constrain rate control around that target, while -bufsize configures the VBV buffer. The exact output behaviour depends on the encoder and build, so matching these options is not a promise that every moment on the wire will be identical in bitrate.
For the common H.264 choices below, keep YouTube’s recommended bitrate distinct from its listed minimum. A minimum is not the same thing as the recommended setting, and neither one tells you whether your connection or machine can sustain the stream.
| Ingest format | YouTube recommended bitrate | YouTube listed minimum |
|---|---|---|
| H.264 720p30 or 720p60 | 6 Mbps | Check the current table |
| H.264 1080p30 | 10 Mbps | 14 Mbps |
| H.264 1080p60 | 12 Mbps | 17 Mbps |
| AV1 or H.265 1080p30 | 10 Mbps | 4 Mbps |
| AV1 or H.265 1080p60 | 12 Mbps | 4 Mbps |
The values above reproduce the cited rows in YouTube’s current encoder guidance; consult its full table for any other output size or frame rate rather than extrapolating. YouTube’s H.264 minimum values at 1080p appear higher than the recommended values in the cited table. Do not silently swap those labels or infer that the table says one is a guaranteed floor for all content. Read the relevant codec, frame-rate and resolution cells directly when you prepare a production configuration.
A schematic 1080p30 H.264 command is:
ffmpeg -re -i INPUT \\
-c:v libx264 -preset veryfast -tune zerolatency \\
-b:v 10M -minrate 10M -maxrate 10M -bufsize 20M \\
-x264-params "nal-hrd=cbr:force-cfr=1" \\
-r 30 -g 60 -keyint_min 60 \\
-c:a aac -b:a 128k -ar 44100 \\
-f flv "rtmps://a.rtmps.youtube.com/live2/STREAM_KEY"
Replace INPUT and STREAM_KEY, and adapt audio, scaling, pixel format and other input or output options to your actual material and FFmpeg build. YouTube recommends RTMPS, and the command uses a YouTube RTMPS ingest URL. Keep the stream key private: do not paste it into a public script, screenshot or support post.
The example’s -bufsize 20M is a chosen rate-control buffer value, not a YouTube-mandated setting. The FFmpeg codec documentation explains the available bitrate controls and libx264’s HRD option; see FFmpeg’s codec documentation and validate behaviour with the encoder you run. In particular, libx264’s nal-hrd=cbr signals HRD CBR and requires a VBV buffer. FFmpeg’s documentation notes that CBR HRD signalling is not allowed in an MP4 container; this example sends an FLV stream to RTMPS, not an MP4 file.
If your build does not include libx264, or you use hardware encoding, the option names and rate-control behaviour may differ. Do not copy the command mechanically and assume the encoder honoured every flag. Check the encoder’s available options and logs, and treat the target as a configuration to validate. For a separate always-on machine-and-connection discussion, the article on running an FFmpeg YouTube stream from a Raspberry Pi over Wi-Fi is relevant, but a particular device or network is not implied by this bitrate example.
Configure a two-second keyframe interval
YouTube recommends a keyframe frequency of two seconds and says not to exceed four seconds. In FFmpeg, the GOP size is expressed in frames, so calculate it from the output frame rate: at 30 fps, two seconds corresponds to 60 frames; at 60 fps, it corresponds to 120 frames. That is why the example uses both -g 60 and -keyint_min 60 at 30 fps.
For an output at 60 fps, use a GOP value of 120 for the same two-second interval, and make the corresponding minimum key interval consistent with the encoder’s options. Do not read -g 60 as “two seconds” unless the frame rate is 30 fps. If you change -r, revisit the GOP values rather than leaving them behind from an earlier format.
The interval helps YouTube receive periodic keyframes for ingest and processing. A two-second GOP is platform guidance, not evidence that the whole stream is stable or that every viewer will see a keyframe at a particular wall-clock instant. Other configuration, input, network and platform conditions still matter. Review encoder output and YouTube’s stream health after sending a test rather than relying on the command line alone.
Include representative audio and motion
A test with a still image and no sound does not exercise the same output as a finished programme containing music, speech, transitions or camera movement. YouTube explicitly advises testing with audio and movement similar to what you plan to stream. For a bhajan channel, for example, include a section with the real music level and a transition between visuals; for a local news loop, include speech and the moving lower-third or clip changes that will appear in the programme.
The example encodes audio as AAC stereo at 128 kbps and a 44.1 kHz sample rate. YouTube recommends AAC stereo audio at 128 kbps, or AAC 5.1 at 384 kbps. These settings concern the audio sent to YouTube; check that your input is actually stereo if you intend to send stereo, and listen for clipping, silence, channel imbalance or lip-sync problems during the test. MP3 is also listed by YouTube as an accepted audio codec, but the example uses AAC.
Motion matters to rate control. A static temple image, a slow diya flame and a fast-moving dance clip can produce different encoding demands even at the same resolution and nominal bitrate. Look for blockiness, smeared detail and sudden quality changes in both quiet and busy passages. If the source itself is low quality, raising bitrate cannot recreate missing detail. If a steady image looks fine but movement breaks up, test a more suitable source or output format before increasing the target blindly.
For continuous prerecorded programming, encode and package the source consistently where practical, and test the exact playlist transitions planned for the channel. Advice on streaming recorded Tamil church services continuously on YouTube can help with the broader playback pattern; it does not replace checking the FFmpeg ingest format and audio for your own stream.
Send a safe test feed to YouTube
Before a scheduled event or a change to a 24/7 channel, send a private or otherwise safe test feed through the same path you expect to use. Configure the real codec, resolution, frame rate, CBR target and GOP, then let it run long enough to include representative quiet and busy material, audio and any changes between files. The test should exercise the actual encoder and uplink, not just a local preview window.
YouTube’s guidance is direct: tests should include audio and movement like those planned for the stream. In YouTube Studio, create or use a test setup appropriate to your channel and confirm that the incoming preview and stream health indicators are visible before sending the feed. Follow the current steps in YouTube Help for setting up a live stream with an encoder, since interface labels and available controls can change.
Before the test, check that the upload connection has sustained headroom above the combined stream requirements, including audio and network overhead. A speed test can be useful, but one result is not a guarantee of the capacity you will have later, particularly on shared or variable connections. YouTube recommends using a reliable quality for the available upload connection and running an upload speed test. If the connection fluctuates, consider a lower output recommendation or a more dependable connection, then test again.
Also inspect local conditions: confirm that FFmpeg is reading the intended file, that timestamps progress, that audio is present, and that the encoder is not reporting dropped frames or resource pressure. Do not expose your stream key to viewers while testing. If your channel’s purpose is a continuous music loop, the workflow in keeping a 24/7 Indian music YouTube stream running after power loss addresses a different operational failure mode; bitrate testing still needs to happen separately.
Inspect stream health and adjust one thing at a time
During the test, watch YouTube Studio’s stream health and any warnings, while also reading FFmpeg’s output. The platform can report problems with the incoming feed, but the encoder log and your own playback check help distinguish causes. A warning about bitrate or unstable ingest points you towards the connection and rate control; missing or distorted sound calls for checking the audio input and encoding path; a choppy image can involve the source, encoding load, frame rate or connection.
Change one variable per retest where possible. If the uplink cannot sustain the selected target, try an appropriate lower-resolution or lower-frame-rate output and consult the matching YouTube row. If the computer cannot encode the chosen output without falling behind, test a less demanding format or a suitable encoder preset. If only busy scenes look poor but health is otherwise sound, compare the matching recommended bitrate and source quality before changing GOP or audio settings without cause.
No single green indicator proves that a channel will remain live overnight. A short successful test does not cover a later router restart, power loss, a source file ending, a scheduled operating-system update or an internet outage. For a 24/7 channel, keep a practical plan for monitoring and recovery, and check stream health after changes as well as during normal operation. For readers whose main concern is repeated disconnects, troubleshooting a meditation live stream that keeps disconnecting on YouTube is more directly about diagnosing those interruptions.
If you need a prerecorded file to continue broadcasting while your own computer is switched off, StreamNeo removes the specific burden of keeping a local FFmpeg process and computer running; the encoder settings and YouTube ingest health still need to match the channel’s needs, and YouTube remains the destination.
Ingest bitrate is not viewer playback bitrate
The bitrate you configure in FFmpeg is the rate of the feed sent to YouTube for ingest. YouTube says it automatically transcodes the incoming feed for viewers, so viewers may receive different playback formats and bitrates according to the renditions available and their device or connection. The 10 Mbps H.264 1080p30 recommendation is not a statement that every viewer must download 10 Mbps, nor is it a guarantee that every viewer will see 1080p.
This distinction affects both your upload planning and your expectations. Your upload connection must carry the ingest feed at a sustainable rate, plus audio and overhead. A viewer’s playback experience depends on YouTube’s processing and delivery as well as their own playback conditions. Setting -b:v 10M does not directly set a viewer’s internet requirement.
It also explains why choosing a higher ingest bitrate is not a universal fix. If your source is soft, the encoder is overloaded, or the connection drops packets, a larger target may not solve the actual issue. If your viewers report buffering, investigate playback conditions and the stream’s processing status rather than assuming the FFmpeg target is their exact playback bitrate.
Before committing, compare the operating options on the pricing page. When the file and channel are ready, start free — 24-hour trial, no card.
FAQ
What bitrate should I use for FFmpeg YouTube Live?
Use the row for your ingest codec, resolution and frame rate in YouTube’s current encoder table. For example, its H.264 recommendation is 10 Mbps at 1080p30 and 12 Mbps at 1080p60; do not apply those values to a different codec or output format without checking that table.
What should -g be for a two-second keyframe interval?
Multiply the output frame rate by two. Use -g 60 at 30 fps or -g 120 at 60 fps, and set the minimum key interval consistently for the encoder in use.
Does CBR guarantee a stable live stream?
No. CBR is YouTube’s listed bitrate mode, but network variation, encoder capacity, source issues and other failures can still interrupt or degrade a stream. Test the complete programme and monitor stream health.
Is the FFmpeg ingest bitrate the bitrate viewers receive?
No. YouTube transcodes an incoming feed for viewer playback, which can be delivered in different renditions. Your configured target describes the feed sent to YouTube, not a fixed playback rate for every viewer.