To rotate local videos on a YouTube livestream from Windows, create an ordered FFmpeg concat playlist, then play it in real time with repeat enabled and send it to YouTube’s ingest URL. You will need the stream URL and stream key from YouTube Live Control Room, and the files must be compatible enough to join cleanly; this method does not work with every media file or guarantee seamless transitions.
The practical work is less about one command than about checking the files before the broadcast. Different stream layouts, codecs, time bases or inaccurate duration metadata can create visible or audible faults, so test the rotation before relying on it overnight.
Prepare and order your local video files
Make a dedicated folder for the material you intend to rotate, for example C:/livestream/, and keep the playlist text file there or in a separate working folder. Use filenames that make the intended sequence obvious, such as clip01.mp4, clip02.mp4 and clip03.mp4. Do not assume that Windows Explorer’s display order will determine broadcast order: the playlist itself is authoritative.
Decide whether your rotation is a short loop of repeated pieces, a longer sequence of programmes, or a schedule-like block with a deliberate opening and closing. A devotional channel might place an invocation before a set of bhajans, while a study channel might order a short welcome, lesson recordings and a revision segment. The playlist will repeat the same sequence; it does not provide calendar scheduling or different dayparts by itself.
Use stable, simple paths. Forward slashes in playlist paths are convenient on Windows because they avoid backslash escaping in the text format. Check for spaces, apostrophes and unusual characters in filenames. They can be handled, but simple names are easier to inspect when a list fails to load.
Keep a copy of the original source files and edit the playlist separately. If you later normalize or transcode a file to make its streams consistent, write the output to a new file rather than overwriting the only copy. That gives you a clear way to compare the original and prepared versions if an audio track or picture appears different.
This is a local-file workflow: Windows must remain awake, FFmpeg must keep running, and the computer’s network connection must be usable for the broadcast. For a broader view of looping rules and what happens when the same programme repeats, see whether YouTube allows looping the same video in a live stream. The question of platform policy is separate from whether a particular set of files concatenates correctly.
Check stream compatibility, codecs and durations
Before writing the final list, inspect every file with FFmpeg’s ffprobe or another media inspector. Compare the number and type of streams, video and audio codecs, frame dimensions, frame rate or time base, sample rate, channel layout and reported duration. The concat demuxer expects listed files to have the same streams, codecs and time base. Matching only the .mp4 extension is not enough: two MP4 files can carry different codecs, track layouts or timing characteristics.
A source may contain video and stereo audio while another contains video only, multiple audio tracks or a different channel layout. Even if both play normally on the desktop, their packet streams may not fit together as a single virtual input. Differences can produce a failed command, a frozen picture, a brief silence or a discontinuity at the join. A playlist that starts successfully is not proof that every later transition is sound.
Duration is another important check. The concat demuxer uses file durations to position the next segment. If a file is truncated or has inaccurate duration metadata, the next file can begin at the wrong point, creating gaps, overlaps or artifacts. When the metadata looks suspicious, inspect playback near the end of that source and compare the reported duration with its actual content. The concat script format supports a duration directive for an override, but use one only when you have a reliable duration to enter.
There are two broad ways to handle differences. If the files are already compatible, the concat demuxer can present them in sequence without re-encoding. If they differ, prepare consistent versions first or use FFmpeg’s concat filter with re-encoding. The filter is more adaptable, but encoding adds computer load and requires you to choose output settings. The FFmpeg concat documentation describes the demuxer requirements; the FFmpeg filter documentation covers the filter approach.
| Approach | When it fits | Main trade-off |
|---|---|---|
| Concat demuxer | Files have matching stream layouts, codecs and time bases | Avoids re-encoding, but is sensitive to source mismatches and duration metadata |
| Concat filter | Files need to be brought into a common output through re-encoding | More control over normalization, but encoding uses computer resources and needs testing |
If you cannot establish compatibility, do not treat a copy-based recipe as a cure. Prepare uniform outputs or test a filter-based workflow with representative files, including the transitions most likely to differ. For guidance on keeping a continuous audio feed as well as picture, the audio checks for a 24/7 YouTube stream are useful alongside this file inspection.
Create the FFmpeg concat playlist
Create a plain-text file called playlist.txt and add one file line per video in the exact playback order. For example:
file 'C:/livestream/clip01.mp4'
file 'C:/livestream/clip02.mp4'
file 'C:/livestream/clip03.mp4'
Save it as plain text, not a rich-text document. Verify that the file extension is actually .txt; Windows may hide known extensions, which can leave a filename such as playlist.txt.txt without making it obvious in Explorer. Open the saved file in Notepad and confirm the ordering and paths before running FFmpeg.
The sample paths are absolute, which makes the example easy to understand regardless of the current working directory. The concat demuxer’s safe-path setting defaults to 1 and can reject paths it considers unsafe. The command later in this article uses -safe 0 to allow the absolute Windows paths shown here. That option relaxes the path restrictions, so use it only with a playlist you created and trust; do not feed it a list of untrusted entries. See FFmpeg’s documentation on the concat demuxer’s safe option.
Keep playlist lines plain and predictable. If you change the order, save the file before restarting FFmpeg. Editing the list while a running process is already reading it should not be treated as a dependable way to alter the live sequence. For a larger rotation, one file per line is easier to audit than a dense command or a list assembled by hand at the Windows prompt.
A playlist defines a sequence, not a crossfade. The next file follows the preceding one at its boundary; whether the change appears clean depends on media timing and compatibility. If you need fades, transitions, overlays or a different sequence at particular times, a bare concat list is not a complete programme-editing workflow.
Configure YouTube Live Control Room details
In YouTube Studio, open Create and choose Go Live. In the Live Control Room, create or select the stream and note the server URL and stream key shown for the encoder. YouTube’s official encoder setup instructions explain where those details are obtained and entered. The stream key is a credential: treat it like a password, do not include it in screenshots or public logs, and replace it if it is exposed.
For a scheduled broadcast, set its title, visibility and other details through the scheduling flow, then check the correct scheduled event is selected. FFmpeg can send the feed, but it does not choose the audience-facing metadata for you. Keep the stream’s destination and the event you intend to use aligned, especially if you manage more than one channel or scheduled event.
The ingest URL and key are supplied by YouTube, so do not copy a destination from an old guide and assume it is current for your stream. You will combine the server URL and key as the output destination required by the encoder setup. Keep any working command private because it may contain the key in plain text.
When FFmpeg begins sending, check the Live Control Room preview and status before making the stream public. For a scheduled stream, YouTube’s workflow requires you to click Go live after the preview appears; sending encoder data alone is not the same as starting that scheduled broadcast. The YouTube live encoder settings documentation is the place to verify current recommendations for the resolution and frame rate you choose. This article does not set a universal bitrate or resolution because appropriate values depend on the output and current platform guidance.
Run FFmpeg in real time with repeat playback
Open Command Prompt or PowerShell, change to the folder containing FFmpeg or make sure ffmpeg is available in your PATH, and use a starting command such as this for files whose streams have been checked. Replace the destination placeholder with the URL and key from Live Control Room; never publish a real key.
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i "C:/livestream/playlist.txt" -c:v libx264 -preset veryfast -c:a aac -f flv "rtmp://YOUR_INGEST_URL/YOUR_STREAM_KEY"
This is an illustrative starting pattern, not a tested universal preset. It re-encodes video as H.264 and audio as AAC, so it can accommodate a broader range of source encodings than a stream-copy output, but it does not remove the need to check stream layouts, durations, encoding capacity and YouTube’s current settings guidance. If a source lacks an audio stream, for example, the command’s audio handling may need adjustment rather than blind reuse.
The placement of options matters. -re tells FFmpeg to read the prerecorded input at its native rate instead of sending the files as fast as the computer can read them. -stream_loop -1 repeats the input indefinitely. These are input options, so they appear before the relevant -i. The concat demuxer is selected with -f concat, and -safe 0 is used here for the trusted absolute paths described earlier.
The output options choose encoding and the FLV container used for this RTMP-style example. The libx264 and AAC choices are examples, not a claim that every machine can encode every resolution in real time. Watch FFmpeg’s output and the YouTube preview during a trial run. If the picture or sound cannot be encoded at the intended pace, you may need to reduce the workload, choose suitable settings, or prepare the files in advance.
Do not add arbitrary bitrate values from an old command snippet. Check YouTube’s current encoder guidance for your selected output dimensions and frame rate, and configure accordingly. For a separate discussion of bitrate considerations, use the FFmpeg CBR settings guide for YouTube Live, then confirm current requirements with YouTube rather than treating any example as universal.
RTMP is the simpler path reflected in this example. HLS is a separate ingestion option for supported cases such as certain HDR or codec requirements; it has segment and playlist requirements and YouTube notes higher latency than RTMP. Do not mix HLS-specific segment settings into this basic RTMP command. Choose HLS only when your encoder and broadcast requirement call for it, and follow YouTube’s own current HLS documentation.
If leaving a Windows desktop running is the main burden, a hosted approach may remove the need to keep this particular computer on: StreamNeo takes an uploaded video and runs it as a YouTube live stream after you provide the channel’s stream key. That does not change the need to check rights, content, and the YouTube setup for your channel, and it is not a substitute for this local FFmpeg workflow when you need its control over a playlist on your own machine.
Verify audio, video and transitions
Run the complete playlist privately or in an otherwise suitable test setup before depending on it for a long broadcast. Check the first seconds, the end of every file, and the start of the following file. For a three-file list, watch all three joins rather than only the opening. A transition can be the only place where a channel’s picture freezes, audio track disappears or sound level changes abruptly.
Listen on more than one playback device if practical. A low or missing track may be hard to notice on a laptop speaker but obvious on headphones or a connected display. Confirm that speech, music or ambience continues as intended and that an unexpected alternate audio track is not being sent. Check for clipping or abrupt changes in level at joins; do not assume that consistent file formats imply consistent mixing.
Watch the Control Room preview as well as the local FFmpeg window. Confirm that YouTube receives the expected picture and sound, and that the preview status is healthy before starting a scheduled public broadcast. Make a note of the time of any fault and which file boundary it follows. That makes troubleshooting more useful than repeatedly changing several command options at once.
If you are operating a long-form channel such as kirtan, the OBS guide to streaming kirtan 24/7 offers a different Windows-friendly production context. OBS and FFmpeg are not interchangeable in every respect: choose based on whether you need a local encoder workflow, scene controls, or simply a stable repeating file sequence.
YouTube states that streams under 12 hours are automatically archived, but do not rely on that statement for longer broadcasts. Check the current Help page for archive behaviour and plan separately if you need a recording of a long-running programme. A live rotation is not itself an archival plan.
Diagnose gaps and playback artifacts
Start diagnosis at the boundary where the fault occurs. If every transition into one particular file causes a pause or audio change, inspect that source’s stream layout, timestamps, duration and codec against its neighbours. If the fault appears at every boundary, the playlist’s compatibility assumption or the overall encoding path is a stronger place to investigate.
A black frame or frozen picture can result from inconsistent video streams or timing; missing audio can follow a change in audio stream layout or the source having no audio track. A short silence or jump may also reflect duration metadata that places the next segment incorrectly. Use a media inspector to compare the problem file with a known-good one, then prepare a compatible replacement or test a filter-based re-encode. Avoid hiding a real discrepancy by adding guessed durations without checking the media.
If the command fails before the stream starts, check the playlist filename, quotation marks, path spelling and FFmpeg’s ability to read each file. Confirm that the playlist is plain text and that the -safe 0 option is present if you are using the absolute paths shown. Keep the stream key out of error reports you share; a command line can expose it even when the rest of the log looks harmless.
If FFmpeg reads files but cannot keep up with real-time output, the example’s re-encoding workload may be too high for the computer and selected settings. Test a short run while watching the process output and the Control Room preview. You can prepare normalized files before the broadcast, adjust the output to match YouTube’s current guidance, or use a machine capable of the required encoding load. Do not infer that successful playback in a desktop media player proves real-time encoding will hold.
A dropped connection is distinct from a bad concat join. Check the local network and FFmpeg’s connection messages, then confirm whether YouTube still receives data. If you are running over a home connection in India and want to investigate broadband-specific interruptions, see keeping an FFmpeg YouTube stream running on Airtel Broadband. That is a separate network issue, not a fix for incompatible files.
Keep the troubleshooting loop disciplined: change one thing, repeat the same test segment and note the result. Reordering files may move the fault rather than solve it; replacing a suspect source with a normalized version can reveal whether compatibility is the cause. Only after the joins and the live preview have been checked should you leave a local encoder unattended, and even then this workflow depends on the computer, process and connection continuing to run.
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 FFmpeg automatically play the playlist again after the last file?
With the concat input looped using -stream_loop -1, FFmpeg repeats the playlist input indefinitely. -re paces prerecorded media at its native rate, which is appropriate for a live feed rather than sending the whole sequence as fast as it can be read. The files still need compatible streams and accurate timing for joins to behave well.
Can I use videos with different codecs or audio tracks?
Not safely by assuming the concat demuxer will reconcile them. It expects the same streams, codecs and time base in the listed files; substantially different inputs should be normalized or joined through a filter and re-encoded. Test the prepared output at the actual transitions before using it for a long broadcast.
Do I need a YouTube stream key for this command?
Yes. The encoder output destination uses the server URL and stream key supplied for the selected stream in YouTube Live Control Room. Keep the key private, since it can appear in a saved command or screenshot.
Will the broadcast go live as soon as FFmpeg starts?
FFmpeg can begin sending encoder data, but a scheduled broadcast may still require you to click Go live in Live Control Room after its preview appears. Check the stream status there rather than treating a running command as proof that viewers can see the broadcast. YouTube says streams under 12 hours are automatically archived; do not assume that applies to longer streams.