FFmpeg can repeat one VOD with -stream_loop -1 or send an ordered playlist through its concat demuxer, while -c copy keeps the existing compressed streams instead of re-encoding them. Neither approach makes an arbitrary gaming file suitable for YouTube Live: first check the source streams against FFmpeg’s compatibility rules and YouTube’s current ingest settings.
Choose the single-file route when you want one recording repeated, and the playlist route when you need several recordings to play in a deliberate order. If the files do not already fit the required stream layout and ingest profile, stream-copy is the wrong tool for fixing them; you will need to prepare them separately or use a workflow that re-encodes.
Choose one VOD or a playlist
Start with the shape of the broadcast, not with a command copied from a forum. One VOD played repeatedly and a playlist of distinct VODs are different jobs. The single-file case has one source to inspect and no transition between unrelated files. The playlist case adds ordering and compatibility checks for every input and for every boundary between files.
| Question | One VOD | Ordered playlist |
|---|---|---|
| What repeats? | One input file repeats indefinitely | Files play sequentially; the final file does not automatically imply a return to the first unless you arrange a repeated playlist workflow |
| How is order set? | There is only one file | The concat list determines the sequence |
| What must match? | The file must suit the chosen output and YouTube profile | Inputs need matching streams, codecs and time bases for the concat demuxer, as well as suitability for YouTube |
| Main operational risk | A loop boundary can expose timestamp, picture or audio behaviour that a short preview did not show | A mismatched file, inaccurate duration or unequal audio/video lengths can create errors, gaps or boundary artefacts |
If the content is a single long gameplay session, the loop option is simpler. If you are rotating several walkthroughs, tutorials or match recordings, a list gives you explicit order, but inspect all of the files rather than assuming that recordings made by the same game are identical. A game update, capture setting or editing export may have changed a stream property.
FFmpeg can keep a process sending one output continuously, but the command itself is not a full channel operation. You still need a YouTube live session, the correct destination URL and stream key, a stable outbound connection and a way to notice a stalled or unhealthy feed. For other always-on options, see the practical guide to keeping a YouTube radio stream running when your computer is off; the operational concern is continuity, even when the media workflow differs.
Check the source and YouTube ingest profile
Before writing a command, inspect each VOD’s container, video and audio codecs, number of streams, time bases, duration and timestamps. These details tell you whether stream-copy is plausible, whether the concat demuxer can join the files and whether the copied streams match the live profile you intend to use. There is no general rule that a gaming MP4, or any other container, is automatically compatible.
You can use FFprobe, distributed with FFmpeg, to inspect a file. For example:
ffprobe -hide_banner -show_streams -show_format "gameplay-01.mp4"
Read the output rather than treating the filename extension as a diagnosis. Note whether there is one video and one audio stream, whether an extra commentary or subtitle stream is present, and the codec and time base of each stream. Record the same information for every playlist entry. If you do not understand a field, keep the output for troubleshooting instead of guessing which option will fix it.
YouTube’s current encoder guidance lists RTMP/RTMPS as ingest protocols, H.264, HEVC and AV1 as video codecs, AAC or MP3 audio, frame rates up to 60 fps and a recommended keyframe interval of two seconds, not exceeding four seconds. It recommends CBR. Check YouTube’s encoder settings page before a real broadcast, because guidance can change and because the suitable bitrate depends on codec, resolution and frame rate.
For scale, YouTube’s H.264 table currently gives different recommendations for different profiles: 1080p at 60 fps lists a 6 Mbps minimum and 17 Mbps recommended; 1080p at 30 fps lists 5 Mbps minimum and 14 Mbps recommended; 720p at 60 fps lists 3 Mbps minimum and 8 Mbps recommended. These are YouTube’s figures as published in October 2026, not universal targets for every codec or VOD. Match the row to the actual stream and verify the current table rather than selecting a number by resolution alone.
With -c copy, FFmpeg does not change a source codec, bitrate, resolution, frame rate or keyframe cadence. If the VOD does not meet the profile you have chosen, copying it will preserve that mismatch rather than correct it. Decide whether preserving the encoded streams is essential; if it is, use only source material that already fits, and if it is not, prepare an appropriate output before the live session.
Loop one file with stream-copy
The documented pattern for an indefinitely repeated input is to place -stream_loop -1 before the -i option for that input. The output codec option -c copy asks FFmpeg to copy streams rather than decode and encode them. A basic pattern is:
ffmpeg -stream_loop -1 -i "gameplay.mp4" -c copy -f flv "rtmp://YOUR_INGEST_URL/YOUR_PRIVATE_KEY"
This is a pattern to adapt and test, not a guarantee that every MP4 can be copied into an FLV live output or accepted by YouTube. The input option belongs before the input it affects. If you add other inputs, place each input option in the right position and identify clearly which input it applies to. The output format and URL must also match the ingest endpoint you choose.
Do not paste a real stream key into a public command snippet, shell history shared with others, screen recording or support post. Treat it as a password. A safer practice is to put the URL and key into the encoder configuration locally and keep them out of notes and logs that other people can read. YouTube provides the URL and key through Live Control Room; check its live encoder setup instructions for the current workflow.
A looping input is useful when the same VOD is intended to repeat without a visible schedule of separate sessions. It does not add a fade, repair a jump at the end-to-start boundary, or ensure the audio returns cleanly. Listen and watch across that boundary in a test. If you are maintaining a longer-running feed on a modest machine, the guide to setting up OBS for a continuous stream on a low-end PC in India discusses a different operating path; choose tools according to the constraints you actually have.
Build an ordered concat-demuxer playlist
For a set of recordings that should play one after another, the concat demuxer is FFmpeg’s no-re-encode joining route when the files are compatible. Create a plain-text list in the exact playback order, for example vods.txt:
file 'match-one.mp4'
file 'match-two.mp4'
file 'match-three.mp4'
Paths are interpreted from the working directory unless you use full paths. Keep names and paths clear, and avoid ambiguity from spaces or unusual characters by testing the list locally. The concat demuxer has list-file syntax and path handling rules; consult the FFmpeg concat demuxer documentation if your paths need escaping or if you use options not shown here.
A basic output pattern is:
ffmpeg -f concat -safe 0 -i "vods.txt" -c copy -f flv "rtmp://YOUR_INGEST_URL/YOUR_PRIVATE_KEY"
Use -safe 0 only when you need paths that the default safe-path policy rejects, and only when you trust the list contents. It relaxes a path check; it does not improve media compatibility. You can instead keep the list and referenced files in a simple working directory and use relative paths.
The list presents the files as one input in order. It is not a playlist scheduler with a built-in promise to restart at the first entry after the last one. If you need the sequence to repeat indefinitely, test a method that repeats the complete playlist in your chosen FFmpeg workflow, or arrange a controlled restart after the sequence ends. Do not assume that putting -stream_loop in the wrong place will repeat the collection; its scope is an input, and the exact treatment of looping a concat input should be verified in a local test with your FFmpeg build.
The concat demuxer requires matching stream structures, codecs and time bases. A single missing audio stream or a different video codec can invalidate the assumption behind copying. It adjusts timestamps using file durations; if a duration is inaccurate, timing artefacts can result, and if audio and video stream lengths differ, gaps may appear. The relevant point is not that every boundary will fail, but that success depends on the files’ details and should be verified before the audience sees it.
Understand stream-copy compatibility limits
Stream-copy works on compressed packets. It avoids decoding and re-encoding, so it does not introduce a re-encode generation of quality loss or the associated encoding workload. That is useful when the source is already correct and the target container accepts its streams. It is not a repair mode.
| Requirement | What stream-copy can do | What it cannot do |
|---|---|---|
| Preserve existing compressed video and audio | Pass the encoded streams through without re-encoding | Improve their picture or sound quality |
| Meet a YouTube codec requirement | Carry a source stream that already uses a suitable codec | Convert an unsupported codec to H.264, HEVC or AV1 |
| Change bitrate or keyframe interval | Preserve the encoded properties already present | Re-encode to a different bitrate or create new keyframes |
| Join files with concat demuxer | Sequence compatible files with matching stream layouts, codecs and time bases | Reconcile incompatible streams or differing layouts |
| Fit a target container | Mux streams when their properties are supported by that container | Make every source/container pairing valid or add missing container information |
FFmpeg’s stream-copy documentation explains that packets are copied without decoding or encoding and notes the limitations: filtering cannot be applied, and the target container may not be able to represent all source information. In practice, a command can fail at startup, fail at a file boundary, or produce output that starts but is unsuitable for the intended ingest. A zero exit code or a moving preview is not a substitute for checking the live feed.
For concat, check all sources as a set, not just in pairs that happen to play in your local player. Confirm that stream count, codec and time base line up, and compare durations and timestamps. If you have recordings with different audio layouts or a mixture of frame rates or keyframe patterns, stream-copy may preserve them but cannot harmonise them. The choice is then to curate a compatible playlist, prepare the sources, or use a different broadcast method.
The same distinction applies to YouTube requirements. Its recommendations describe an ingest profile, not transformations applied by the platform before it receives your stream. If the VOD’s resolution, codec, rate or keyframe interval is unsuitable for your chosen profile, copying cannot make it conform. Re-encoding is a separate decision: it gives you control over those properties but costs processing and can affect quality, while stream-copy keeps the originals and their limitations.
Test the output and inspect errors
Before connecting a long-running channel, run a local test or a private or unlisted test stream. The aim is to check more than whether FFmpeg accepts the command. Watch the opening, a point near the end, and the loop or concat boundary. Listen for silence, repeated or missing audio, and synchronisation changes. Check that the image is present and that the stream remains stable long enough to expose the behaviour you care about.
Keep FFmpeg’s diagnostic output during the test. Errors that mention timestamps, unsupported codec parameters, invalid data, or a stream disappearing can point to different problems; do not respond by adding random flags. Re-run FFprobe on the relevant files and compare their stream metadata. For concat, check list order, paths, stream count, codec and time base, and whether the durations reported by the files are credible.
A quick local file test can establish whether a concat input opens and whether a copy output can be written, but it cannot prove that YouTube will accept the resulting live ingest. Likewise, a short private stream cannot demonstrate the behaviour of a full overnight run. Use a test that covers the actual source material, selected output profile and destination settings, then monitor stream health when the real session begins.
If audio gradually drifts or disappears at a boundary, inspect source timestamps and stream durations before assuming the encoder is at fault. A source can play properly in a desktop player while still having properties that complicate stream-copy concatenation. The guide on fixing audio going out of sync on a 24/7 lecture stream covers the broader symptom; for this FFmpeg workflow, treat the source files and their timing as part of the diagnosis.
Connect the output to YouTube Live
Once the media has passed the compatibility checks, create or select the YouTube live session and copy its ingest URL and stream key into your encoder configuration. Use RTMPS where appropriate: YouTube recommends it as a secure extension to RTMP. Keep the key private, and avoid publishing it in a command, screenshot or article. If the encoder reports a key error, verify the selected session and key rather than exposing the key to someone who does not need it.
Check the outgoing bitrate against your available upload capacity. YouTube recommends leaving 20% upload bandwidth headroom and testing before the event. This matters for an FFmpeg process on a home connection as much as for a machine in a data centre: a fast download result does not establish that the upload remains stable. If other people or devices share the connection, their traffic can reduce the capacity available to the stream.
During the live session, monitor YouTube’s stream health and the FFmpeg process. A continuous command can stop because of an input, connection or host problem, and a live session can still be active while its feed is unhealthy. Decide in advance how you will notice a failure and who can act on it. For an FFmpeg process that must run on a remote machine, the 24/7 YouTube stream setup from India using Hetzner Cloud gives a separate hosting-oriented route to consider; the right choice depends on your comfort with operating that environment.
If your main requirement is to leave your own computer switched off rather than maintain an FFmpeg process yourself, StreamNeo removes that specific process-management burden by turning an uploaded video into a YouTube live stream. It is a YouTube-only route, not a way to repair incompatible source files: prepare and validate the media first, and keep the same attention on what YouTube receives.
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
Does -stream_loop -1 repeat an MP4 forever?
It tells FFmpeg to repeat that input indefinitely, and it must be placed before the -i for the input it applies to. Whether the resulting copy output works with a chosen container and YouTube ingest still depends on the source streams and a real test.
Can I use -c copy to fix incompatible VODs?
No. Stream-copy preserves encoded streams; it does not convert codecs, change keyframe spacing, filter frames or reconcile mismatched files. Prepare compatible sources or use a workflow that re-encodes when the output profile needs different properties.
Can the concat list repeat the whole playlist automatically?
The concat demuxer presents listed files sequentially as one input; that does not itself guarantee the sequence restarts after the last file. Test the repeat method you choose with your FFmpeg version and confirm the transitions in picture and audio.
Is a successful local FFmpeg test enough for YouTube Live?
No. It shows only that the tested command and files behaved locally in that test. Check the current YouTube encoder guidance, verify the live session and ingest settings, then use a private or unlisted test and monitor stream health.