For a 720p pre-recorded YouTube Live stream, start with H.264 at a constant bitrate, the source frame rate where possible, a two-second keyframe interval and stereo AAC audio. YouTube recommends 8 Mbps for 720p H.264 at both 30 and 60 fps, but that is an ingest recommendation, not a promise that your connection, encoder or input can sustain it.
A command line can make a file play into YouTube at live pace; it cannot make an arbitrary playlist compatible, keep a weak connection stable or ensure a scheduled broadcast is live. Treat the settings below as a starting profile, then test the complete media path and watch YouTube's stream health before relying on it overnight.
Choose a 720p output target
First confirm what the file actually contains. A 1280 × 720 progressive source is already a natural match for a 720p output. The example below does not resize video, so an input at another resolution remains at that resolution unless you add a filter. Check the preview and stream details rather than inferring output size from the filename.
YouTube’s published H.264 table lists 3 Mbps as the minimum and 8 Mbps as the recommended video bitrate for both 720p30 and 720p60. These are YouTube’s ingest figures, not a minimum guaranteed by your internet provider and not an encoder performance guarantee. The higher frame rate does not change the recommended bitrate in that table, though it may change how much motion detail is available to encode.
For a devotional programme made from a mostly static image, 30 fps may be a sensible match if the source is 30 fps or lower. For footage with more motion, 60 fps can preserve smoother movement when that is what the source contains. Do not convert a 24 or 25 fps file to 60 simply because the setting exists: repeating or inventing frames does not add original motion detail.
For standard dynamic-range material, YouTube’s guidance also identifies progressive scan, square pixels, 8-bit depth and Rec. 709 among the relevant advanced settings. Those labels matter when files come from different editing tools or sources. A source with unusual colour characteristics or interlaced frames deserves a test conversion or a separate review; a bitrate setting alone will not correct its appearance.
If you need a broader walkthrough of the single-file looping concept, see this guide to setting up FFmpeg to loop videos on YouTube Live in India. The command and checks here focus specifically on a 720p starting profile rather than every possible playlist arrangement.
Use the source frame rate where possible
Choose the output frame rate deliberately. If the file has a constant 30 fps rate, -r 30 is a straightforward match. If it has a constant 25 fps rate, use 25 and calculate the keyframe spacing for that rate. Mixed-frame-rate material requires more care: an output frame rate may cause frames to be repeated or dropped, and a playlist can change cadence between clips.
A two-second keyframe interval means about twice as many frames as the frame rate per second. At 30 fps, that is 60 frames; at 25 fps, 50; at 60 fps, 120. The purpose is a regular group-of-pictures interval, not a way to improve the source. For variable-frame-rate files, a nominal -r and fixed GOP value may not translate neatly into the same wall-clock interval throughout playback, so inspect the media and validate the actual feed.
The command uses 30 fps because it is a common 720p source cadence and makes the two-second GOP visible in the options. Change both the output rate and GOP-related values if your chosen constant frame rate differs. If you do not know the media’s properties, inspect it with an appropriate media information tool before streaming rather than guessing from how it looks on a desktop player.
Keep the difference between source quality and output settings in mind. A small 25 fps animation sent as 60 fps will not become a 60 fps animation in any meaningful source-detail sense. For a local news loop containing video clips, stills and text, test the points where content changes; the visible result and cadence at transitions matter more than a theoretical setting.
Set H.264 bitrate and CBR
YouTube recommends constant bitrate encoding for live ingest. In FFmpeg, the example expresses an 8 Mbps target with -b:v 8M, while -minrate and -maxrate constrain the rate and -bufsize sets the encoder buffer. The figures follow YouTube’s 720p recommendation, but they should not be read as proof that a particular CPU can encode in real time or that a particular upload path will carry the stream without interruption.
ffmpeg -re -stream_loop -1 -i "input.mp4" \
-c:v libx264 -preset veryfast -pix_fmt yuv420p \
-r 30 -g 60 -keyint_min 60 -sc_threshold 0 \
-b:v 8M -minrate 8M -maxrate 8M -bufsize 16M \
-c:a aac -b:a 128k -ar 44100 \
-f flv "rtmps://INGEST_URL/STREAM_NAME"
Replace input.mp4, INGEST_URL and STREAM_NAME with your own values. The ingest address and stream name or key are account-specific. Keep the key private: do not put a real key in a public script, screenshot, shared terminal history or log. YouTube’s Live Streaming API documentation for streams describes the stream resource and ingestion information.
Eight Mbps is a video setting, and audio adds to the total sent over the connection along with protocol overhead. You therefore need upload capacity beyond the video number, with room for normal variation and other traffic on the same connection. A speed test is useful as one check, but its result does not show that the encoder can keep up or that bandwidth will remain available overnight. If the connection has little headroom, lower the target only after considering YouTube’s published recommendation and checking the resulting picture and stream health.
The veryfast preset is a practical starting choice, not a universal best setting. A slower preset can require more processing time; an overloaded encoder may fall behind even if its bitrate target is correct. If the host’s CPU is strained or frames are missed, test a faster preset or a hardware encoder supported by your build, then compare the actual output and stability. A discussion of hardware encoding and the power cost of continuous OBS streaming may help frame that separate trade-off, though it does not replace testing your FFmpeg setup.
Configure keyframes and RTMPS
The -g 60 and -keyint_min 60 values in the example assume 30 frames per second, giving a keyframe interval of about two seconds. -sc_threshold 0 disables scene-change keyframe decisions in this x264 example so that the GOP cadence remains regular. For another fixed frame rate, revise GOP values to roughly twice the frames per second, and verify that the encoder build supports the options as used.
YouTube lists RTMP and RTMPS as ingest protocols and recommends RTMPS. The output URL shown uses RTMPS and an FLV container, a common pairing for this kind of ingest. Use the current ingest URL and stream name supplied by YouTube Studio, rather than copying a URL from an old script or another account. The YouTube Help guide to encoder settings, bitrates and live-stream setup is the place to check current published recommendations.
A stream key is a credential, not a channel label. If it is exposed, rotate it through the account’s live settings rather than assuming that removing it from a file is enough. Keep the private key out of screenshots when asking for help. You can also keep a template script with placeholders and enter credentials separately, taking care that shell history or process logs do not reveal them.
The stream resource and the broadcast event are not the same thing. YouTube’s documentation distinguishes the transmission settings from the watchable broadcast. Sending media to an ingest address does not by itself settle whether the event is scheduled, ready, or live to viewers. Review how YouTube broadcasts and streams relate, and check the status in Studio as well as the encoder output.
Set stereo AAC audio
The example encodes audio as AAC at 128 kbps and 44.1 kHz. YouTube lists AAC or MP3 as supported audio codecs and gives 44.1 kHz, 128 Kbps as its stereo AAC settings. Check that the source file really has an audio stream before using a command that expects one; this example assumes the input contains both video and audio.
Silence can be a source problem, an absent audio stream, or a mapping issue. A video-only file does not acquire meaningful audio merely because -c:a aac appears in the command. You would need to generate or map audio deliberately for that case, then verify the result in the preview. If music or a voice track matters to your channel, listen to the test from the start and after at least one file transition.
For a playlist with changing sources, compare loudness and channel layout across files. One clip may be stereo and another mono, or one may be much louder. These are practical media issues rather than settings solved by the 128 kbps target. A guide to checking for no audio from a pre-recorded video in Streamlabs Desktop covers a related symptom in another workflow; the same habit of checking the actual audio path applies here.
Adapt the input for a playlist
-re and -stream_loop -1 appear before -i because they are input options in this example. FFmpeg documents -re as reading at the input’s native frame rate, also described as a read rate of one; it is useful when packet flow needs to match real time, such as live streaming. -stream_loop -1 repeats that one input indefinitely. Consult the FFmpeg command-line documentation for the version and options installed on your host.
This illustrates one file repeated, not a universal command for multiple files. A set of compatible clips may suit a concat input list, but compatibility includes more than matching filenames: codecs, stream layouts, dimensions, time bases and audio can affect whether joins behave as intended. Different formats or required transitions may call for another playout arrangement. Do not assume that putting an arbitrary list under -stream_loop -1 produces seamless joins.
Test the exact sequence, including the last-to-first transition if it is meant to repeat. Watch for a pause, a black frame, a change in aspect ratio, a sudden audio level change, or an FFmpeg error at the join. If the clips are mixed in frame rate or dimensions, decide whether to normalise them before the live run. A successful test of one clip does not demonstrate that the playlist will behave the same way.
If your schedule needs different clips at particular times, a single infinitely repeated input is the wrong mental model. Plan the playlist and its transitions as a separate media workflow, then connect that tested output to YouTube. This distinction is useful for small businesses rotating product footage as much as for a bhajan channel moving between songs and title cards.
Validate the FFmpeg build and stream health
FFmpeg option availability can vary by build and version. Check the installed binary’s help output for the encoder and options you plan to use, and do a short trial with the same host, file, command shape and network route intended for the real broadcast. This example is illustrative, not a command tested against every FFmpeg version or input. If an option is rejected, consult the documentation for that build rather than deleting flags without understanding their purpose.
YouTube’s help recommends testing before going live, using audio and movement similar to the actual event, and monitoring stream health and messages during the event. In Studio, confirm that a preview arrives, that the intended resolution and frame rate are reported, and that both sound and picture remain stable. If the live event is scheduled, check its broadcast state separately from the stream connection.
The upload should have headroom above the stream’s total encoded rate. Avoid treating one speed-test result as a guarantee: other users and devices can consume capacity, and the route may vary. If the health panel reports instability, look at the encoder’s reported bitrate and dropped frames, the machine’s load, and competing network use. Reduce other traffic or test a lower output target as appropriate; then repeat the trial long enough to include playlist joins and typical movement.
A file that looks fine when played locally can still fail in a live workflow because of an unsupported stream layout, an unexpected audio absence or an encoder that cannot keep pace. Check the input, the FFmpeg process output and YouTube’s health messages together. Keep a note of the profile that passed your own test, but repeat checks after changing source files, frame rate, build, key or network arrangement.
If the practical burden is keeping a computer awake, maintaining the process and restarting it when it drops, StreamNeo addresses that specific operational problem by running an uploaded file as a YouTube stream while your computer is off. It does not remove the need to prepare compatible media, protect your key or check YouTube’s current requirements and stream status.
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 720p YouTube Live?
YouTube’s current H.264 guidance lists 8 Mbps as recommended and 3 Mbps as the minimum for both 720p30 and 720p60. Start at the recommendation if your encoder and upload can sustain it, but leave headroom and judge the result using a real test. Those figures are guidance, not a guarantee for your host or connection.
How do I loop one video with FFmpeg?
For a single input, -re -stream_loop -1 before -i paces playback at the file’s native rate and repeats the input indefinitely. The rest of the command must match the file’s streams and your chosen output settings. Test the complete run before treating it as a continuous channel.
Can I use the same loop command for a playlist of different files?
Not reliably as a general rule. A compatible concat arrangement may work for a set of files, but formats, stream layouts and transitions affect the result, and there is no universal command for every playlist. Test the exact list through its joins and loop point.
Does connecting FFmpeg mean my YouTube broadcast is live?
No. The ingest connection carries the stream, while the broadcast is the viewer-facing event with its own status. Check the preview and stream health in YouTube Studio, and confirm the broadcast is scheduled or live as intended.