To repeat a product demo playlist on YouTube Live, put the files in an FFconcat list, pass that list to FFmpeg with -stream_loop -1, and use -re to read the media at its normal rate. That makes the playlist repeat as an input; it does not guarantee a gap-free picture or sound at every clip boundary.
The concat demuxer joins files by adjusting their timestamps, so clean transitions depend on compatible streams, codecs, time bases and reliable duration information. Prepare and test the exact files and output settings you intend to use, including the transition from the last clip back to the first.
Prepare compatible demo files
Start by inspecting every clip, not just the first one. A product demo set often accumulates footage exported at different times or from different editing tools. One file may have stereo audio while another has no audio; frame rates, dimensions, codecs and stream layouts can also differ. The concat demuxer expects corresponding streams to match, including codec and time base, and differences can produce timestamp trouble at transitions.
For a static playlist, the most predictable route is usually to make a working set with a shared media profile before you assemble it. Choose the target picture size and frame rate for your channel, then standardise the clips' video codec, pixel format, audio codec, sample rate and channel layout as appropriate. If a clip has no audio but the rest do, decide whether to add a silent audio track or handle that mismatch through a deliberate conversion workflow; do not assume FFmpeg will make the tracks line up invisibly.
There are two broad approaches. If files are already compatible, you can try concatenating them without re-encoding the inputs, reducing conversion work. If they differ, pre-converting them to a common profile adds time and processing but gives you more control over stream layout and can make faults easier to isolate. Neither approach proves that transitions are seamless. Inspect the resulting file or test the live output before relying on it overnight.
Do not confuse matching headline properties with identical media. Two clips can both be labelled 1080p while differing in time base, variable versus constant frame cadence, audio stream layout or duration metadata. The concat demuxer uses each file's duration to set timestamps for the next one. Its documentation warns that inaccurate durations and unequal stream lengths may lead to artifacts or gaps. See the FFmpeg concat demuxer documentation for the constraints and caveats.
Keep an untouched copy of the original demos and build a separate playlist set. That gives you a straightforward way to replace one suspect clip without losing the source material. If the channel's presentation depends on the logo or framing remaining in the same place, check aspect ratio and letterboxing during conversion too; the guidance on setting the correct aspect ratio for an animated stream is relevant to that part of the preparation.
Create the FFconcat playlist
Create a plain-text file named playlist.txt, with one file directive for each clip in playback order. For example:
file 'demo-a.mp4'
file 'demo-b.mp4'
file 'demo-c.mp4'
Put the playlist and media in one directory and use relative names when practical. Then run FFmpeg from that directory. This is easier to review and avoids unnecessary complications with paths. The list is not a shell script: do not add shell commands, explanatory prose or untrusted text to it.
The concat demuxer applies safety checks to paths by default. In the command below, -safe 0 permits paths that the default safe mode would reject, such as some absolute paths. Use it only when you understand the path implications and control the playlist contents. For a playlist you prepared yourself using simple relative file names, try the safer default first and remove -safe 0 from the example. Never point FFmpeg at a playlist someone else supplied without reviewing it.
Check filenames carefully. A missing file, a typo, or an unexpected relative working directory will stop the input from opening. If you add or rename a clip, update the list and repeat the transition checks. The playlist order is also your running order: put a short slate or closing card where you want it, rather than expecting the demuxer to invent a transition between separate product segments.
The concat demuxer presents the listed files as a virtual input; it is not a video editor. It does not blend frames, crossfade sound or repair broken media. If a transition must include a branded dissolve or a spoken hand-off, render that transition into the source files or assemble a continuous master in an editor. A list of independent files is useful for orderly replay, not for creating creative transitions.
Set up FFmpeg to loop the playlist
The essential input options are -re and -stream_loop -1, placed before the input they govern. With the concat demuxer, the input is the playlist text file:
ffmpeg -re -stream_loop -1 -f concat -i playlist.txt \
-c:v libx264 -pix_fmt yuv420p \
-c:a aac \
-f flv 'rtmps://YOUR_YOUTUBE_INGEST/YOUR_STREAM_KEY'
This is a starting shape, not a tested command or universal encoding prescription. Replace the endpoint and key with the values YouTube Studio supplies, and add output settings that match the stream you configured. If you choose to use non-default path handling for the playlist, place -safe 0 before -i, as in -f concat -safe 0 -i playlist.txt.
-stream_loop -1 asks FFmpeg to repeat the input indefinitely. Here that input is the concat playlist, so reaching the final listed file returns playback to the first item. -re paces file reading in real time instead of reading the media as quickly as the machine can process it. The FFmpeg command-line documentation explains input handling and option placement at ffmpeg.org.
Do not put these input options after -i playlist.txt and expect them to affect that input. FFmpeg options are order-sensitive: options apply to the next input or output, depending on where they appear. If you add a second input, such as a separate audio source, confirm which input each option applies to.
A looped input does not keep a live event available on its own. The FFmpeg process must continue running, the connection must remain usable, and the ingest must remain healthy. A process exit, host restart or network interruption can break the broadcast even though the playlist itself is configured to repeat. For a local workstation workflow, account for the machine's sleep and restart behaviour; this guide to restarting OBS after a Windows update covers a related operational risk, though it does not configure FFmpeg.
Use real-time input and configure output
The output portion of the command controls what YouTube receives. Choose a video codec, resolution, frame rate, audio format, bitrate and keyframe interval that match YouTube's current encoder guidance and the settings selected for your live event. These decisions depend on the stream's resolution and frame rate; there is no single bitrate that fits every demo playlist.
The illustrative command below includes example values only to show where settings belong. They are not a recommendation for your channel, a benchmark, or a guarantee that your FFmpeg build and files will perform as expected:
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.txt \
-c:v libx264 -preset veryfast -pix_fmt yuv420p \
-r 30 -g 60 -keyint_min 60 -sc_threshold 0 \
-b:v 5000k -maxrate 5000k -bufsize 10000k \
-c:a aac -b:a 128k -ar 44100 -ac 2 \
-f flv 'rtmps://YOUR_YOUTUBE_INGEST/YOUR_STREAM_KEY'
The numbers in that illustration are placeholders for a worked command, not values to copy blindly. As listed on YouTube Help in September 2026, its recommended ingest settings vary by codec, resolution and frame rate; its guidance covers supported video and audio codecs, CBR, keyframes and bitrate. YouTube recommends RTMPS, and gives a two-second keyframe interval recommendation with a maximum interval of four seconds. Consult the current YouTube encoder settings, bitrates and resolutions page before setting your output.
You can either stream-copy compatible pre-encoded media or transcode the output. Stream-copying avoids a video encode, but does not give you the same control over output properties and is only appropriate when the source streams already meet the requirements. Transcoding makes it possible to set a consistent output profile, but requires enough compute capacity and can introduce its own configuration or performance problems. Test with the actual machine or workflow that will run the channel.
If your stream is intended for 1080p at 60 frames per second, compare the output parameters with the channel's ingest settings rather than borrowing values from another setup. The YouTube Live settings guide for 1080p 60fps provides a relevant reference point, but YouTube's current recommendations and your selected event settings take precedence. Confirm the FFmpeg build supports the chosen encoder and output protocol; available options can vary by build.
For a long-running channel, think through who or what will notice if FFmpeg exits. A terminal window that stays open is not the same as process monitoring, and a repeating playlist is not a restart policy. If you need the demo to keep playing without leaving your own computer switched on, StreamNeo can remove the work of running the playback process on that computer: upload the video, provide the YouTube stream key, and the broadcast runs from the cloud with automatic monitoring and restart if it drops. It is a YouTube-only service, so it is not a fit if your destination is another platform or if you need FFmpeg access to customise a multi-input production.
Send the stream to YouTube Live
In YouTube Studio, create or select an encoder-based live stream. Copy the stream URL and stream key shown for that event into the FFmpeg output URL, replacing the placeholders. YouTube's guide to creating a live stream with an encoder explains the setup. Treat the stream key as a password: avoid posting it in a public script, screenshot, support forum or shared document.
Before going public, start with a short private or unlisted test if that suits your channel. Wait for the preview, check that YouTube reports a healthy ingest, and listen as well as watch. A command can start without an obvious local error and still deliver a stream with unexpected picture sizing, silent audio or boundary glitches. Follow the stream-health messages in Studio and check the actual viewer-facing result.
A continuous event also has implications for archiving. As listed on YouTube Help in September 2026, YouTube's automatic archive guidance applies to streams under 12 hours. Do not assume a stream running for 12 hours or longer will have the same archive outcome; check the current official guidance and plan a separate recording if you need a copy.
If the stream is intended to run on a spare PC, include power use, heat, connectivity and restart recovery in the decision, not only the FFmpeg command. The cost of using a spare gaming PC for 24/7 streaming in India discusses that operating trade-off. A direct local setup can make sense when you want hands-on control and already have a machine that can run it; a managed workflow can make sense when the computer being left on is itself the pain point.
Test transitions and diagnose gaps
Test each clip boundary, not just a few minutes from the middle of the playlist. Watch the final seconds of one clip and the opening seconds of the next, then watch the last-to-first wraparound after the loop. Check for a frozen frame, black flash, sudden audio cut, overlap, silence, drift between sound and picture, or a brief timestamp error in the output. Repeat the check after replacing media or changing encoding settings.
If a transition fails, isolate it. First play the two adjacent files individually and confirm their streams, duration and playback are sound. Then make a short playlist containing only those two files and run it to a local output file, rather than involving the network and YouTube at the same time. If the local join is bad, compare the streams and duration metadata, then pre-normalise or re-encode the pair to a common profile and test again.
A common diagnostic mistake is to treat a listed duration as proof that timestamps line up. The concat demuxer uses durations when it advances the timeline. If the container metadata is inaccurate, or audio and video tracks within files do not end in a compatible way, the next clip may begin at a timestamp that leaves a visible or audible discontinuity. The FFmpeg documentation describes these duration and unequal-stream-length cautions; the playlist option cannot correct them automatically.
If the local file plays cleanly but the YouTube preview drops or stalls, inspect the output configuration and live connection separately. Confirm that the selected protocol, codecs, frame rate, bitrate and keyframes fit the current YouTube guidance, and check the stream-health notices in Studio. A network interruption or an encoder process failure is a different fault from a bad clip boundary; looping cannot fix either. Keep a record of the tested source versions and command so you know what changed when a later edit behaves differently.
A useful comparison when deciding how much preparation to do:
| Approach | When it can suit | Main trade-off to inspect |
|---|---|---|
| Direct concat with compatible files | The playlist already has matching streams and timestamps behave in testing | Less conversion work, but limited control over differences between sources |
| Pre-normalise the clips | The sources have mismatched properties or a boundary is unreliable | More preparation and encoding work, but a more consistent input set to test |
| Build one rendered master | You need designed transitions or exact control over a programme timeline | Simpler playback input, but changing one segment may mean rendering the master again |
The table is a workflow comparison, not a claim that one path will always eliminate gaps. If you need to demonstrate the result to a colleague, record a short test that includes every transition and the wraparound, then review both audio and video. A quiet break can be easier to miss in a visual-only check.
When the files and channel are ready, compare the operating options on the pricing page. When the file and channel are ready, start free — 24-hour trial, no card.
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 make the transitions gap-free?
No. It repeats the input indefinitely, but it does not repair incompatible streams, incorrect durations, bad timestamps, damaged media or network interruptions. You need to test the actual boundaries in your playlist and output setup.
Why put -re before -i playlist.txt?
-re is an input option that paces file reading at the media's native rate. Put it before the input it should affect; here, that input is the concat playlist. It is not a setting that improves the clips' transitions.
Can I use files with different codecs or audio layouts?
The concat demuxer expects corresponding streams, codecs and time bases to match. If your clips differ, pre-normalise them to a common profile or create a rendered master, then test the result rather than assuming FFmpeg will reconcile the differences.
Will YouTube keep an archive of an all-day stream?
YouTube Help's archive guidance covers streams under 12 hours, as listed in September 2026. Do not rely on the same automatic archive outcome for a continuous event that reaches or exceeds that duration; check current guidance and make a separate recording if the archive matters.