Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can run a prerecorded children’s video as a continuous YouTube Live stream by looping it through FFmpeg inside a Docker container. Docker can restart an exited container, and FFmpeg can retry some output failures, but neither guarantees a live, healthy stream: you still need to check YouTube’s preview and stream health, monitor the host and media, and plan for failures and archive management.

What you need before you start

  • A YouTube channel that is verified and has had no live-stream restrictions in the previous 90 days.
  • A host with Docker installed, enough disk space for your media, and a stable internet connection with sufficient upload capacity.
  • A video you have the right to stream. A children’s audience does not change copyright requirements.
  • An FFmpeg build that supports the codecs and FIFO recovery options used below. The example builds FFmpeg into a Debian-based Docker image; test it with your actual media before relying on it.

There is no universal best resolution or bitrate. YouTube’s encoder guidance supports H.264, H.265/HEVC, and AV1 video, frame rates up to 60 fps, AAC or MP3 audio, constant bitrate encoding, and a two-second keyframe interval (not over four seconds). The example below uses H.264 at 1080p30. YouTube lists 5 Mbps as the minimum and 14 Mbps as the recommended video bitrate for 1080p30 H.264; these are YouTube’s figures, not a guarantee that your connection or chosen encoder will sustain the stream.

Configure the YouTube Live event and protect its key

  1. In YouTube Studio, open Live Control Room and create or select the event for your stream.
  2. Copy the server URL and stream key shown for that event. Use the URL provided in Live Control Room rather than assuming a server address.
  3. Store the complete output address, including the key, in a private environment file as shown below. Treat the key like a password: anyone with it may be able to send video to your channel. Do not put it in a public repository, screenshots, or shared logs. If it is exposed, reset it in Live Control Room and update the value on your host.
  4. Start the encoder before you go live. Check the Live Control Room preview and stream health, then use the event’s controls to start the broadcast when it is ready.

Build a Docker image with FFmpeg

Make a working directory with this layout. Put a licensed, tested video named loop.mp4 in media. The example repeats that one file; preparing a single continuous compilation is the simplest way to avoid gaps or incompatible transitions between clips.

stream/  Dockerfile  compose.yaml  .env  media/loop.mp4

Create Dockerfile:

FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg ca-certificates && rm -rf /var/lib/apt/lists/*
CMD ["sh", "-c", "exec ffmpeg -hide_banner -nostdin -re -stream_loop -1 -i /media/loop.mp4 -map 0:v:0 -map 0:a? -c:v libx264 -preset veryfast -pix_fmt yuv420p -r 30 -g 60 -keyint_min 60 -sc_threshold 0 -b:v 5M -maxrate 5M -bufsize 10M -c:a aac -b:a 128k -ar 44100 -f fifo -fifo_format flv -attempt_recovery 1 -recovery_wait_time 1 "$YT_OUTPUT_URL""]

This command reads the file at real-time speed, loops it, encodes H.264 video and AAC audio, and sends an FLV stream through FFmpeg’s FIFO muxer. At 30 fps, a 60-frame GOP sets a two-second keyframe interval. The video target is 5 Mbps, YouTube’s stated minimum for 1080p30 H.264, not its recommended 14 Mbps setting. If the source has no audio, the optional audio map allows the command to proceed without an audio track. If it has audio, confirm the resulting mix is audible and suitable for the full stream.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
KAMRUI Essenx E2 Mini PC, AMD Ryzen 5 3500U(4 Cores, 8 Threads, Up to 3.7GHz), 16GB DDR4(Expandable) 256GB M.2 SSD Micro PC, HDMI+DP Dual 4K@60Hz Display Home/Business/Office Mini Desktop Computers
  • 【Ryzen 5 3500U Processor】KAMRUI Essenx E2 Mini PC is equipped with AMD Ryzen 5 3500U (4-cores/8-threads, up to 3.7GHz) with integrated Radeon Vega 8 Graphics(1200MHz, 8 Core). The 3500U CPU operates at a base frequency of 2.1 GHz and a Boost frequency of 3.7 GHz. This DDR supports upgradable up to 32GB, SSD supports up to 2TB.(NOT INCLUED), KAMRUI E2 3500U Mini PC is ideal for light office work and home entertainment. KAMRUI E2 3500U is more than 35% more powerful and smoother in operation than the Intel N150, 33% faster than Intel N95, 28% performance boost over Intel i3-10110U, and 42% stronger processing power than AMD Ryzen 3 3200U.
  • 【16GB DDR4 & 256GB SSD】The KAMRUI E2 mini computers is equipped with 16GB DDR4(Expandable up to 32GB) for faster multitasking and smooth application switching. 256GB M.2 SSD ensures fast startup times,fast file transfers and plenty of storage space,eliminating slow loading times and ensuring fast responsiveness.Storage space can RAM supports up to 32 GB, SSD supports up to 2TB (Not included)make file storage easier.
  • 【4K Dual Display & USB 3.2 Type-A Port】KAMRUI E2 3500U mini desktop pc is equipped with an HDMI 2.0+DP 1.4 interfaces for faster transmission, Support Dual 4K@60Hz Display, E2 mini desktop computers is ideal for visual home entertainment, home office, conference rooms, etc. USB3.2 Gen1 Type-A Port×2 with a transfer speed of up to 5Gbps (10 times faster than USB 2.0) for efficient data transfer. The RJ45 1000M Gigabit Ethernet Port ensures a stable network connection.
  • 【WiFi+Bluetooth stable connection】The Kamrui E2 micro pc have reliable and stable wireless connection, open websites in seconds, watch movies without buffering and download files smoothly, connect your monitor from WiFi or Ethernet, use a wireless keyboard and mouse through bluetooth, which will be powerful workstation for you.
  • 【Versatile Ports】This KAMRUI E2 Small pc is equipped with HDMI 2.0×1(4K@60Hz)、DP1.4×1(4K@60Hz)、Gigabit Ethernet Port (RJ45, 10/100/1000Mbps) ×1、USB3.2 Gen1 Type-A Port×2(5Gbps)、USB2.0 Type-A Port×2、3.5mm Audio Jack ×1、DC In ×1、Power Button ×1

Create .env with the actual server URL and stream key joined as YouTube specifies:

YT_OUTPUT_URL=PASTE_YOUTUBE_SERVER_URL_AND_STREAM_KEY_HERE

Replace the right-hand value; do not publish this file. Restrict access to the working directory and exclude .env from version control. The command passes the value to FFmpeg, so avoid sharing process output or diagnostics that could reveal it.

Create compose.yaml:

services:
  stream:
    build: .
    restart: unless-stopped
    init: true
    env_file:
      - .env
    volumes:
      - ./media:/media:ro

Build and start the container from the working directory:

Rank #2
Getorli Mini PC AMD Ryzen 5 3500U (4C/8T, Max 3.7GHz) Small Desktop Computer 16GB DDR4 RAM 512GB NVMe SSD Budget Micro Compact PCs 4K HD Dual HDMI WiFi 6 BT5.3 Prebuilt OS-Home Office Gaming Streaming
  • 【Great power in a small computer】Get fast performance from the AMD Ryzen 5 3500U ​CPU (2.1GHz-3.7GHz, 4 Cores 8 Threads) inside this mini pc, TDP 15W up to 25W. It's perfect for all your home office​ and business use, like daily computing, web browsing, and smooth media streaming. This small desktop computer​ handles everyday tasks easily and quietly.
  • 【Work on many things at once with lots of storage】This mini PC comes with 16GB of fast DDR4 RAM (expandable up to 32GB), allowing you to smoothly run multiple programs, dozens of browser tabs, and large files all at once. It also features a spacious 512GB NVMe SSD that provides ample storage and delivers dramatically faster boot-ups, app launches, and file transfers compared to a traditional hard drive.
  • 【See everything clearly on one or two 4K screens】Connect one or two monitors for more space to work or play. Dual HDMI ports​ on this mini pc​ support super sharp 4K Ultra HD​ video. It's great for doubling your work area for business​ or watching movies in high definition.
  • 【Fast modern connections in a tiny box】Enjoy a better and more stable internet connection with the latest WiFi 6. Use Bluetooth 5.3​ to connect wireless headphones, keyboards, and mice without wires. This small pc​ is very compact​ to save desk space and has extra USB ports (USB 2.0×2, USB 3.0×2, Type-c 2.0×1, Type-c 3.2 full featured×1, HDMI×2) for your printer, webcam, or other computer accessories.
  • 【Reliable Warranty and Support】We provides 1 year warranty for each Mini computers. So you don't need to worry about any product problems. If you have any questions about the product, please contact our customer service, we will provide 24-hour professional technical support and serve you at any time.
docker compose build
docker compose up -d

Check that the container is running and inspect its recent output:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
docker compose ps
docker compose logs --tail=100 stream

FFmpeg should report that it is writing output without recurring connection or encoding errors. Confirm separately that YouTube receives the stream and that its preview shows moving video and audible sound. A running container or advancing FFmpeg log is not proof that viewers can see a healthy stream.

Choose settings for your source and connection

Resolution, frame rate, and codec

Use a profile your source and encoder can produce reliably and your upload connection can carry continuously. YouTube publishes bitrate ranges by codec, resolution, and frame rate; choose the row for the profile you actually send. H.264 is the example here, but H.265/HEVC or AV1 may be options when YouTube supports the selected ingest profile and your FFmpeg build and hardware can encode them effectively. Do not switch codecs just because they are listed: verify the full encode-and-ingest path first.

Rank #3
Sale
BOSGAME E5 11 Pro Mini PC, AMD Ryzen 5300U 4C/ 8T, Business Home Office PC
  • 【AMD Ryzen 3 5300U CPU: Outperforms N150 & 3500U】 BOSGAME E5 mini PC is powered by the TSMC 7nm FinFET architecture AMD Ryzen 3 5300U processor (4 Cores, 8 Threads, up to 3.8GHz boost, 6MB total cache). Compared to low-end Intel N150 or 3500U chips which only have 4 single threads and throttle under load, the 5300U delivers over 30% faster multi-core speed. Run 30+ browser tabs, large Excel sheets, and Zoom meetings simultaneously without system lag.
  • 【8GB DDR4 RAM & 256GB NVMe SSD Storage】 Installed with high-speed 8GB DDR4 dual-channel memory and a fast 256GB M.2 2280 SSD, eliminating slow boot times and application loading delays. To accommodate growing data requirements, the upgradeable hardware design features dual SODIMM slots that allow you to expand memory up to 64GB RAM, ensuring smooth operation during heavy multitasking.
  • 【High-Capacity Dual M.2 SSD Storage Expansion】 Never worry about running out of space for your business files. In addition to the pre-installed 256GB system drive, the motherboard houses an extra empty internal M.2 2280 NVMe PCIe 3.0 slot. This allows you to easily add a second solid-state drive for up to an additional 2TB of storage capacity (upgrades not included) without needing to remove or reinstall the original operating system.
  • 【Radeon 6-Core Graphics & Triple 4K Displays】 Integrated with official AMD Radeon Graphics (6 Graphics Cores, 1500 MHz frequency) for casual gaming, photo editing, and crisp 4K media decoding. Featuring 1x HDMI 2.0 port, 1x DisplayPort, and 1x Full-Function Type-C port, the E5 outputs true 4K@60Hz resolution to three monitors at once. This multi-screen setup eliminates constant window-switching for traders, programmers, and office workers.
  • 【Dual 2.5GbE LAN Ports for Advanced Networking】 Experience fast wired network transmission speeds up to 2500Mbps without lagging or buffering. The integration of dual 2.5 Gigabit Ethernet ports (powered by Realtek RTL8125 controller) makes this compact computer an exceptional hardware choice for tech enthusiasts. Easily configure it into software routers, hardware firewalls (pfSense, OpnSense), home NAS servers, or local homelabs.

The example sets 30 fps and a two-second keyframe interval. For a different frame rate, adjust the GOP length to keep keyframes about two seconds apart and never more than four seconds apart. A 60 fps output, for example, would use about 120 frames per two seconds. If you change resolution or frame rate, select the corresponding YouTube bitrate range instead of reusing the example’s 5 Mbps value.

Upload capacity and headroom

YouTube advises keeping total stream bitrate within available upload capacity and leaving 20% room. Include audio and any other live streams using the connection; if you plan a backup stream, account for it too. Test upload, not just download, capacity under conditions similar to normal use. An upload speed that only barely exceeds the encoded bitrate leaves little margin for variation. A wired Ethernet connection or a UPS battery backup may be practical aids at a fixed installation, but they are optional setup choices, not guarantees against outages.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Looping a playlist instead of one video

For the lowest-complexity setup, edit and encode clips into one continuous file before deployment. If you use an FFmpeg concat playlist instead, confirm the files have compatible streams and timestamps, then test the exact looping input command and resulting output with your installed FFmpeg build. A playlist that works once is not automatically safe to repeat indefinitely; transitions, damaged files, differing codecs, and discontinuities can interrupt or degrade the feed.

Rank #4
Sale
GMKtec M5 Ultra Gaming Mini PC Ryzen 7 7730U 16GB RAM 256GB SSD Computer
  • Office Gaming Mini PC - UPGRADED GMKtec Nucbox M5 Ultra Series is equipped with the powerful AMD Ryzen 7 7730U processor, 8 Cores/16 Threads, Base 2.00GHz (Power Saving Quiet Mode) with Turbo Boost up to 4.50GHz (Performance Mode) in BIOS settings, Based on the ZEN 3+ architecture, this small but powerful mini pc delivers satisfying results in productivity, office work, and gaming. 35% Performance increase over AMD Ryzen 5 7430U/ Ryzen 7 5700U, 5600U, 5560U, 5500U.
  • 16GB DDR4 RAM & 256GB PCIe SSD - Installed with DDR4 16GB RAM (1x16GB), the Nucbox M5 Ultra mini pc support expansion to 64GB RAM. Featured with 256GB M.2 2280 PCIe 3.0 SSD, support dual slot expansion to 4TB SSD. (Upgrades not included)
  • DUAL NIC LAN 2.5G RJ45 - Fast Network Speeds: Enjoy up to 2500Mbps data transmission speed without worrying about lagging. Ideal for working, gaming, and surfing the internet. Great for Untangle, Pfsense or as a server office PC.
  • Mini Desktop Computer with 4K Triple Screen Display - Nucbox M5 Ultra integrates AMD Radeon Graphics 8 Cores 2000 MHz GPU to deliver powerful graphics processing power to easily handle the demands of complex design software, 4K@60Hz UHD video editing, and playback. It can connect to 3 display screens simultaneously.
  • Fast Internet WiFi 6E + BT5.2 Connection - GMKtec Mini PC with WiFi-6E Wireless, have 2.5G/5G/6G triple band, more faster and lower latency. Bluetooth 5.2 allowing you more quickly to connect other wireless devices (headset, mouse, keyboard, etc.) Interface features 2*USB3.2 ports, 2*USB2.0 ports, 1*HDMI 2.0 port(4K@60Hz), 1*USB-C port(PD/DP/DATA), 1*DP Port, 1*Audio 3.5mm (HP&MIC), 1*DC Power Port.

Understand restart and recovery behavior

Docker restart policy

The Compose file uses unless-stopped: Docker can restart the container after it exits and after a daemon restart, but a container you manually stopped remains stopped after the daemon restarts. Use always instead if your intended behavior is to restart it even after a manual stop when Docker restarts. Docker’s restart-policy monitoring takes effect only after successful startup; its documentation defines that as the container running for at least 10 seconds.

A restart policy reacts to a container stopping. It is not a health check and cannot tell whether FFmpeg is stuck on a frozen frame, the source has ended or become silent, the key is invalid, or YouTube has stopped ingesting the feed.

FFmpeg output recovery

The -f fifo, -fifo_format flv, -attempt_recovery 1, and -recovery_wait_time 1 options enable FFmpeg’s FIFO muxer recovery behavior for some temporary output failures. They do not prevent every disconnect, guarantee a gapless stream, or recover every input, credential, server, or host failure. FFmpeg’s network-input reconnection options address certain input failures; they are separate from recovering output to YouTube.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
GMKtec Mini PC, G3 PRO Intel Core i3-10110U (Beats 4300U/N150), 16GB DDR4 RAM (Dual Channel) 512GB Storage Drive, Desktop Computer 4K Dual HDMI/USB3.2/WiFi 6/BT5.2/2.5GbE for Office, Business
  • WHY CHOOSE CORE I3-10110U - Better single-core performance: The Core i3-10110U has a higher peak boost clock (4.1 GHz) compared to the Ryzen 3 4300U and the Intel Alder Lake N150 series, making it better for tasks that rely on fast single-core performance (e.g., web browsing, office apps). Better multi-thread performance via Hyper-Threading: the Core i3-10110U offers better performance in multi-threaded workloads compared to the Ryzen 3 4300U, especially for light productivity work and multitasking.
  • 16GB RAM MEMORY & 512GB SSD STORAGE - GMKtec Nucbox G3 PRO mini pc is prebuilt with 16GB DDR4 RAM SO-DIMM DUAL CHANNEL, you will enjoy a speedier experience with Built-in 512GB M.2 Hard Drive. Our mini desktop pc boots up in seconds, work on multiple browser tabs, software applications and quickly transfers files. There is a primary slot and secondary expansion storage. Primary slot is M.2 2280 PCIE/SATA and secondary slot is M.2 2242 SATA .
  • RICH INTERFACE - Nucbox core i3 mini computer is equipped with USB 3.2*4,up to 5Gbps/S, HDMI(4K@60Hz)×2, 3.5mm Audio Jack. Supports WiFi 6, and Gigabit Ethernet RJ45 2.5GbE network connectivity, Bluetooth 5.2. This Mini PC supports multiple device connection and can be used with servers, monitoring equipment, office equipment, displays, projectors, televisions, etc.
  • 4K DUAL SCREEN DISPLAY - Mini desktop computer is equipped with upgraded Intel Graphics(max 1000MHz), supports 4K video playback and AV1 decoding, connect the pc with a projector as a home theatre, enjoy a variety of entertainments. Two HDMI 2.0 ports allows you to multi-task efficiently on two 4K@60Hz displays.
  • UPGRADED COOLING FAN - The G3 PLUS has upgraded the cooling fan to reduce fan noise and thermals. We are using an upgraded thermal paste as well to help reduce heat on the CPU.

Confirm that the installed FFmpeg build includes the relevant muxer and options, and test how it behaves when your network is interrupted. If FFmpeg exits after an unrecoverable failure, Docker may restart the container, but an operator should still verify that it reconnects and that YouTube accepts the new feed.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Plan for a genuinely continuous service

Test the entire path before launch

  • Start the container well before the planned broadcast and verify the video, audio, preview, and YouTube stream-health indicators.
  • Observe host resources, container state, and FFmpeg logs. Check that frames continue to advance and sound is present rather than relying on a “running” status alone.
  • Test a primary failure and your recovery procedure. YouTube recommends testing backup failover, including by stopping the primary encoder or interrupting its network connection; use a separately configured backup encoder only if you can test and operate it safely.
  • Verify the event on its watch page and on a mobile device. If you also record locally, check that the recording grows as expected and can be played back.
  • Document who responds to an alert, how to inspect the event and host, when to restart the container, and when to switch to a tested backup or escalate.

Separate a continuous feed from its archives

Do not assume that one endlessly open live event will produce a complete replay. YouTube says streams under 12 hours are automatically archived. For a 24/7 operation, plan intentional shorter events and restarts, decide how to handle resulting archives, and verify current behavior in Studio before deployment. Event segmentation also gives you defined points to inspect the encoder and recover from problems, but it requires an operator plan for transitions.

Set the audience accurately

Decide whether the stream is made for kids based on its content and audience, and set YouTube’s audience designation accurately. For a stream designated made for kids, YouTube restricts or disables features including live chat and live chat donations, comments, the notification bell, personalized advertising, cards and end screens, and Super Chat or Super Stickers. Contextual ads may still appear. Do not make the operating plan depend on unavailable chat interaction or forecast revenue from personalized advertising. Platform feature settings alone do not establish an operator’s legal obligations; those depend on the locations, data practices, content, and applicable law.

Troubleshoot common failures

Symptom Likely cause What to check or do
Container exits and stays down FFmpeg failed, the input path is wrong, or the host could not start the container. Check docker compose logs --tail=100 stream and docker compose ps. Confirm media/loop.mp4 exists and is readable, rebuild if the image changed, and verify the restart policy and Docker daemon state.
Container is running, but YouTube has no healthy preview Invalid server URL or key, unsupported output, or an ingest/network failure. Inspect FFmpeg output and the Live Control Room. Confirm the current event’s URL and key, the output codec/profile, and network connectivity. Reset an exposed key and update the secret locally.
Video freezes or repeats one frame while the container stays up Stalled input, decode trouble, exhausted or damaged media, or a process that is alive but no longer advancing frames. Check the source file and FFmpeg progress, test the media through a full loop, and alert on stalled media rather than only on container exit. Restart only after identifying whether the source or output path is still failing.
Audio is missing, silent, or out of sync The source lacks an audio stream, has an unexpected audio layout, or fails during encoding. Inspect the source streams and FFmpeg logs, listen to the preview, and test the encoded output. Confirm that the source audio is suitable to repeat for the full event.
Frequent disconnects or unstable stream health Upload capacity is insufficient or variable, the network is disrupted, or another stream is consuming bandwidth. Measure upload capacity during expected operating conditions, include total stream bitrate and the recommended 20% headroom, and use a more reliable connection or a lower supported output profile.
Broadcast stops despite recovery options The failure exceeded what the FIFO retry path can recover, the process exited, or YouTube rejected the feed. Check both FFmpeg and Live Control Room status. Follow the documented restart or backup-encoder procedure, then verify the preview and stream health before considering the incident resolved.

Or let it run in the cloud

If you would rather not maintain a Docker host for an always-on feed, StreamNeo is a YouTube-only cloud service for looping uploaded videos: upload a recording, add your YouTube stream key, and go live. Nothing has to stay on at home. Every slot streams the uploaded quality up to 4K 60fps at one flat price per slot, with automatic recovery if YouTube drops the stream. The first day is free with no card. Monthly billing is $9.99 per month. You remain responsible for having the rights to your video and setting the YouTube audience correctly. Start your free day on StreamNeo.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Conclusion

A Docker-and-FFmpeg setup can keep a prerecorded feed running and recover from some process and network failures, but 24/7 operation depends on monitoring and a tested response plan as much as on the command line. Test the complete YouTube path, monitor media progress and ingest health, and design event and archive handling before treating the stream as unattended.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.