Skip to content
streamneo.
Setup Guides12 min read

How to Rotate YouTube Livestream Playlists by Weekday in FFmpeg

Build seven FFconcat playlists, select one by local weekday, and connect FFmpeg to YouTube Live with checks for paths, ingest and recovery.

sn.
StreamNeoPublished 4 October 2026
Worth sharing?

To play a different sequence of local videos on each weekday, prepare seven FFconcat playlist files and use a wrapper or operating-system scheduler to choose one before FFmpeg starts. YouTube schedules the live event; it does not select your local files by weekday.

The division is simple: the playlist determines what FFmpeg reads, a small piece of scheduling logic determines which playlist to pass in, and YouTube receives the resulting live feed. The details that tend to cause trouble are the working directory, media compatibility, timezone and stream key.

Keep YouTube’s event separate from FFmpeg playout

In YouTube Studio’s Live Control Room, create or schedule the event viewers will visit. Scheduling can make an event page available and let viewers set reminders. Separately, your encoder connects to YouTube and supplies the audio and video. The event does not inspect your computer or decide which file should play on Monday.

For a weekday rotation, selection belongs outside the concat demuxer. The demuxer reads the list provided to it and plays those files in sequence. A wrapper script can check the date and set a playlist variable before launching FFmpeg; an operating-system scheduler can instead start the appropriate command at a chosen time. FFmpeg’s documented workflow does not provide an automatic weekday schedule on its own.

This separation is useful when you need to troubleshoot. If the wrong day’s programme appears, inspect the weekday calculation and selected playlist. If the intended files play locally but YouTube shows no feed, check the encoder connection, event and ingest settings. YouTube’s encoder workflow describes entering the server URL and stream key in the encoder and following the Live Control Room steps.

Decide whether the event is continuous or a set of scheduled broadcasts before automating. A continuous stream and a daily event schedule have different operational expectations: viewers may see a gap or a new event when a process is stopped and restarted. Confirm in Live Control Room how the selected event should be started and whether a preview or manual Go live step is required. Do not assume a successful FFmpeg process alone makes the event public.

If you are still choosing a playback approach, the walkthrough on streaming pre-recorded video with Be.Live is a useful contrast: a managed interface can be easier if you do not want to maintain a local FFmpeg wrapper. The trade-off is less direct control over a custom local weekday-selection script.

Prepare seven weekday playlists

Create one text playlist per weekday, with an unambiguous naming scheme such as monday.ffconcat through sunday.ffconcat. Each file should represent the editorial sequence you want for that day, not merely a single video, unless a single video is the whole programme. A devotional channel might put a morning bhajan set first and evening aarti later; a study channel might use separate lesson blocks.

The first line of each file must be exactly ffconcat version 1.0. Then add one file directive for each media item, in playback order. For example:

ffconcat version 1.0
file 'media/monday-01.mp4'
file 'media/monday-02.mp4'

Make the seven lists explicit, even if some reuse the same files. This makes it easier to see what is intended to play on a given day and to make a change without accidentally altering every day’s rotation. Keep a simple note alongside the playlists recording the purpose of each sequence and the date you last checked its paths; this is an operational aid, not a substitute for testing.

FFconcat is a plain-text manifest, not a media conversion step. The FFmpeg concat demuxer documentation explains the header and file directive, and describes the demuxer as reading files one after another as if their packets had been joined. It also sets compatibility expectations for the streams. If a playlist combines files with different video dimensions, codecs, audio layouts or timing characteristics, do not assume they will join cleanly.

Inspect the media that will appear together in each day’s list. When layouts and codec characteristics do not match, make normalized copies with a deliberate transcode workflow, or use a filter/transcode approach that handles the differences. That can require more processing and introduces another output to maintain, but it is safer than expecting stream-copy concatenation to reconcile incompatible inputs. For a practical full-day preparation checklist, see preparing a full day of CCTV-free video for YouTube Live in India; the same discipline of checking a complete programme applies even when your content is not CCTV-related.

Check paths and concat formatting

A path in a playlist is interpreted in relation to FFmpeg’s working context, so test the command from the same directory and account that will run it unattended. A relative entry such as media/monday-01.mp4 is convenient when the script always changes into a known programme directory first. Absolute paths make that dependency less visible, but can become invalid if media is moved or mounted elsewhere.

