Skip to content
streamneo.
Setup Guides12 min read

How to Set Up an FFmpeg YouTube Loop Stream on a Raspberry Pi Without a Monitor

Prepare a Raspberry Pi headlessly, loop a local video to YouTube with FFmpeg, and check the stream before leaving it unattended.

sn.
StreamNeoPublished 4 October 2026
Worth sharing?

You can prepare a Raspberry Pi for a YouTube loop stream without connecting a monitor: configure Raspberry Pi OS Lite, Wi-Fi and remote access in Raspberry Pi Imager, then manage the Pi over SSH. Whether it can run your chosen video continuously depends on the exact Pi model, FFmpeg build, media and network, so test that combination before relying on it overnight.

This guide assumes you have another computer for writing the boot card, a Pi model and power supply suitable for your workload, a local video file, and a YouTube channel able to start a live stream. Ethernet is a useful first choice where available; Wi-Fi can work, but confirm signal and upload stability at the Pi’s intended location in India rather than assuming a nearby router means a reliable broadcast.

Prepare Raspberry Pi OS and headless access in Imager

On another computer, download and open Raspberry Pi Imager. Select the operating system and storage card carefully: writing the card erases its contents, so check that the selected device is the card you intend to use. Choose Raspberry Pi OS Lite for a headless setup. It has no desktop environment, which avoids running a graphical session you do not need; it also means VNC desktop access is not the route to use.

Select the Pi model shown in Imager, then choose an appropriate current Raspberry Pi OS Lite image. Imager’s customisation flow lets you set the account, network and remote access before the first boot. Raspberry Pi recommends Imager for configuring these details and documents the headless setup process in its getting-started guide. Menu labels can change between Imager releases, so follow the current prompts rather than relying on an old screenshot.

Use a supported, current username and a strong password of your own. Do not expect a default account to exist: current setup expects you to create an account. Enable SSH or Raspberry Pi Connect during customisation. SSH is a straightforward choice if you are comfortable entering commands; Connect may be useful if its current requirements and access method fit your setup. These are alternatives for remote access, not a reason to omit initial account configuration.

If you already have an Ubuntu computer, the FFmpeg Ubuntu setup guide may help you compare a desktop-based workflow with this Pi approach. The Pi’s advantage is a small, dedicated device; its trade-off is that you need to confirm the model can handle your selected media and any real-time encoding.

Configure user, Wi-Fi and remote access before first boot

In Imager’s customisation settings, set the username and password, then configure the Wi-Fi network if you are not using Ethernet. Enter the network name and password exactly as configured on your router, and choose the correct wireless country setting. That setting is part of configuring the device for the local wireless environment; it does not establish any legal conclusion about your content or channel.

Check your board’s wireless capabilities before choosing a band. Raspberry Pi notes that some models or wireless adapters do not support 5 GHz, so a network name that is visible to your phone may not be usable by the Pi. If you are not sure, use a compatible 2.4 GHz network or Ethernet for initial setup, then test the actual connection where the stream will run.

Enable SSH in Imager and, if offered, choose password or public-key authentication according to your comfort and security needs. If you choose a public key, make sure you know which computer holds the matching private key. A key-only setup can be more secure, but if you lose access to that private key, connecting remotely becomes harder. Record the hostname you set, or note the default hostname shown by the system, so you can try it after boot.

Write the image and wait for Imager to finish. Eject the card safely, insert it in the Pi, and connect the network cable if using Ethernet. Do not connect a monitor just to check that the image was written; the next step is to give the Pi power and let it join the network. Keep the card and credentials somewhere you can find them if you need to recover the device.

Boot the Pi and connect remotely

Place the Pi where it can receive power and network access, insert the prepared card and switch it on. Give it time to boot and join the network. From the router’s connected-device page, look for the hostname you configured or the Raspberry Pi device. Note its local IP address if shown. You can also try the hostname from another device on the same network, though local name discovery varies by router and operating system.

From a terminal on your computer, connect with SSH using the username and address you configured. For example, replace the placeholders with your own values:

ssh YOUR_USERNAME@PI_HOSTNAME_OR_IP

