Skip to content
streamneo.
Streaming Settings11 min read

GStreamer x264enc Settings for 1080p Prerecorded YouTube Live Streams

Map YouTube’s 1080p live bitrate and keyframe guidance to GStreamer x264enc, then test the pipeline and monitor stream health.

sn.
StreamNeoPublished 4 October 2026
Worth sharing?

If you send prerecorded video into a YouTube Live event, configure the encoder for YouTube live ingest rather than treating the file as an ordinary upload. For x264enc, YouTube’s H.264 recommendations translate to a starting bitrate of 14000 for 1080p30 or 17000 for 1080p60, with a two-second keyframe distance of 60 or 120 frames respectively.

Those are recommendations, not guaranteed targets for every source or internet connection. YouTube also publishes lower minimum bitrates, and GStreamer’s so-called CBR mode is described in its documentation as ABR. Test your complete pipeline with representative video and audio, then check YouTube’s stream-health indicators before relying on it overnight.

Treat the file as a live ingest source

“Prerecorded” describes what you are sending, not how YouTube receives it. When a video file is encoded and sent into a live event, YouTube is still receiving a live broadcast. The relevant settings are therefore its live ingest guidance: codec, bitrate, keyframe interval and a stable feed at the chosen resolution and frame rate.

This distinction matters for a devotional loop, an ambience video or a local news replay. The pictures may not change much, but the encoder still has to produce a continuous stream at the frame rate you choose, while the audio and video remain in step. A static picture with music is not the same workload as a busy street scene or footage with camera movement.

In GStreamer, x264enc encodes raw video into H.264. It is one part of a pipeline, not a complete YouTube broadcast setup. You still need elements to read and decode the source, handle audio, package the encoded streams, and send them through the ingest path your setup uses. The right combination depends on that path; there is no single universal command that fits every source and machine.

If your source is a sequence of videos rather than one long file, test how the pipeline moves between clips as well as how it handles one clip. The practical issues around a continuous video loop are discussed in this guide to setting up a YouTube RTMP video loop with FFmpeg. Its focus is different, but the reminder applies: a steady encoder setting cannot fix a source that stops or fails to advance.

Read YouTube’s 1080p guidance correctly

YouTube Help gives separate H.264 recommendations and minimums for 1080p at 30 and 60 frames per second. Keep those categories distinct. The recommendation is a useful initial target if your source, encoder and sustained upload can support it; the minimum is not the recommended setting and does not promise that every piece of content will look acceptable at that rate.

YouTube live H.264 guidance 1080p30 1080p60
Recommended video bitrate 14 Mbps 17 Mbps
Published minimum video bitrate 5 Mbps 6 Mbps
Two-second keyframe distance 60 frames 120 frames

The figures are video bitrates. Your pipeline also carries audio and protocol overhead, so do not interpret the recommended video bitrate as the entire connection requirement. The uplink needs to sustain the combined stream without repeated drops or congestion. If you cannot sustain the recommended video rate, reduce the load or test another resolution or frame rate rather than assuming the published minimum will be a suitable quality target for your content.

YouTube’s live encoder settings guidance is the official reference for current ingest recommendations. Check it again when configuring a new channel or rebuilding a pipeline: guidance can change, and this article is not a substitute for the current page. Choose the row that matches the frame rate you actually intend to send. If your source uses another frame rate, use YouTube’s corresponding official guidance rather than extrapolating from the two examples above.

Map the bitrate to x264enc

The x264enc property bitrate is expressed in kilobits per second. For the two rows above, a reasonable starting configuration is bitrate=14000 at 1080p30 or bitrate=17000 at 1080p60. Those values are the recommended video rates expressed in the units expected by the element, not a promise that the result will match a particular quality or that your connection can carry it.

Avoid a common unit mistake: entering 14 or 17 when you mean 14 or 17 megabits per second. The element expects a kilobit-per-second value, so the example values use thousands. Confirm the installed property description with gst-inspect-1.0 x264enc; details can vary by GStreamer release or build, and your local plugin inspection is more useful than guessing from a copied command.