Paths containing apostrophes or unusual characters need careful escaping in the FFconcat syntax. The simplest maintenance rule is to use ordinary filenames without apostrophes and keep the paths predictable. Confirm that every referenced file exists, is readable by the account running FFmpeg, and has sufficient storage available. A playlist typo can prevent startup or interrupt playback after earlier entries have played.

The concat demuxer applies safety checks to paths by default. The -safe 0 option in an example command below allows paths that the default may reject; it is not a general quality setting. Use it only when the playlist contents are trusted and controlled by you. Do not accept arbitrary playlist text from viewers or an untrusted upload location and then pass it to FFmpeg with relaxed path checks.

Duration information also matters at boundaries. FFmpeg notes that inaccurate durations can produce gaps or timestamp artefacts; inspect joins rather than assuming the next file starts perfectly. Play each playlist through its transitions, including the final-to-first transition if it will loop. Listen for silence, abrupt volume changes or a cut-off devotional chant, and check the picture for a pause, black frame or unintended change in aspect ratio.

A written checklist helps when there are seven files to maintain. For each playlist, verify the exact first-line header, file order, path spelling, readability and media compatibility. Then run it once with the intended FFmpeg version. A playlist that worked from an interactive terminal can still fail as a scheduled task because the service starts in another directory or under another account.

Map the local weekday to a playlist

Choose the timezone that defines your publishing calendar. If the channel’s schedule is based on India time, use that timezone explicitly rather than letting a machine in UTC decide the day. Near midnight, those choices can select different playlists. This is particularly important if a host is configured in a different region or a task runs just after midnight.

The selection logic should be small and predictable: obtain the current weekday in the chosen timezone, map it to one of the seven known playlist paths, verify the selected file exists, then launch FFmpeg. Keep a default behaviour for an invalid or missing result, such as stopping with a clear error and a log entry rather than silently choosing an unrelated programme. Avoid burying the mapping in a long, difficult-to-audit command line.

A wrapper typically makes the decision once, at process start. If Monday’s stream starts before midnight and runs for hours, it will keep reading Monday’s playlist after midnight unless you deliberately stop and relaunch it. Decide whether “day” means the day the stream starts or the calendar day currently shown to viewers. For most editorial schedules, choosing at a defined daily start time is easier to reason about than changing media at midnight while a file is playing.

There are two sensible scheduling patterns. A long-running process can choose the playlist at launch and loop it; a system scheduler can stop or start the process at a defined daily time, when the weekday is recalculated. The first has fewer planned transitions, while the second gives you a clean point to change the programme but can expose viewers to a reconnect or event transition. Neither pattern removes the need to monitor failures or confirm timezone behaviour.

If you run more than one channel, keep the weekday mapping separate for each channel rather than assuming that the same local start time or playlist is right for both. The guide to different playlist start times for two YouTube 24/7 channels covers why the schedule itself needs to be explicit.

Launch FFmpeg with the selected list

Once the wrapper has selected a playlist, pass it to FFmpeg as a concat-demuxer input. A conceptual command is:

ffmpeg -re -stream_loop -1 -f concat -safe 0 -i "$PLAYLIST" \\
  -c:v libx264 -preset veryfast -b:v 4500k -maxrate 4500k -bufsize 9000k \\
  -g 60 -c:a aac -b:a 128k -f flv "$YOUTUBE_RTMPS_URL/$STREAM_KEY"

Treat this as an illustration, not a tested universal command. The codecs, bitrate, keyframe interval, endpoint syntax and options must fit the source files, target output, installed FFmpeg build and current YouTube stream settings. Do not copy numeric encoder values from an example without checking the requirements for your intended resolution and frame rate. FFmpeg’s command documentation describes -stream_loop -1 as requesting infinite looping of an input; verify option placement and behaviour with the version you actually run.

The -re input option is commonly used to read file input at its native rate for streaming, but test the complete output with your media and network. A process that runs without an error is not proof that the audio is intelligible, that the stream is reaching the right event or that the picture is suitable for viewers. Monitor the FFmpeg log as well as YouTube’s preview.

For a persistent process, arrange a restart policy that does not accidentally create multiple encoders sending to the same event. For a scheduled process, make start and stop behaviour deliberate: define what happens if the previous instance is still running, and make the log identify the selected weekday and playlist. A restart should re-evaluate the weekday if that is your intended rule. Do not rely on an implicit shell environment for the stream key or playlist path.

