Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteTo loop prerecorded videos continuously into YouTube Live, put their paths in an FFmpeg concat playlist and use -stream_loop -1 before the playlist input. A representative stream-copy command is shown below. It is a starting pattern, not a tested recipe: the files must have compatible streams, codecs, and time bases, and your Hetzner server must sustain the required upload bandwidth.
How do I loop an FFmpeg concat playlist forever?
Create a text file named playlist.ffconcat with the version marker on the first line, followed by one file directive per video in playback order:
ffconcat version 1.0
file 'clip-01.mp4'
file 'clip-02.mp4'
file 'clip-03.mp4'
The marker must be exact and at the start of the file for automatic format recognition. The command below explicitly selects the concat demuxer, so it does not depend on automatic recognition.
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.ffconcat
-c copy -f flv 'rtmps://<youtube-ingest-endpoint>/<stream-key>'
-stream_loop -1 tells FFmpeg to loop the input indefinitely. It is an input option, so place it before the -i for the playlist it applies to. -re reads the input at its native rate rather than sending the files as fast as possible. -c copy passes the streams through without re-encoding, while -f flv selects the output container used in this command pattern. Replace the endpoint and key placeholders with the values from your YouTube Live event.
#1 Best Overall
Playlist paths and safety
Each file directive names a media file. Paths with spaces or special characters need appropriate quoting or escaping in the concat file. The example uses -safe 0, which permits paths that FFmpeg’s default safety rules may reject. Use it only when you trust the playlist and every path it references; do not use an untrusted playlist.
The concat demuxer also supports directives such as duration to override stored duration metadata. Incorrect duration metadata can lead to timestamp artifacts, so check the source files if transitions do not occur at the expected times. See the FFmpeg concat demuxer documentation and FFmpeg documentation.
Will stream copy work with my videos?
Only if the files are compatible. FFmpeg states that concat-demuxer inputs must have the same streams, codecs, and time bases. The demuxer adjusts timestamps so each file begins after the preceding one, but streams with durations that do not line up can create gaps. -c copy avoids re-encoding; it does not convert mismatched sources or make incompatible files compatible.
Rank #2
Check before starting the stream
- Confirm the files have the same stream layout, codecs, and time bases.
- Check that the audio and video durations align and that duration metadata is credible.
- If the sources differ, normalize them into compatible files before using this stream-copy command. Alternatively, use a suitable re-encoding or filtering workflow; that requires selecting settings and accounting for the server’s CPU capacity.
Test the full playlist with representative motion and audio before relying on it for a public broadcast. A playlist that starts successfully can still have problems at later file boundaries.
How do I connect FFmpeg to YouTube Live?
- In YouTube Studio, open the Live Control Room and create or select the live event.
- Copy the event’s stream URL and stream key from its live settings. YouTube treats the key like a password: keep it private, and do not expose it in a public script, repository, or log.
- Use the exact ingest URL and key in your FFmpeg output configuration. YouTube recommends RTMPS to encrypt the encoder-to-YouTube connection. See YouTube’s live stream settings guidance and RTMPS instructions.
- Start with a private or unlisted event, inspect YouTube’s preview and stream-health information, and verify picture and sound before making the event public.
For a real deployment, avoid embedding the key in a command that may be visible to other users or captured by process monitoring. Store it with access controls appropriate to your server and keep it out of shared logs.
Which encoder settings should I use?
The example uses stream copy, so it does not set a new resolution, frame rate, or bitrate. Those properties come from the input files. Verify that they fit the current YouTube guidance for the codec, resolution, and frame rate you intend to send. YouTube’s current encoder guidance covers RTMP/RTMPS, H.264, H.265/HEVC, and AV1 video; AAC or MP3 audio; CBR; frame rates up to 60 fps; and a recommended two-second keyframe interval, not exceeding four seconds.
Rank #3
YouTube publishes bitrate recommendations by codec, resolution, and frame rate; there is no single bitrate that applies to every stream. Check the relevant row in its live encoder settings, bitrates, and resolutions guidance. If you re-encode, configure the encoder to match that guidance rather than assuming the example’s stream-copy options enforce it.
Can I run FFmpeg nonstop on a Hetzner server?
Possibly, but the command alone does not make a broadcast reliable. The selected server must read the media consistently and sustain the stream’s outbound traffic. YouTube recommends keeping 20% upload-bandwidth headroom above the stream bitrate and notes that total streaming bitrate cannot exceed available upload bandwidth. Check actual sustained outbound capacity for the server’s location and workload; a plan’s headline network speed does not by itself establish suitability. Current Hetzner plan specifications, regional availability, egress policies, and costs should be checked directly for your use case.
Recommended Free Tools
Plan for process and stream failures
- Run FFmpeg under a process supervisor or service manager that can restart it after an unexpected exit.
- Alert on FFmpeg exits, YouTube encoder disconnects, low disk space, and YouTube stream-health warnings.
- Test the restart and reconnection behavior before depending on it. A restarted encoder may still need attention in the Live Control Room.
- Keep source files and the playlist accessible to the service account, and monitor available disk space if you store or update media on the server.
These are operational safeguards, not a claim that any specific Hetzner configuration or supervisor setup has been tested here. For YouTube’s bandwidth advice, see Streaming tips.
Rank #4
What happens to the YouTube archive?
YouTube says streams under 12 hours are automatically archived. Do not assume an uninterrupted archive for a stream that runs longer than 12 hours. If you need a recording, plan separately for event duration and archive requirements. See YouTube’s encoder live-stream setup guidance.
Or let it run in the cloud
If you would rather not maintain an FFmpeg process on a Hetzner server, StreamNeo is a cloud service for keeping a YouTube channel live from uploaded videos. Upload a recording or build a playlist, add your YouTube stream key once, and go live. Nothing has to stay on at home; it streams uploaded video, not a live camera feed.
- Any quality up to 4K 60fps streams as uploaded at one flat price per slot, with no re-encode or quality tiers.
- It runs in the cloud and automatically recovers if YouTube drops the stream.
- The first day is free with no card. One free day is available per account.
- Monthly: $9.99 per month.
Start your free StreamNeo day.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting the FFmpeg-to-YouTube stream
FFmpeg rejects the playlist or cannot open a file
Check that ffconcat version 1.0 is the first line, each directive begins with file, and every path is valid from the process’s working directory. Fix quoting or escaping for special characters. Use -safe 0 only for a playlist whose paths you trust.
Playback breaks or artifacts appear at a file boundary
Inspect the files’ stream layout, codecs, time bases, and duration metadata. The concat demuxer expects compatible streams; mismatched durations can create gaps, and incorrect duration metadata can cause artifacts. Normalize the files before attempting stream copy.
YouTube does not receive the stream
Verify that you copied the correct event’s ingest URL and key, that the key has not been changed or exposed, and that the server can make the outbound connection. Check FFmpeg’s error output and YouTube’s preview and stream-health status. Use RTMPS with the exact URL shown for the event.
The stream disconnects or YouTube reports poor health
Compare the stream’s actual bitrate with sustained outbound capacity and preserve YouTube’s recommended 20% headroom. Check for server network interruptions and configure monitoring and restart supervision. If bandwidth is insufficient, reduce the stream bitrate through an appropriate re-encoding workflow or choose a workload and host configuration that can sustain it.
The broadcast stops after an FFmpeg failure
A single FFmpeg process exits when it encounters an unrecoverable error; loop mode only repeats the input while that process is running. Use a supervisor with restart behavior and alerting, then test how FFmpeg and YouTube behave after a forced process interruption.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Copyright and YouTube policy checks
Before streaming prerecorded material, make sure you have the rights and permissions needed to broadcast every video and audio track. A continuous or repeated stream is not exempt from copyright enforcement or YouTube’s rules. Check YouTube’s current policies and any restrictions shown in the Live Control Room before making the stream public; the technical setup does not establish that content is authorized.
Quick Recap
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.