Accept the host-key prompt only if you expect to be connecting to this Pi. Enter your account password when asked, or make sure your SSH client can use the configured private key. If the hostname does not resolve, use the router’s IP address listing. If neither works, check that the Pi is powered, the card was written successfully, and the network details match; a keyboard and monitor can be a recovery aid if remote discovery fails, even though neither is required for the normal Imager headless path.

Once connected, update the operating system using its package tools before installing software, and note that package updates may take time or require a restart. If you plan to place files over the network, use a transfer method you understand, such as scp, and verify the destination path and available card space. For troubleshooting a missing input file or an empty source directory, see how to keep a stream running when the source folder is empty; a loop command cannot play a file that is absent or unreadable.

Install FFmpeg and inspect the video

Install FFmpeg from the current Raspberry Pi OS package repository, then check that the command is available and inspect the installed build. Package availability and included encoders can differ with OS version and architecture; do not assume a command found in a guide from another Pi generation will behave identically. Check the local help or manual for -stream_loop support before using it. In FFmpeg’s usual command layout, input options go before the corresponding -i input, while output options follow the input.

Copy your video to a known location, for example a directory under your home folder, and give it a simple filename. Confirm that the Pi account can read it and that the card has room. Use ffprobe if installed, or inspect the file with FFmpeg, to learn its video codec, dimensions, frame rate and whether it contains audio. That inspection matters: a silent file and a file with AAC audio do not need the same audio handling, and a codec that plays on your laptop may still be awkward for the Pi or YouTube ingest.

A local file can be sent without re-encoding only when its streams, container and timing are suitable for the selected YouTube ingest path. Transcoding to H.264 and AAC may be more broadly workable but consumes Pi compute; the dossier does not establish a performance guarantee for any model. If the CPU cannot keep pace, you may see buffering, dropped frames or a failed encode. Start with a conservative resolution and bitrate, and test the exact file on the exact board.

Create the YouTube stream and protect its key

In YouTube Studio, open Live Control Room and create or schedule a stream using the current setup flow. Copy the server address and stream key from the stream settings. YouTube describes the stream key as a password-like credential that identifies where the encoder sends its feed; read its stream settings guidance and treat the key as private.

Never publish the real key in a public script, screenshot, shared support message or source-control repository. A command pasted directly into a shell can also remain in shell history, so avoid using a real key in an example or a file that will be shared. Use a placeholder such as <STREAM_KEY> while testing the command structure. If you believe the key has been exposed, reset it in Live Control Room and update the encoder configuration.

YouTube provides encoder requirements and suggested settings in its live encoder settings guide. Its current guidance lists RTMP/RTMPS, H.264, H.265 or AV1 video, AAC or MP3 audio, constant bitrate, and a two-second keyframe interval recommendation, with intervals not exceeding four seconds. It also recommends matching quality to your connection and testing upload capacity. Use the settings shown for the stream you create, rather than assuming an old server URL or key is still current.

Build a loop command for your actual source

First make a short, non-critical test command with the file path and YouTube address. The following is a structure, not a guarantee that every Pi, FFmpeg build and source file can run it unchanged:

ffmpeg -re -stream_loop -1 -i "/home/YOUR_USERNAME/video.mp4" \
  -c:v libx264 -b:v 2500k -maxrate 2500k -bufsize 5000k \
  -g 60 -keyint_min 60 -sc_threshold 0 \
  -c:a aac -b:a 128k \
  -f flv "rtmps://YOUTUBE_SERVER/YOUR_STREAM_KEY"

The numbers in this example are illustrative settings, not a recommendation for every source or a claim about Pi performance. Replace the path, server and key using the values for your file and stream. Check the installed FFmpeg help to confirm -stream_loop -1 is supported and positioned as an input option before -i. -re reads file input at a real-time pace, which is generally appropriate when sending a file as a live feed rather than letting the encoder push it as fast as possible.

This example asks FFmpeg to encode H.264 and AAC and package them for an RTMP-family destination. If your FFmpeg build lacks libx264, or the Pi cannot encode your chosen resolution in real time, it will fail or fall behind. Inspect available encoders, reduce the workload, or use a source already encoded in a compatible format only after checking that its audio, timestamps and video streams are accepted. An absent audio stream needs an intentional approach; do not assume the command will create audio for a silent video.

