Skip to content
streamneo.
Troubleshooting11 min read

How to Stop FFmpeg from Repeating the First Video in a YouTube Playlist

Diagnose whether yt-dlp or FFmpeg is selecting playlist entries, then verify URLs, inputs and output order.

sn.
StreamNeoPublished 7 October 2026
Worth sharing?

If FFmpeg appears to repeat the first video in a YouTube playlist, first check which program is selecting the videos. FFmpeg processes the inputs you give it; yt-dlp is the tool in this workflow that can enumerate playlist entries and select them by position.

For a full playlist, the usual reliable approach is to let yt-dlp select and download the entries, then use FFmpeg to merge or process the resulting files if needed. If your pipeline already has individual media URLs or files, you can instead pass FFmpeg a deliberate sequence of inputs. A watch URL that includes playlist context is not necessarily the same thing as a playlist URL.

Identify which program is repeating the item

Start with the exact command that produced the repeated video. Write it down as run, including line breaks and options. Does it invoke ffmpeg, yt-dlp, or both? In a combined workflow, note the hand-off: which URL does yt-dlp receive, what files does it produce, and which of those files are passed to FFmpeg?

The distinction matters because the symptom can look the same even when the cause differs. If yt-dlp produces one file when you expected several, examine the URL and yt-dlp’s playlist-selection options. If it produces several distinct files but FFmpeg’s result contains one item repeatedly, inspect the inputs and processing steps given to FFmpeg. The sources do not establish one universal cause for an unknown command, so avoid changing loop settings before you know which stage is at fault.

Check the installed yt-dlp version with yt-dlp --version and record the operating system. Extractor behaviour and available options can change; the version helps make a later reproduction useful. If you need to ask for help, include the command, a representative URL with private tokens removed, the version, operating system and relevant verbose output. The guide to converting phone-recorded videos for a YouTube playlist stream covers a related practical distinction: preparing the media files is separate from deciding which items a playlist workflow selects.

A quick diagnostic is to list or download a small, explicit range of playlist items with yt-dlp and inspect the resulting titles or IDs before involving FFmpeg. If that range produces distinct entries, yt-dlp is enumerating the playlist as expected for that run. If it yields only one item, the URL or selection options deserve attention first.

Check whether the URL is a video or a playlist

YouTube URLs can carry more than one kind of context. A watch URL identifies a particular video; it may also include a playlist parameter indicating the playlist in which that video appears. That does not mean every tool receiving the URL will interpret it as an instruction to fetch the whole playlist.

If you want only the video identified by a watch URL, yt-dlp documents --no-playlist for the case where a URL refers to both a video and a playlist. For example:

yt-dlp --no-playlist 'https://www.youtube.com/watch?v=VIDEO_ID&list=PLAYLIST_ID'

Treat the example IDs as placeholders. Use the actual URL you have, and quote it in a shell so that characters such as & are not interpreted as shell syntax. If the goal is to process the full playlist, use the playlist URL and check that the command does not contain an option restricting selection to one item or a short range.

Do not diagnose this by simply removing every parameter from the URL. First decide what you intend to process. A watch URL with playlist context can be appropriate for a single-video job, while a playlist URL is the clearer input for a full-list job. The workflow for scheduling morning and evening playlists on a 24/7 Hindi music stream is a useful related example of planning a sequence, but it does not change how a downloader interprets a URL.

For a full playlist, inspect the URL’s shape and the command’s selection options together. If you have pasted a video watch URL rather than the playlist URL, replace it with the playlist URL before testing. If the playlist URL is already present, look for --no-playlist, --playlist-items, or other selection controls that might deliberately narrow the run. Keep a copy of the original command so you can compare one change at a time.

Understand what FFmpeg does with inputs

FFmpeg’s command-line model is based on inputs and outputs supplied to it. The -i option introduces an input; the command’s options and the order of those inputs determine what FFmpeg processes. A YouTube playlist URL does not by itself make FFmpeg enumerate the playlist’s video entries. FFmpeg is not a YouTube playlist downloader in this workflow.

If you run FFmpeg directly, check every -i argument. Are they distinct files or URLs, and are they in the order you intended? One input repeated in the command, a generated list containing the same path several times, or a hand-off that always points to the first downloaded file can all produce a repeated-looking result. Those are possibilities to inspect, not conclusions that can be drawn without seeing the command.

FFmpeg options generally apply to the next input or output, and input/output options are reset between files. This makes ordering significant. Read the whole command from left to right and confirm which options belong to which input and which output. The official FFmpeg command-line documentation describes input handling and option placement. It is more useful here than guessing that a generic loop option will fix selection: looping an input and selecting playlist entries are different operations.

If FFmpeg receives one local file, it can process that file, but it cannot infer from the file alone which other YouTube playlist entries you meant to include. If an upstream tool supplies a list, verify that it supplies a list of distinct files and not a single item repeated. If your pipeline relies on a demuxer or a list file, verify its format and contents against the relevant FFmpeg documentation rather than assuming a YouTube URL is such a list.

Let yt-dlp enumerate playlist entries

For a YouTube playlist, a robust workflow is to pass the playlist URL to yt-dlp and let it handle playlist and item selection. Once the entries are downloaded, FFmpeg can merge formats or process individual files where the task requires it. The yt-dlp project documentation documents playlist options, output templates and related behaviour.

For diagnosis, start small. Select a few positions explicitly with --playlist-items, then check that the output represents different videos. For example:

yt-dlp --playlist-items 1-3 \
  -o '%(playlist_index)s - %(title)s.%(ext)s' \
  'https://www.youtube.com/playlist?list=PLAYLIST_ID'