The bitrate setting behaves in relation to the encoder’s rate-control mode. GStreamer’s documentation says that in its CBR mode, the target bitrate determines quality; in constant-quantizer or constant-quality modes, bitrate instead acts as a maximum. YouTube recommends CBR for live ingest, but GStreamer describes x264enc’s CBR mode as “actually ABR”. That wording is a reason to verify the output and stream health, not to claim strict constant-rate behaviour merely because a property or preset is labelled CBR.

The encoder preset also matters. A faster preset can reduce the work required to encode each frame, while a slower one may give the encoder more opportunity to compress. There is no universally correct preset for this task in the official material. Start with one that can keep pace on the target machine at the intended resolution and frame rate, then inspect for dropped frames and quality problems during a representative run.

If your main concern is whether the source keeps playing while a computer sleeps or is unattended, encoding is only one part of the decision. A separate discussion of keeping a podcast live stream playing while the computer sleeps may help you think through the broader operating arrangement without changing the encoder requirements described here.

Set the keyframe interval in frames

YouTube recommends a keyframe frequency of two seconds and says not to exceed four seconds. In x264enc, the relevant property is key-int-max: it sets the maximum frame distance between keyframes. Convert the time interval into frames by multiplying the actual frames per second by the number of seconds.

At 30 fps, two seconds is 60 frames, so use key-int-max=60 as the starting mapping. At 60 fps, two seconds is 120 frames, so use key-int-max=120. These figures preserve the same time interval at different frame rates; they are not interchangeable. Using 60 at 60 fps, for example, represents one second, not two.

The four-second limit is an upper boundary in YouTube’s guidance, not a reason to set a longer interval when the recommendation is two seconds. Do not exceed that guidance. Also do not copy a small value from an unrelated GStreamer example without checking its context: an example that demonstrates RTP payloading or a different kind of network stream is not an alternative YouTube ingest recommendation.

The property’s documented value of zero means automatic. For a predictable live configuration, explicitly set the frame-based interval that corresponds to your actual frame rate and check the resulting behaviour. If a file’s nominal frame rate does not match the output rate you configure, use the output cadence sent to YouTube for the conversion and verify it in the complete pipeline.

Configure CBR and account for pipeline delay

YouTube recommends CBR for live video. In GStreamer, select the x264enc rate-control configuration that corresponds to CBR for your installed version, but remember the project documentation characterises this mode as ABR. Do not infer that the emitted bitrate is perfectly flat; examine the actual stream behaviour and let YouTube’s ingest health provide a second check.

Also account for buffering outside the encoder. GStreamer notes that x264enc can buffer frames and add latency, and that this can contribute to stalls in non-trivial pipelines when queues in other branches fill. If a pipeline has separate video and audio branches, an encoder’s delay can matter to how those branches progress. Queue limits may need adjustment, or a multiqueue may be appropriate, but the correct choice depends on the full graph. Avoid changing queue settings blindly; test whether the pipeline actually stalls and whether changes preserve audio/video synchronisation.

tune=zerolatency is not a routine requirement just because the destination is live. GStreamer documents it as a workaround for encoder latency, while warning that it affects overall encoding quality. For a prerecorded source, there may be no need to minimise encoder delay if the broadcast is meant to play continuously rather than respond to a live camera. Use it only if the delay is a real constraint, then compare the resulting quality and flow with a run that does not use it.

The GStreamer x264enc element documentation describes the available properties and latency considerations. Read the documentation for the version you have installed, since presets and defaults can affect the properties applied. In particular, do not assume a preset or tune leaves every default untouched; inspect the resulting configuration and validate it with the actual source.

Test with representative movement and audio

A short test should resemble the stream you plan to run. Include the kind of visual change that occurs in normal use: a static devotional image with subtle motion, a lofi visualiser, scrolling text, a rain scene, or a busier clip if that is what your channel uses. A test made only from a still frame may not reveal how the chosen bitrate and preset handle movement.

