To scale a video to 1080p for a YouTube loop stream, use FFmpeg’s scale filter to produce a 1920×1080 frame and choose how to handle any source that is not 16:9. To repeat a complete file, loop the input and pace it for real-time output; then set YouTube’s ingest parameters and check the live preview and stream health separately.
Scaling and looping do not supervise the FFmpeg process or guarantee that it will reconnect or restart after a failure. This guide covers the video and encoder settings, a practical command pattern, and checks to make before and after starting the broadcast.
What 1080p output means in FFmpeg
A 1080p frame is 1920 pixels wide by 1080 pixels high. In FFmpeg, the scale video filter resizes frames; it does not by itself determine whether a non-16:9 source should have bars, lose edge content, or be distorted. Those are different image treatments, and the right one depends on what must remain visible.
A 1920×1080 output frame can contain a smaller image with bars around it, or a cropped image enlarged to fill the whole frame. Stretching a 4:3 picture to fill 16:9 is another mathematical possibility, but it changes the apparent shape of faces, lettering, and objects. Avoid it unless that distortion is an intentional part of the presentation.
The output dimensions are also not the same thing as the source’s visual detail. Enlarging a 720p file to 1920×1080 creates a 1080p-sized output, but it cannot restore detail that the original file does not contain. A logo or text that looks readable in a small local preview may still be soft at full size, so inspect the actual result rather than assuming the output label describes its quality.
FFmpeg’s filter documentation describes how scale handles width, height, sample aspect ratio, and the force_original_aspect_ratio option. Read the scale filter documentation alongside the command you intend to run, particularly if a source reports unusual display or sample aspect metadata. A useful starting point is to make the output frame dimensions explicit and ensure the displayed image keeps its intended proportions.
Loop the complete input file
For a prerecorded file that should play from beginning to end repeatedly, use FFmpeg’s input-loop option, rather than a filter that repeats only buffered video frames. The commonly used input option is -stream_loop -1; place it before the input it applies to. For example, the command later in this article uses -stream_loop -1 -re -i input.mp4. Confirm the syntax supported by your installed FFmpeg build with ffmpeg -h or its local documentation before relying on it in a live workflow.
The distinction matters. FFmpeg’s loop video filter repeats frames held in a buffer, with options for the number of repeats, buffer size and starting frame. It is useful for a frame-level effect, but it is not a substitute for restarting playback of an entire file with its audio. The official FFmpeg filter reference documents the filter and its parameters. Do not mistake an example that loops a buffer of one frame for a whole-video replay.
For a live output, -re tells FFmpeg to read the input at its native rate instead of consuming a file as quickly as the computer can process it. FFmpeg’s main command documentation describes this as useful when simulating a live input from a file. Place it with the input options before -i, as in the example. It controls pacing; it does not detect a dropped connection or restart the process.
Check the file before attempting a long run. It should have the expected video and audio streams, and its duration should match the material you intend to repeat. The loop occurs at the end of the input, so listen for an abrupt audio cut or inspect the final and opening frames. If a song ends with a long fade or a devotional recording has a spoken introduction, the transition may be noticeable each time around. FFmpeg can repeat the file, but it cannot make an unsuitable edit point sound seamless by virtue of looping.
If your source is a playlist of separate files rather than one complete video, this command pattern is not a playlist manager. Prepare a combined file or use a workflow designed to transition among inputs, and test the transitions. For a small machine, the Raspberry Pi FFmpeg settings guide can help you think through resource constraints, but it does not remove the need to test the specific filter and output settings you choose.
Scale to 1920×1080 without stretching
The filter options depend on your chosen treatment. For a source whose display aspect ratio is already 16:9, a simple scale=1920:1080 is a direct target. For other ratios, use a fit or fill expression that preserves proportions, and then make a conscious choice about padding or cropping. FFmpeg’s force_original_aspect_ratio can constrain a scaled image within a box; force_divisible_by can help keep dimensions suitable for a chosen encoder, where needed.
A fit-with-bars pattern uses a preserved-aspect scale within the 1920×1080 box, then pads the remaining space. A representative filter is:
scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2
This makes a 4:3 source fit in the 16:9 frame without cutting off its edges; the unused width becomes bars. The bars can be black, which is often the least distracting choice, or a deliberate background if your design calls for one. Check that subtitles, channel marks, and edge details are not hidden by the padding or placed so close to the source edge that a later crop would remove them.
A fill-by-cropping pattern scales until the frame is covered and crops the excess:
scale=1920:1080:force_original_aspect_ratio=increase,crop=1920:1080
With a taller 4:3 source, this fills the frame but removes some material from the top and bottom after enlargement. With a wider source, it can remove content at the sides. Preview the exact output: the centre may be acceptable for a landscape or ambient scene but could cut off a person, a temple image, a ticker, or text. Cropping is a composition choice, not a free way to preserve every pixel.
If neither bars nor cropping suits the material, consider a designed background: keep the whole source fitted at the centre and use a blurred, colour-matched, or branded layer behind it. That takes more filter work and can make the frame busier. It also requires you to check contrast and text legibility on a real preview. The objective is to make the source look intentional within 16:9, not to conceal the fact that its aspect ratio differs.
| Treatment | What happens to a mismatched source | Best suited to | Main trade-off |
|---|---|---|---|
| Fit with bars | Keeps the complete image at its original proportions and fills unused space with bars | Recordings, artwork, or text that must remain intact | Bars occupy part of the frame |
| Crop to fill | Enlarges the image to cover 1920×1080 and trims excess edges | Footage where the centre remains useful | Some original content is lost |
| Designed background | Fits the complete image over a separately designed or blurred background | Branded layouts or portrait/tall source material | More composition and preview work |
| Stretch | Forces the image to fill 1920×1080 regardless of its proportions | Rarely appropriate; only if deliberate distortion is wanted | Shapes and text look wrong |
The table is a decision aid, not a quality ranking. A bhajan video with lyrics near the edge may need fitting, while a wide nature shot with no important edge detail may suit a crop. If you change the treatment, rerun the command and inspect it at full-frame size rather than relying on a tiny command-line thumbnail.
Set live output parameters for YouTube
YouTube’s encoder guidance calls for a codec, resolution, frame rate, bitrate mode, bitrate, and keyframe interval that work together. YouTube Help recommends RTMPS, CBR bitrate encoding, up to 60 frames per second, and a two-second keyframe interval that should not exceed four seconds. Its H.264 guidance lists separate rate ranges for 1080p30 and 1080p60, so do not carry one figure across both frame rates or apply H.264 figures to a different codec.
As listed in YouTube’s encoder settings guidance accessed on 3 October 2026, the H.264 range for 1080p30 is 5 Mbps minimum and 14 Mbps recommended; for 1080p60 it is 6 Mbps minimum and 17 Mbps recommended. Those are YouTube’s listed encoder rates, not a promise that a particular home connection can sustain them. YouTube advises selecting a quality that is reliable for the connection and checking upload capacity. Consult the current YouTube encoder settings page for the relevant codec and frame-rate row before choosing values.
For a mostly static devotional image or a lofi scene, 30 fps may be adequate if that matches the source. Fast movement can make 60 fps worthwhile, but it raises the recommended bitrate and processing demand. Sending a 60 fps output made from 30 fps material does not create new motion detail. Similarly, choosing a larger bitrate than your upstream connection can sustain may make the stream less stable rather than clearer.
Here is a pattern for H.264 at 1080p30 using a fit-with-bars filter. Replace the placeholders with your local file path and the stream URL/key YouTube gives you. Treat it as a starting point and test the syntax and settings on your installed build:
ffmpeg -stream_loop -1 -re -i input.mp4 \
-vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2" \
-r 30 -c:v libx264 -preset veryfast -pix_fmt yuv420p \
-b:v 8M -maxrate 8M -bufsize 16M -g 60 -keyint_min 60 -sc_threshold 0 \
-c:a aac -b:a 128k -ar 44100 \
-f flv "rtmps://YOUR_INGEST_URL/YOUR_STREAM_KEY"
The example’s 8 Mbps video rate is an illustrative selection within YouTube’s listed H.264 1080p30 range, not a universally correct value. The same number is not suitable by default for a different codec or frame rate. -g 60 at 30 fps gives a two-second GOP; if you change to 60 fps, review the keyframe interval and bitrate together. -b:v, -maxrate, and -bufsize are encoder controls, and the example uses matching target and maximum rates to support a constrained rate. Check the result in YouTube Studio.
The output uses -c:a aac for audio encoding. If the source has no audio, decide whether your output workflow should contain an audio stream rather than assuming this example fits unchanged. If it does have audio, listen to the opening and loop point after encoding; the output sample rate and bitrate are choices to test against the source and the channel’s needs. Keep credentials private: a stream key is not text to publish in a script screenshot or support post.
The stream key and ingest URL come from YouTube Studio. If you need to understand the key’s reuse and handling before placing it in the command, see how to create a reusable stream key in YouTube Studio. YouTube states, “We recommend streaming to YouTube Live with RTMPS, a secure extension to the popular RTMP streaming video protocol.” Use the ingest address and key shown for your own channel, and do not paste them into a public example.
Test the command and inspect the YouTube preview
A command that starts without an FFmpeg error has only passed a local syntax and processing check. It does not prove that YouTube is receiving a healthy stream, that the key is correct, or that the image and sound suit the channel. Start with a short test, use the same input and representative motion or audio as the intended broadcast, and inspect the YouTube Studio preview before treating the settings as ready.
Look for the details that are easy to miss in a static frame: whether the source is correctly centred, whether bars are acceptable, whether a crop loses text, and whether the image has the expected proportions. Listen for clipped speech, abrupt audio at the file boundary, or a gap when the loop returns to the beginning. Check that the live preview reports the expected resolution and frame rate, and read any stream-health notices rather than assuming a picture on screen means all is well.
Test with the intended computer and network where possible. A short office test on a different connection may not represent the location where an always-on channel will run. YouTube recommends an upload speed test and advises testing with similar audio and movement. A static image may require less demanding encoding and expose different issues than a moving devotional montage, local-news ticker, or animated background. If you change resolution, frame rate, codec, bitrate, or filter after the test, repeat it.
Keep the source and the command in a recoverable place, but do not expose the stream key. Record which filter treatment you tested and the encoder choices that worked, so a later edit does not silently change the aspect ratio or keyframe cadence. The bitrate guidance for a slideshow playlist may help when your content has little movement, but use the actual codec and frame-rate row from YouTube rather than assuming every low-motion channel has the same needs.
Monitor the stream after it starts
Once the stream is live, continue checking YouTube Studio’s preview and stream-health messages. Watch for an unexpected change in resolution, dropped or unstable ingest, audio problems, or a warning that the stream is not receiving the settings you intended. Monitoring is an operational check; the fact that the video loops or has a valid scaling filter does not monitor anything by itself.
Keep the categories separate when diagnosing a problem. The input loop controls whether file playback repeats; the scale and padding or crop filters control what appears in each frame; encoder parameters control the outgoing audio and video; and YouTube’s status reports what it is receiving. If the image is stretched, revisit the filter. If the audio jumps at the loop point, inspect the edit or source. If the preview reports an ingest issue, check the network, key, and output settings rather than changing the crop.
An FFmpeg process can stop for reasons that are separate from its filters or encoding options. Process supervision, reconnect behaviour, and restarting after a crash need their own design and testing; none should be inferred from the command in this guide. Likewise, a working test does not guarantee uninterrupted 24/7 operation. If an unattended channel matters, decide who or what checks it and how a failure is noticed, then test that recovery path independently. For a computer that runs locally, the article on keeping a stream online during Windows updates addresses a different operational risk from scaling and looping.
For a long-running channel, write down what “healthy” means in practical terms: the preview is present, audio is audible, the intended 1080p treatment remains visible, and the stream-health panel has no unresolved issue. Check after launch and again when you make changes or see a warning. No single check substitutes for attention to the channel’s actual output.
If local process care is becoming the main burden, StreamNeo can remove the need to keep your own computer running by turning an uploaded file into a YouTube live stream, while monitoring and restarting the broadcast if it drops. It does not change the need to choose a suitable aspect-ratio treatment, validate the preview, or check YouTube’s current ingest guidance.
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
How do I loop a video on YouTube Live with FFmpeg?
Use FFmpeg’s input-loop option before the input file to replay the complete file, and use -re to pace file reading for live output. Confirm that your installed build accepts the syntax, then send the output to the YouTube ingest URL and key from Studio. This repeats the file; it does not supervise or restart FFmpeg if the process stops.
How do I resize a video to 1080p without stretching it?
Use the scale filter with a 1920×1080 target and preserve the source aspect ratio. Fit the complete image and add bars, or scale to fill and crop the excess; decide based on what must remain visible. Do not force a mismatched source to fill the frame by distorting it.
Should I use 30 or 60 fps for a 1080p loop?
Use a frame rate suited to the source’s motion and what your encoding and upload connection can sustain. YouTube’s H.264 guidance accessed on 3 October 2026 lists different bitrate ranges for 1080p30 and 1080p60, so consult the current table for your codec and frame rate. Outputting at 60 fps does not add motion detail to 30 fps source footage.
Does looping mean the stream will keep running if FFmpeg stops?
No. The input loop repeats the file only while the FFmpeg command is running; scaling and looping do not provide process supervision, reconnection, or restart behaviour. Test monitoring and recovery separately if the channel is expected to run unattended.