The range in this example is for a test, not a claim about the size of your playlist. Replace the placeholder with your playlist URL. Review the output names, and, where useful, the yt-dlp log, to confirm distinct titles or IDs. If the first three positions are distinct, remove the diagnostic restriction when you are ready to process the full playlist. If they are not, preserve the command and output so you can investigate the URL and selection settings.

Check for an unintended --playlist-items value. That option selects positions, so a setting that names only the first position will do exactly that; it is not a random repeat. A small range can help establish whether the issue is selection or later processing, but do not leave the test range in a production command unless you intend to process only those positions.

If you use separate audio and video formats, yt-dlp can handle its download workflow, and FFmpeg may be needed for merging depending on the formats and setup. Keep selection and post-processing conceptually separate: first confirm which playlist entries yt-dlp has selected, then investigate any merge or conversion issue. This separation makes it easier to locate the stage at which the result changes.

Use individual inputs when calling FFmpeg directly

Direct FFmpeg inputs make sense when another part of your workflow already supplies individual files or media URLs and you control their order. In that case, make each intended video a distinct input, or use a deliberate list mechanism that produces the intended sequence. Do not pass a playlist URL and expect FFmpeg to expand it into one input per YouTube entry.

For a simple set of local files, a command may look like this:

ffmpeg -i '01-opening.mp4' -i '02-prayer.mp4' -i '03-closing.mp4' \
  -map 0:v -map 0:a 'combined-output.mp4'

This illustrates three separate inputs, not a universal method for joining arbitrary videos. The mapping shown selects streams from the first input, so it is not by itself a recipe for concatenating all three files. For concatenation, choose the appropriate FFmpeg method for your files and intended output, and verify its requirements in the official documentation. The key diagnostic point is that each item you intend FFmpeg to use must be represented in the input sequence or in the list mechanism you deliberately use.

Keep a plain-text record of the ordered file list before building the FFmpeg command. Compare that list with the -i arguments and the output. If the command is generated by a script, log the resolved paths rather than only the template used to create them. A template can appear correct while a variable or working directory causes every entry to resolve to the same file.

Workflow Who selects playlist entries What to inspect first Best fit
yt-dlp followed by FFmpeg yt-dlp URL, playlist options, downloaded titles or IDs You start with a YouTube playlist and want to process multiple entries
Individual FFmpeg inputs Your script, list or caller Each -i value, its order and any list contents Another part of your pipeline already supplies distinct files or URLs

Neither route guarantees a fix for every command. Choose based on where the list already exists and which program should be responsible for selection. If you are building a playlist from recorded clips, the article on rotating new-home walkthroughs in a YouTube live playlist is relevant to the separate question of arranging content for a stream.

Verify selection, filenames and output order

Before processing a large playlist, make a small run and confirm which entries were selected. Use an explicit --playlist-items range for the test, and inspect titles or IDs rather than relying only on the number of files. Two files can have similar names, and one file may be missing because a download failed; filenames and identifiers together provide a clearer check.

A filename template that records playlist position makes omissions and duplicates easier to spot. yt-dlp documents output-template fields, including playlist index and title. For example:

yt-dlp -o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' \
  'https://www.youtube.com/playlist?list=PLAYLIST_ID'

Use a valid output path for your system and account for characters that are unsuitable in filenames. The index helps retain visible playlist order; the title makes the files easier to recognise. It does not prove that FFmpeg later used the files in that order, so compare the downloaded list with the processing command as a separate step.

If a later run downloads videos you already have, yt-dlp’s --download-archive can record successful downloads and skip those videos in future runs. The yt-dlp FAQ explains archive behaviour. This is useful for repeat runs, but it does not change which item a wrongly constructed single input selects repeatedly within one run. Do not use an archive as a fix for the first-item symptom unless the actual problem is re-downloading on a later run.

When the result is still wrong, compare three things: the entries selected by yt-dlp, the files present on disk, and the ordered inputs handed to FFmpeg. Note the first point at which a distinct entry is missing or duplicated. This gives you a concrete failure stage to investigate rather than a broad claim that “the playlist repeats”. Keep verbose output from a short reproduction, remove private tokens from URLs before sharing it, and include the installed yt-dlp version.

For a channel that depends on a stable sequence overnight, test the output before scheduling the stream. The guide to fixing repeated buffering in a 24/7 ambient YouTube live stream deals with a different failure mode, but the practical lesson is similar: distinguish a content-selection problem from what happens after the stream begins.

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

Why does FFmpeg repeat the first video in my YouTube playlist?

FFmpeg does not automatically enumerate YouTube playlist entries from a playlist URL. Check whether yt-dlp selected only the first entry, or whether FFmpeg received the same file or input more than once. The exact cause depends on your command and URL.

How do I download the whole playlist rather than one video?

Give yt-dlp the playlist URL and check that options such as --no-playlist or a narrow --playlist-items selection are not limiting the run. Test a short range first and verify that the titles or IDs are distinct. Then remove the diagnostic range when you want the full playlist.

What does --no-playlist do on a watch URL?

When a URL refers to both a particular video and a playlist, yt-dlp documents --no-playlist to select the video alone. It is useful when you want that one video, not when you intend to process every playlist entry. For a full-list job, use the playlist URL and check your selection options.

Will --download-archive stop the first item repeating?

It helps yt-dlp skip videos successfully downloaded in earlier runs, using an archive of identifiers. It does not correct a single input that keeps selecting the first item during the current run. Diagnose URL selection and the actual inputs first.

YOU’VE REACHED THE END

Keep the ideas coming.

More guides, useful tools and a little help for your next broadcast.

Back to the journal ↗
YOUR NEXT READ

A little more to explore.

More Troubleshooting guides ↗ · All topics ↗