Include the real audio path too. Listen for silence, clipping, or interruptions, and check that sound stays aligned with the picture through a clip change or loop boundary. For a music channel, test the transitions between tracks; for a news loop, include speech and any lower-level ambience. Encoder settings cannot repair a source file with missing audio or an edit that introduces an abrupt pause.

Run the complete pipeline at the intended output resolution and frame rate, not just an isolated encoder test. Check whether it keeps up with real time on the machine that will run it. If CPU load or dropped frames appear, a faster preset or a lower output demand may be more useful than raising the bitrate. If the stream looks poor despite a stable feed, examine source quality and motion before assuming that a larger number alone will solve it.

For 60 fps content, compare the actual need for the higher frame rate with its cost: the 1080p60 recommendation is higher than the 1080p30 one, and the encoder must process more frames. A channel showing a largely static image may not benefit from 60 fps in the way fast-moving footage can. You can prepare a 60 fps playlist, but verify its output in the live pipeline; this guide to preparing 60 fps videos for a continuous YouTube Live playlist covers the source side of that decision.

Keep notes on the chosen frame rate, bitrate, keyframe interval and preset, along with what you observed during the test. That makes a later change interpretable. If you change several properties and the result improves or worsens, you otherwise will not know which change mattered.

Monitor YouTube stream health

A successful local encode is not proof of a healthy YouTube broadcast. Confirm that the live event receives the stream, then watch YouTube’s stream-health feedback while the test is running. Check for ingest warnings, interruptions, bitrate instability or a mismatch between the configured output and the event’s expected format. If the local pipeline looks normal but YouTube reports a problem, investigate the ingest path and connection as well as the encoder.

Test for long enough to observe the behaviour that matters to your channel. For an always-on stream, a brief launch check cannot establish that a loop will continue correctly, audio will remain present, or a connection will stay healthy through a later interruption. Reconnect behaviour should be tested deliberately. If YouTube rejects a key after reconnecting, use a separate troubleshooting path such as fixing an invalid stream key after reconnecting rather than trying to solve an authentication problem by changing x264enc bitrate.

Treat each warning as a clue, not a verdict on one setting. A low or unstable ingest rate can point to an uplink problem; a local stall can point to encoder workload or pipeline buffering; poor detail can reflect source quality, movement or rate control. Change one thing at a time and repeat the test so you can distinguish these causes.

When the pain is keeping a local computer running just to repeat the same uploaded video, StreamNeo removes that particular operating burden by turning an uploaded file into a YouTube live stream without needing your computer left on. It does not change the need to prepare the video and channel appropriately or to check the live event’s health.

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 set for 1080p30 with x264enc?

A reasonable starting value is bitrate=14000, which corresponds to YouTube’s 14 Mbps H.264 recommendation for 1080p30. YouTube also publishes 5 Mbps as a minimum, but that is not the recommended target or a guarantee of suitable quality. Confirm your connection can sustain the full stream and test your content.

What should key-int-max be at 1080p60?

For 60 fps, set key-int-max=120 to map YouTube’s recommended two-second keyframe interval into frames. YouTube says not to exceed four seconds; do not use a longer interval. Check that the output really is 60 fps, because the frame count represents time only in relation to frame rate.

Does tune=zerolatency need to be enabled for a prerecorded stream?

No. It is a latency workaround, not a requirement for prerecorded material, and GStreamer warns that it affects encoding quality. Consider it only where encoder delay is an actual constraint, then test quality and pipeline flow with and without it.

Do these settings guarantee a healthy YouTube stream?

No. They translate YouTube’s published guidance into relevant x264enc starting values, but they cannot guarantee stable upload, correct audio, a compatible pipeline or a healthy ingest. Check the current YouTube guidance, inspect the installed GStreamer element, test representative content and monitor stream health.

YOU’VE REACHED THE END

Keep the ideas coming.

More guides, useful tools and a little help for your next broadcast.

Back to the journal ↗
YOUR NEXT READ

A little more to explore.

More Streaming Settings guides ↗ · All topics ↗