Use the RTMPS server address provided by YouTube where available. FFmpeg documents RTMPS as RTMP over a secure SSL connection in its protocol documentation, and Google describes RTMPS ingestion. Confirm the precise endpoint and key format shown for your stream; some interfaces provide a server and key separately, so compose the destination according to the current instructions. Keep the key out of the sample and any log or configuration file you share.

For quality, choose a bitrate the uplink can sustain with room for ordinary variation. YouTube’s H.264 recommendations include 3 Mbps for 720p at 30 fps and 5 Mbps for 1080p at 30 fps; those are reference settings from YouTube, not proof that a given Pi can encode them or that your connection can upload them steadily. A 480p stream at a lower bitrate can be a more practical starting test on constrained links. For a playlist with a fixed frame rate, the pre-recorded 1080p playlist guide explains why consistent source and output settings need attention.

Verify preview, power and network before relying on it

Run the command while connected over SSH and watch FFmpeg’s output. Confirm that it opens the intended input, reports video and audio streams as expected, and continues sending rather than stopping at the end of the file. Then check the Live Control Room preview and stream-health indicators. A process that has not printed an error is not proof that viewers receive a healthy picture and sound.

Watch the preview from a separate device as well. Check that the opening image is correct, audio is present when expected, the loop restarts cleanly, and playback remains smooth for a representative period. YouTube recommends testing with representative movement and audio and monitoring stream health. Repeat with the same resolution, bitrate, file, power supply and network location you intend to use unattended. A brief test on a desk beside the router says little about a Pi placed in another room.

For an India-based setup, practical differences are often about the installation rather than the country as a whole: router placement, broadband upload behaviour, local power interruptions, access to a suitable power supply and whether the Pi can be kept ventilated. Ethernet can avoid some wireless variation if a cable run is practical. If you must use Wi-Fi, check the signal at the final location and test during the hours when the channel will operate. No single broadband plan or Pi model can be assumed from location alone.

Use a stable power source appropriate for your board and avoid placing it where heat or accidental cable removal is likely. Consider what happens when household power or the router restarts: a manual SSH session will not itself relaunch FFmpeg after a reboot or process failure. A system service configured to start and restart the encoder can help operationally, but its syntax and behaviour must be tested on your OS. Keep logs accessible, protect any file holding credentials with restrictive permissions, and practise reconnecting over SSH to inspect or stop the process.

Only stream media you are entitled to use. YouTube says live streams can be terminated for copyright or Community Guidelines strikes; a file being on your card does not establish a right to broadcast it. Check YouTube’s current copyright guidance and applicable official information for your circumstances rather than relying on assumptions about a particular country or content type.

If you decide that maintaining a Pi, its power and its remote recovery is more work than suits your channel, StreamNeo removes the need to leave that computer running by letting you upload a video and connect your YouTube stream key for an always-on broadcast; it is YouTube-only, so it is not a fit if you need a different destination.

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

Can I complete the setup without ever using a monitor?

The normal Imager headless path lets you configure the account, Wi-Fi and remote access before first boot, then connect over SSH or Raspberry Pi Connect. If the Pi does not join the network or you lose remote access, a monitor and keyboard can still be useful recovery tools. Do not treat headless setup as a promise that every fault can be diagnosed remotely.

Which Raspberry Pi model should I use?

There is no model-independent guarantee that a Pi can encode your file at a chosen resolution and bitrate in real time. The answer depends on the board, FFmpeg build, source codecs and whether you are transcoding. Test the actual combination and lower the encoding load if the Pi falls behind.

Does the loop continue if Wi-Fi or power drops?

No. A loop option repeats local media while FFmpeg is running; it does not repair a failed network connection or restore power. A tested service may restart a process after some failures, but you should monitor the stream and plan how you will recover the router, Pi or credentials.

Can I use any video I have saved locally?

No. The file must be readable and technically suitable, and you must have the rights needed to stream it. Check its audio and video streams before testing, and review YouTube’s current policies for the content you plan to broadcast.

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 Setup Guides guides ↗ · All topics ↗