Some channels will find the local wrapper valuable because it keeps a familiar folder of files and a visible mapping. Others may prefer not to keep a computer running, monitor a process and handle restarts. If the recurring burden is keeping a local machine on and restarting playout after a drop, StreamNeo removes that specific task by turning an uploaded video into a YouTube live stream that runs with your computer switched off. It is YouTube-only, so it does not replace an FFmpeg setup when you need this exact custom weekday selection logic.

Connect to YouTube’s ingest endpoint

In Live Control Room, copy the current server URL and stream key for the event or stream settings you intend to use. Put those values into the encoder configuration and check that the selected event is the one you mean to broadcast to. YouTube’s stream settings guidance treats the stream key as credential-like; protect it as you would a password and reset it if you believe it has been exposed.

Prefer the RTMPS endpoint when your FFmpeg build and connection support it. RTMPS is RTMP carried over TLS/SSL, which protects the connection in transit; YouTube provides instructions for using RTMPS. Confirm the exact URL format presented for your stream in Live Control Room rather than guessing whether the key should be appended as part of the URL.

Keep secrets out of source-controlled scripts, shared documents, public logs and copied terminal history. A protected environment variable or a permissions-restricted configuration file is safer than typing a key directly into a command likely to be saved. If you reuse a scheduled event’s settings, check the event, key and metadata before starting; reused settings can carry details you may not intend for the next broadcast.

After FFmpeg connects, wait for the YouTube preview and check the incoming video and sound before following the event’s required start steps. If no preview arrives, check the URL, key, network path and encoder log rather than editing all seven playlists. For additional network diagnosis, the article on testing whether upload jitter is causing stream dropouts separates connection instability from file-selection problems.

Test weekday changes and recovery

Before relying on an unattended schedule, test one playlist at a time with an unlisted or private event. Confirm the expected files appear in the expected order, the preview has both picture and sound, and a join between clips does not create a visible or audible gap. YouTube’s live streaming tips recommend testing and monitoring stream quality; use the current official guidance for the event type and channel.

Test the weekday mapping without waiting for seven real calendar days. You can temporarily provide a known weekday to the wrapper or invoke each playlist directly, then restore the normal date calculation. Record which playlist was selected and what the preview showed. Also test a date boundary in the intended timezone, especially if the schedule starts near midnight or the machine uses UTC.

Recovery is a separate test from first launch. Stop the process deliberately, then confirm the supervisor or scheduler behaves as intended and does not launch duplicates. If it restarts, check whether the wrapper reselects the playlist and whether the event accepts the reconnect. Look for an audio/video discontinuity after reconnect and confirm that the preview returns. No restart mechanism guarantees viewers will see an uninterrupted stream, so set expectations accordingly.

Keep a short operating note for the person who may be on call: where playlists live, how to identify the active list, where logs are written, how to stop a process safely and how to replace a compromised key in Live Control Room. If the stream matters overnight, test the alert or check-in method as well as the restart path. A successful daytime test does not prove that a silent failure will be noticed later.

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

Can YouTube Studio choose the local playlist for each weekday?

No. YouTube Studio schedules the event and supplies the encoder connection details; FFmpeg reads the playlist you pass to it. Use a wrapper or operating-system scheduler to map the intended local weekday to a playlist before FFmpeg starts.

Can one FFconcat file contain a different list for every day?

A concat file is a list of files to read in order, not a weekday rule. Keep seven named lists if you need seven distinct sequences, then select the relevant one in your launch logic. Reusing media across lists is fine if each playlist remains explicit and tested.

Why does the stream fail when the playlist looks correct?

Check the working directory, permissions, exact path spelling, media compatibility and FFmpeg log first. Then check that the stream URL and key match the intended YouTube event, and that the preview receives the feed. Playlist selection and ingest connection are separate failure points.

Does FFmpeg automatically switch to the next weekday at midnight?

Not just because the date changes. A process that has already opened a playlist continues with that input; weekday selection must be handled by your wrapper or scheduler, and any midnight switch requires an intentional stop and relaunch design. Test the timezone and boundary behaviour before depending on it.

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 Setup Guides guides ↗ · All topics ↗