To loop Indian music videos on YouTube Live with FFmpeg, put their paths in an ffconcat text file, then pass that file as one input with -stream_loop -1 before -i. For video files read as a live source, put -re before the same input as well; neither option makes unlike files transition seamlessly or guarantees a healthy broadcast.
The important work is preparing compatible files and testing the complete sequence. The concat demuxer reads entries one after another, so a playlist that works for a few minutes on a desktop still needs an end-to-end check in YouTube Live Control Room before you rely on it.
Prepare the videos and confirm your rights
Start with a folder of files that you are entitled to use in a livestream. A video you can play, download or use in an ordinary upload is not automatically cleared for continuous live broadcasting. Check the licences and permissions that apply to both the recording and the music, including any restrictions on live use, territory, monetisation or repeated transmission. Playlist ownership, a filename or a successful FFmpeg run is not proof of livestream rights.
This matters for Indian music videos in particular because a single file may contain several rights-bearing parts: a composition, a particular sound recording, a performance, visuals and perhaps material licensed only for limited use. Keep records of permissions and verify uncertain cases with the relevant rights holder. For YouTube’s current rules and account requirements, check YouTube’s live streaming help; platform acceptance is not a substitute for obtaining rights.
Next, inspect every file rather than assuming that videos from the same source have the same technical properties. FFmpeg’s ffprobe can report streams, codecs, dimensions, frame rate, time base and audio layout. For example:
ffprobe -v error -show_streams -show_format "video-01.mp4"
Repeat the inspection for each playlist entry. Note whether a file has both audio and video, whether the audio is stereo or mono, and whether the video uses the same dimensions and frame rate as the others. A video-only entry can leave an intended continuous music stream without audio at that point; extra or differently arranged streams can also complicate stream selection.
Keep filenames simple where practical, and put the playlist and media files somewhere the FFmpeg process can read them. If you run the command from another working directory, relative paths may resolve somewhere unexpected. Before moving on, open each path as the same user and from the same environment that will run FFmpeg. For broader planning around a continuing channel, see this guide to marketing a live stream for creators and businesses.
Create an ffconcat playlist file
The concat demuxer uses a plain text script. Create a file such as playlist.txt with the format marker as its first line, followed by one file directive for each video in the required order:
ffconcat version 1.0
file '/media/music/video-01.mp4'
file '/media/music/video-02.mp4'
file '/media/music/video-03.mp4'
Replace the example paths with real paths on your machine. The first line must be exactly ffconcat version 1.0 if you want FFmpeg to recognise the format automatically: do not put a blank line, comment or byte-order mark before it. Save the file as plain text, not as a word-processing document with formatting.
The order of file directives is the playback order. If you want an opening devotional track before a longer bhajan sequence, put it first; if you want a short closing clip before the playlist repeats, put it last. Test that order by reading through the file and checking each path. A typo or a path that only works from a different directory can stop the input when FFmpeg reaches that entry.
Quotes help with spaces in paths, but the concat script has its own quoting and escaping rules. Keep paths straightforward if you can; for names containing apostrophes or other special characters, consult the FFmpeg concat demuxer documentation rather than assuming shell quoting rules apply inside the file. On Windows, use paths appropriate to the environment where FFmpeg runs and verify them there.
A playlist is a set of references, not a copy of the videos. If you move or rename a source file, update the corresponding entry. Store the list with the media or maintain a clear folder structure so later edits do not silently point to old or missing files. If you expect to change the programme while live, distinguish that from looping a fixed concat input: changing the text file does not itself guarantee that an already running FFmpeg process will reload it. The practical considerations are covered in how playlist updates work during a 24/7 YouTube stream.
Understand how concat reads entries
The concat demuxer presents multiple files as a sequential input. It is not a video editor that independently decodes and converts every clip into a uniform programme. FFmpeg’s documentation says the files need the same streams, including the same codecs and time base. Differences in stream layout or timing can therefore cause errors or visible or audible irregularities when one file ends and the next begins.
Compare the properties of every entry: number and type of streams, codec, time base, dimensions, frame rate, pixel format, audio sample rate and channel layout. Identical filenames or an .mp4 extension do not tell you whether these match. FFmpeg may also rely on duration information to calculate timestamps for the next entry. Its documentation notes that inaccurate durations can produce artefacts; a duration directive can be used when needed, but do not add one without checking the actual media duration and the demuxer’s guidance.
If properties differ, the safer approach for a static playlist is often to convert the files to a common output profile before concatenating them. Choose a target resolution, frame rate, video codec and audio format, then check that each converted file has the same relevant stream structure and timing. This takes time and may involve quality loss from re-encoding, but it moves conversion out of the live run and makes the sequence easier to test. It is still not a promise of a perfectly seamless transition: content cuts, encoder behaviour and timestamp details can remain perceptible.
A filter-based workflow can instead decode and convert each input in a controlled way, but it is a different and more involved command design. Do not assume that adding -stream_loop -1 repairs mismatched codecs or timestamps; that option repeats an input, not normalises it. If the next clip produces a stream mapping error, missing audio or non-monotonic timestamp warning, stop and inspect the files and FFmpeg output. A mailing-list discussion about this kind of issue recommends matching the files’ properties for a static concat workflow; treat that as practical troubleshooting, not a guarantee. See the FFmpeg-user discussion of concat compatibility.
Put looping and real-time pacing before the input
Input options belong before the -i that they affect. In this example, -re and -stream_loop -1 both apply to playlist.txt:
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.txt ...
-stream_loop -1 tells FFmpeg to repeat the input indefinitely. Because the concat script is the input, it repeats the sequence described by the playlist rather than looping only one file. -re reads the file input at its native media rate, which is useful when a file is being used as a live source. These options have distinct jobs: one controls repetition, the other pacing.
Do not move either option after -i and expect it to act on the input that has already been declared. FFmpeg command-line options are interpreted in relation to inputs and outputs; positioning the options clearly makes the command easier to audit. Likewise, if you later add a second input, check which input each option precedes rather than copying the flags without considering their scope.
The -f concat option explicitly selects the concat demuxer. The -safe 0 setting permits paths that the concat demuxer would otherwise reject as unsafe, which can be necessary for absolute paths in a local playlist. Use it only with a playlist and paths you control. It is not a general security setting to apply to arbitrary, untrusted playlist files.
Real-time pacing does not make the input live in the sense of providing fresh content, nor does it keep the broadcast connected if the process or network fails. FFmpeg can still terminate on a missing file, incompatible streams or an output error. For an unattended channel, decide separately who or what notices a failed process and how you will confirm that the stream is back. A fixed playlist that repeats successfully in a local test is only one part of a continuing broadcast plan.
Build the YouTube Live output command
Here is an illustrative starting command. Replace the playlist path, stream key placeholder and encoding choices after testing your files and checking the current YouTube guidance:
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.txt \
-c:v libx264 -preset veryfast -pix_fmt yuv420p \
-b:v 5M -maxrate 5M -bufsize 10M -g 60 \
-c:a aac -b:a 128k -ar 44100 \
-f flv 'rtmp://a.rtmp.youtube.com/live2/REPLACE_WITH_STREAM_KEY'
This is a command skeleton, not a tested universal preset. It encodes the input as H.264 video and AAC audio, then sends an FLV output to YouTube’s RTMP ingest address. YouTube’s live encoder guidance recommends RTMPS where available, and lists supported codecs, bitrate advice and stream settings. Use the ingest address and protocol shown for your own live configuration, and consult YouTube’s encoder settings before going live.
The example’s -g 60 is a GOP size, not a universal keyframe setting. At 30 frames per second it corresponds to a two-second interval; if your output frame rate differs, adjust the value to keep the interval appropriate. YouTube recommends a two-second keyframe interval and says not to exceed four seconds. The example bitrate values are placeholders for a starting profile, not a claim that this bitrate is right for every resolution or connection.
Select resolution, frame rate and video bitrate together. YouTube’s published H.264 ranges include 5–14 Mbps for 1080p at 30 fps, 6–17 Mbps for 1080p at 60 fps, and 3–8 Mbps for 720p at 30 or 60 fps. These are YouTube’s recommendations, not an assurance of viewer experience; as listed in YouTube Help in October 2026, check the current encoder guidance before setting a profile. Your sustained upload capacity must accommodate the chosen stream, and the platform recommends testing that capacity and stream health.
The sample uses 128 kbps AAC audio and 44.1 kHz, matching YouTube’s published stereo recommendations. Confirm that your programme actually has the expected audio and that the selected mapping is correct. In more complex files, use explicit -map options after inspecting the streams, rather than relying on FFmpeg’s automatic choice to select the intended audio and video. Keep the stream key secret: do not publish it in a script, screenshot, log or support request. A shell command can also be saved in shell history, so consider a safer way to supply credentials; this guide to using a YouTube stream key in FFmpeg without exposing it in shell history covers that separate risk.
Check formats and test transitions
Before connecting to YouTube, run a short local test with at least two representative videos. Use the actual playlist and command structure, but direct the output to a test file or preview arrangement that does not expose the live stream key. Watch and listen across the point where the first file ends and the next begins. Look for a gap, repeated frames, a black frame, a sudden change in loudness, an audio drop, or an unexpected aspect ratio. A successful start does not tell you what happens at every later transition.
Then test the loop boundary: let the final playlist item finish and observe the move back to the first item. The concat demuxer’s timestamp handling and the files’ duration metadata affect how that boundary behaves. If you see irregular timing or errors, inspect the FFmpeg output and compare stream information again. Do not treat the absence of a visible problem in a very short preview as evidence that the whole sequence is sound.
Where files are incompatible, normalise them to a shared profile and repeat the same test. Check that the conversion has not removed expected audio, altered orientation or produced black borders through a changed aspect ratio. Normalisation improves consistency but does not make artistic cuts disappear or promise an uninterrupted-looking programme. If the videos are deliberately different formats, such as old phone recordings mixed with newer HD clips, plan for a deliberate format-conversion step rather than hoping the demuxer will reconcile them on the fly.
A second test should use the exact intended YouTube ingest settings and a representative section of the programme. Check the platform’s received resolution, audio and health messages rather than assuming that a local file test proves successful ingest. For context on one common visible failure between clips, see why a YouTube Live stream may show a black screen between clips. Use that kind of symptom as a reason to investigate the source and transition, not as proof of a single cause.
Verify the live broadcast and plan for interruptions
Once the test looks and sounds right locally, start an unlisted or otherwise appropriate test broadcast using YouTube’s current controls. Confirm that the Live Control Room receives a picture and audio, and watch its health messages while representative clips play. YouTube recommends monitoring stream health during an event; check the current official instructions because interface details can change. If you see warnings, address them before treating the configuration as ready for a public, scheduled broadcast.
Keep FFmpeg’s console output available during testing. A process that remains open can still be reporting timestamp problems, stream errors or output trouble. Look for failed stream mapping, missing audio, non-monotonic timestamps, reconnect messages or a process that has exited. Record what you changed between attempts so you can tell whether a fix addressed the cause or merely shifted the failure to a later clip.
If this is a local computer workflow, the computer and connection are part of the broadcast path. A power cut, system sleep, software exit or internet interruption can stop the stream; -stream_loop -1 only describes input repetition while FFmpeg is running. Arrange a way to observe the broadcast and respond to interruptions. If your particular problem is restarting after a power cut, the guide to restarting an OBS stream automatically after a power cut in India discusses the broader recovery question, though its OBS steps are not a replacement for testing this FFmpeg command.
For a non-technical operator who wants the computer switched off after uploading a prepared video, StreamNeo removes the need to leave this local FFmpeg process running: it turns an uploaded video into a YouTube live stream. That solves a specific operational burden, but it does not decide music rights, validate your playlist, or replace checking the live broadcast and its status.
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 loop every video or just one?
When it is placed before the -i playlist.txt input, it repeats that concat input, so FFmpeg reads the listed sequence again. It does not fix incompatible streams or repair errors in an individual file. Test the last-to-first transition as well as transitions between files.
Why does FFmpeg fail when the next video starts?
The next file may be missing, have a different stream layout, codec or time base, or have duration information that causes timestamp trouble. Check the FFmpeg output and compare the files with ffprobe; matching them through a common conversion profile may be appropriate. A matching profile still does not guarantee a seamless transition.
Does -re make the stream reliable overnight?
No. It paces file reading at the media’s native rate; it does not prevent a computer, process, network or YouTube ingest problem. Test the actual broadcast and arrange monitoring and a response plan for interruptions.
Can I stream any Indian music video if it is in my playlist?
No. The playlist only tells FFmpeg which files to read. Check that you have the rights and permissions needed for the intended livestream, and verify YouTube’s current rules; technical playback is not evidence of permission.