Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
FREEDOM251

Freedom251 › Blog › concat demuxer

How to Set Up FFmpeg Concat for a Continuous YouTube Livestream of Story Videos

By Freedom251 Team · · 7 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use FFmpeg’s concat demuxer to play a text playlist of story videos in order, and add -stream_loop -1 to repeat it indefinitely. The files need compatible streams, codecs, and time bases; FFmpeg must read them at real-time speed with -re; and the output must use an ingest URL and stream key from YouTube Live Control Room.

What FFmpeg concat does—and what it needs

The concat demuxer reads a plain-text script and presents its listed files as one sequential input. The playlist order is the playback order. With -stream_loop -1, FFmpeg repeats that input indefinitely; with -re, it reads the file input at its native frame rate rather than sending it as fast as the machine can process it.

As an Amazon Associate I earn from qualifying purchases.

The demuxer is not a general-purpose fixer for mismatched files. FFmpeg’s documentation says, “All files must have the same streams (same codecs, same time base, etc.).” Duration metadata matters too: the demuxer uses each file’s duration to calculate timestamps for the next one, so inaccurate durations can produce timestamp problems, gaps, or other discontinuities.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This workflow is for prerecorded videos sent as a live broadcast, not a camera feed. You need an FFmpeg build with the demuxer and encoders your inputs and output require, a stable upload connection, and permission to livestream on the YouTube channel you plan to use. Encoder availability varies by platform and build; check your installed build before relying on a particular encoder.

#1 Best Overall
Sale
ZYDIIE 4K Video Camera Camcorder UHD 64MP Vlogging Camera for YouTube 18x Digital Zoom 3" 270° Rotation IPS Touchscreen Video Camcorder with Night Vision, Remote Control, 32GB Card, 2 Batteries
  • 4K & 64MP Video Camera Camcorder: Capture life in breathtaking detail with 4K Ultra HD recording and vibrant 64MP photos, powered by an advanced high-sensitivity CMOS sensor. Equipped for exploring the beautiful world, this video camera is your perfect companion! Ideal for video recording, travel vlogs, family activities, interviews, studying, and cherishing precious moments
  • 18X Digital Zoom & Infrared Night Vision: This 4K camcorder powerful 18x digital zoom brings distant action right to you. Capture clear details of people and landscapes. With the push of “OK” button, activate the IR cut filter. This night vision camcorder delivers high-contrast black & white video in total darkness, providing a clearer image than standard low-light color mode
  • 3.0 Inches Touchscreen with 270° Rotation: This camcorder features a brilliant 3-inch touchscreen that puts complete control in your hands. The screen rotates a full 270 degrees, making it a game-changer for vloggers. Easily frame yourself for solo shots, capture high-angle overhead videos, or get creative low-angle perspectives
  • Webcam & Remote Control: Instantly transform your camcorder into webcam with a single USB cable. No complex drivers needed. Just connect and ready to go. Elevate your live streams and professional presentations with stunning 4K clarity. This video camera comes with a handy wireless remote to start/stop recording, and take photos without ever touching the device—ideal for solo creators, vloggers, and group shots
  • Multifunctional Camcorder: This 4K camcorder is loaded with pro features. Like face detection, video pause, slow motion, continuous shooting, time-lapse, self-timer, recording while charging, date stamp. Resulting in consistently smooth, sharp, and stunning footage in every scene. The two high-capacity batteries and 32GB micro SD card ensure that you won't miss a single beautiful moment in life

Prepare and check the story videos

Build the playlist in playback order

Create a text file such as playlist.txt in the directory containing the story videos:

ffconcat version 1.0
file 'story-01.mp4'
file 'story-02.mp4'
file 'story-03.mp4'

The optional first line identifies the script using FFmpeg’s concat format. Each file line gives a path to one input. Paths containing spaces or special characters need correct quoting or escaping; relative paths are generally easier to manage when the playlist and videos are in the same directory.

The example command below uses -safe 0, which relaxes concat’s path safety checks. Use it only with a playlist and file paths you trust. If FFmpeg reports unsafe paths, use safe relative paths where possible, or retain -safe 0 only for a trusted local playlist.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Compare the inputs before going live

Inspect each file with FFprobe, which is commonly distributed with FFmpeg. Compare the number and order of streams, codecs, time bases, frame rates, resolutions, audio sample rates and channel layouts, and duration metadata. The concat demuxer expects matching stream structure and compatible parameters; differences can cause the join to fail or behave badly.

Rank #2
Sale
4K Video Camera Camcorder 96MP Vlogging Camera for YouTube and Beginners
  • 【4K ULTRA HD VIDEO & 96MP PHOTO】 Capture stunning 4K Ultra HD video and up to 96MP photos with this 4K video camera camcorder. The high-sensitivity CMOS sensor delivers vivid colors, sharp details, and clear image quality for video recording and photography. This digital camcorder is ideal for travel, family gatherings, everyday recording, and creating high-resolution photos and videos.
  • 【18X DIGITAL ZOOM & IR NIGHT VISION】 Get closer to distant subjects with powerful 18X digital zoom, making it easy to capture people, performances, scenery, sports, and other details from a distance. Press the OK button to activate the infrared filter and enter IR night vision mode, allowing this night vision camcorder to record high-contrast black-and-white video even in total darkness.
  • 【3.0" TOUCH SCREEN & 270° ROTATION】 The responsive 3.0-inch HD touchscreen provides intuitive control for quick setting adjustments. The 270° rotating screen makes it easy to monitor your framing from different angles, including selfies, vlogs, portrait close-ups, high-angle overhead shots, and low-angle creative compositions. A practical vlogging camera design for flexible and easy video recording.
  • 【WEBCAM & WIRELESS REMOTE CONTROL】 Connect this 4K video camera to your computer via USB and use it as a webcam without complicated driver installation. Enjoy HD video for live streaming, online meetings, video calls, YouTube, and content creation. The included wireless remote control lets you start or stop recording and take photos from a distance, making solo shooting and group photography easier.
  • 【MULTIFUNCTIONAL DIGITAL CAMCORDER】 This digital video camera includes multiple shooting functions such as face detection, video pause, slow motion, time-lapse, self-timer, continuous shooting, recording while charging, and date stamp. The camcorder comes with 2 rechargeable batteries and a 32GB memory card, providing a complete setup for recording right out of the box.

If the files do not match, normalize them before the broadcast or use FFmpeg’s concat filter and re-encode. The filter is the appropriate route when re-encoding is needed, but it requires a filter graph suited to the actual files; there is no single universal graph for every mix of video and audio formats. Stream copy can reduce CPU use when inputs already match and the resulting codecs, timestamps, and container are accepted by YouTube, but verify those conditions rather than assuming -c copy will work.

Set the YouTube Live ingest details

  1. Open YouTube Studio and go to the channel’s Live Control Room. Create or select the live stream using the controls available to your channel.

  2. Copy the RTMPS ingest URL and stream key shown for that stream. These are account- and stream-specific values; do not substitute a guessed URL or key.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  3. Keep the key secret. Do not publish it in screenshots, logs, shared scripts, or command examples. The shell-variable format in the command below helps keep the literal key out of the command text, but environment variables are not a substitute for careful access control on a shared machine.

    Rank #3
    Sale
    CAMWORLD 5K Camcorder Video Camera, Night Vision, Dual Lens, 3" Touchscreen
    • Dual Lens 5K Camcorder - Capture Every Perspective - The 5K video camera features innovative dual-lens technology: a 4K front camera for the speaker and a 1080P rear camera for the audience—perfect for stage shows, speeches, weddings, and events. Capture both perspectives simultaneously without needing a second camera. When using only the front lens, achieve stunning 5K video resolution and crystal-clear 56MP photos. The video camera with night vision for low-light filming and live streaming. The 16X digital zoom brings distant subjects closer with impressive detail. Note: Fixed-focus lens (best shooting distance: 0.6m+); does not support autofocus or manual focus.
    • IR Night Vision & 32GB Card Included - Ready Day & Night - Shoot clear black-and-white photos and videos even in complete darkness with the built-in IR night vision. Simply short-press the "Power" button to toggle night vision mode—ideal for night vlogging, security monitoring, or low-light environments. The 3.0" 270° rotatable touchscreen offers multiple viewing angles for creative framing. Includes a 32GB SD card (pre-installed) and two 2400mAh rechargeable batteries (120-150 min recording each), so you can start creating immediately. Designed for content creators, YouTubers, and filmmakers who demand broadcast-quality footage.
    • YouTube & Vlogging Ready - Mic jack for external mic, perfect for content creators, podcast -Transform this 5K camcorder into a webcam for YouTube, Facebook, and Twitch live streaming. Perfect for Zoom meetings, online teaching, and virtual conferences with superior audio quality. Connect to your TV via HDMI cable to share videos with family and friends on the big screen. The built-in WiFi enables wireless transmission—browse, transfer, and share images or videos instantly via the "Lercerker" app on your smartphone. Good connectivity for modern content creators.
    • Versatile Digital Camcorder - Ideal for sports action filming, photography, home movies - Use the IR remote control for hands-free operation—ideal for vloggers and solo creators. Remote usage: Open the camera, face the lens, and stay within 8 meters. Packed with creative features: time-lapse, slow motion, pause function (continue recording in the same file), loop recording, and anti-shake stabilization. Note: Due to FAT32 file system limitations, each video file maxes at 4GB; long videos are automatically split into 15-20 minute clips.
    • Complete YouTube Starter Kit - Includes microphone, tripod, bag and 32GB SD card - The lens hood prevents unwanted reflections and protects the lens from dust and scratches. The foldable handheld stabilizer (up to 90°) ensures smooth, professional footage. Note: Due to compact packaging, accessories are not printed on the box. Our dedicated support team responds within 8 hours to any questions. Backed by a 1-year warranty for peace of mind.

RTMPS is the straightforward option for conventional H.264/AAC live ingestion. YouTube also describes HLS as an alternative for HDR or codecs unsupported by RTMP, but HLS requires correctly configured HTTPS delivery, playlists, segments, formats, and segment durations, and has greater latency. Do not switch to HLS without implementing those requirements.

Choose compatible live encoding settings

YouTube’s currently listed RTMP/RTMPS guidance supports H.264, H.265/HEVC, and AV1 video up to 60 fps; it recommends CBR video bitrate, AAC or MP3 audio, and a keyframe interval of two seconds, not exceeding four seconds. These are recommendations, not a guarantee that a particular source or connection will produce a good stream.

Setting YouTube guidance How to apply it
Video codec H.264, H.265/HEVC, or AV1 for RTMP/RTMPS, up to 60 fps The example uses H.264 via libx264; your FFmpeg build must include it.
Video rate control CBR recommended The example sets a target and maximum bitrate with a matching buffer-size convention. Select a rate your upstream connection can sustain.
H.264 at 1080p/30 fps 10 Mbps recommended Use as a reference point for this resolution and frame rate, not as a universal requirement.
H.264 at 1080p/60 fps 17 Mbps recommended Use as a reference point for this resolution and frame rate, not as a universal requirement.
Keyframes Recommended every 2 seconds; do not exceed 4 seconds At 30 fps, a 60-frame GOP is two seconds.
Stereo audio 128 Kbps at 44.1 kHz recommended The example sets AAC stereo at those values.

The example’s 5 Mbps video rate is a conservative starting template, not the listed YouTube recommendation for 1080p H.264. Choose bitrate, resolution, and frame rate together: the connection’s sustained upstream capacity must cover the video rate plus audio and network overhead. A 60-frame GOP is a two-second interval only at 30 fps; if you change the output frame rate, adjust the GOP to preserve the intended interval.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Start the continuous livestream

Set the two environment variables to the exact RTMPS URL and stream key copied from Live Control Room. Keep the key private. For a shell that supports the syntax below, then run this illustrative command from the directory containing playlist.txt:

Rank #4
Sale
FlyFrost 8K Video Camera 88MP UHD WiFi Vlogging Cameras for YouTube 18X Digital Zoom IR Night Vision 3.0'' Touch Screen Camcorder with Microphone, Lens Hood, Stabilizer, Remote, Two Batteries
  • 【2026 Latest 8K ULTRA HD & 88MP Video Camera】This video camera records videos up to 8k resolution at 15FPS, and captures 88MP High-resolution Image with advanced 6-axis gyroscope autofocus. The 8K video camera definitely producing sharp, clear images and smooth, stable video recording. Built-in 3 inch touch screen youtube camera supports 270°rotation and 18X digital zoom, which allows you to capture and records with precision.
  • 【8K Wifi Camcorder & IR Night Vision】Our 8K video cameras supports WiFi fast transmission, download "iSmart DV2" APP, then simply connected your camcorder with Android /IOS smartphone and tablets. Then you can fast view, browse, share, transfer images and videos via mobile devices without any annoyed cable, you can also remote control the camera by App. Just press ''OK'' button, this YouTube camera with IR night vision, you can capture black and white photos or videos in dimly lit or dark environments.
  • 【Webcam Function & External Microphone】8K Vlogging camera supports used for live streaming and video calling. Just simply connected our 8k camcorder with computer through the usb cable comes with package and choose ‘‘PC Camera’’ to enter webcam mode, and choose ‘‘General UVC Camera’’ on external camera of social media software. The external microphone reduce wind noise and eliminate background noise effectively.
  • 【Lens Hook & Handheld Stabilizer & Remote Control】Our 8K Digital Video Camera comes with lens hook for blocking excess light, not only protect your camcorder lens from accident break, also keep your images avoid overexposed. Fordable stabilizer allow you recording stable 8K video from different angle. This 8k YouTube camera with 2.4G wireless technology, you can remote control the digital video recorder within 60 feet from different direction.
  • 【Multifunctional 8K Camcorder & After-Sale Support】8K digital camera has many powerful features, like pause function, face detection, slow motion, continuously shooting, time-lapse recording, selfie, anti-shake, self-timer, time-lapse shooting, recording while charging, date stamp, USB 2.0 and up to 256GB SD card(SD Card not included), support tripod and LED light (tripod and LED light not included).Please refer to the user manual for detailed instructions on each button's functions.
export YOUTUBE_RTMPS_URL='YOUR_RTMPS_INGEST_URL'
export YOUTUBE_STREAM_KEY='YOUR_STREAM_KEY'

ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.txt 
  -c:v libx264 -preset veryfast -b:v 5M -maxrate 5M -bufsize 10M 
  -g 60 -keyint_min 60 -sc_threshold 0 
  -c:a aac -b:a 128k -ar 44100 -ac 2 
  -f flv "$YOUTUBE_RTMPS_URL/$YOUTUBE_STREAM_KEY"

This is a starting template, not a tested universal command. It assumes a 30 fps output, an FFmpeg build containing libx264 and AAC encoding, and inputs that the concat demuxer can read as one compatible sequence. Both -re and -stream_loop -1 are input options, so they must appear before the playlist’s -i. The command re-encodes video and audio; adjust the rate and GOP for the selected output settings and the upload connection. Some encoders or ingest setups take the URL and stream name/key as separate fields, so follow the format expected by your setup.

Before relying on a long broadcast, test with representative story videos, including their quiet sections, loud sections, motion, and transitions. Check that playback starts in the intended order, the audio is present and synchronized, and YouTube reports a healthy incoming stream. Keep an eye on the output and YouTube’s stream-health indicators during the broadcast.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot playlist, boundary, and ingest failures

  • FFmpeg cannot find a playlist entry: Check the working directory, relative paths, spelling, filename case where relevant, and quoting for spaces or special characters. Confirm that every listed file exists and is readable.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • FFmpeg stops or glitches at a file boundary: Use FFprobe to compare stream count and order, codec, time base, frame rate, resolution, audio sample rate, and channel layout across inputs. Check that duration metadata is reliable. Normalize incompatible inputs or use the concat filter and re-encode.

    Best Value
    kimire Video Camera Camcorder Digital Camera Recorder Full HD 1080P 15FPS 24MP 3.0 Inch 270 Degree Rotation LCD 16X Digital Zoom Camcorder Camera with 2 Batteries(Black)
    • 【Video Camera as Webcam】: The video camera is useful to take the beautiful photos and share it in your Youtube. It can be used as webcam when the camera connect the computer. Please operate the camera button to choose the “PC CAM” mode.When the “AMCAP ” window is opened,from which shooting object through the camera will be showed on this window. You can have a video call with your families or friends. Please download the software “AMCAP ” before use the webcam function.
    • 【Multifunction Camcorder】: 1080P(15fps) Video Resolution, 24M(6000x4500) Image Resolution, image format (JPEG), video format(AVI), 16X digital zoom, camcorder with fill light, 3.0 inch LCD and supports 270°rotation, Anti-shake, Face Capture, Beauty Function, Self-timer and Webcam function, Pause function, USB 2.0, TV Output, Setting Date and Time.
    • 【Pause Function】: This video camera supports Pause function,so you can pause the recording when you need,then continue recording again without starting a new one, which makes it easier for you to edit and upload the videos. This video camera included a USB cable,you can connect it directly to the computer to upload videos. This video camera included a AV cable,you can connect it directly to the TV to playback the videos.
    • 【Recording While Charging】: The camcorder come with two NP-FV5 batteries. It allows you to keep recording around 60 to 90 minutes when it's fully charged. For the first time use need to charge more than 8 hours. The camcorder support the recording while charging,good to record long videos anytime.
    • 【Small and Compact Camcorder】: The camcorder supports SD/SDHC card up to 128GB (not included), just remember to format the SD card before use the camcorder first time. The camcorder support the tripod(not included) connection and the hole is standard size.
  • FFmpeg reports an unsafe path: Prefer safe relative paths in the playlist. For a trusted local playlist only, -safe 0 relaxes the check; do not use that relaxation with an untrusted file list.

  • YouTube does not receive the stream: Re-copy the RTMPS URL and key from Live Control Room, check that they correspond to the selected stream, and confirm that the output codec, keyframe interval, and bitrate suit its configured ingest settings. YouTube notes that RTMPS SSL errors can require the correct rtmps URL and, in some cases, port 443.

  • The stream is unstable or drops frames: Check whether the upstream connection can sustain the chosen video rate plus audio and overhead, and whether the machine can encode at the selected resolution and frame rate. Reduce the output load or bitrate if needed, then test stream health again.

    What’s actually slowing this PC down?

    Pick the symptom - the matching free tool is one click away.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • The playlist plays too quickly rather than like a broadcast: Confirm -re is before -i playlist.txt. It paces file input at native frame rate.

Check copyright and channel eligibility

A video being prerecorded does not make it exempt from YouTube’s copyright or livestream rules. Use stories, music, images, and other material you own or have permission to broadcast; review YouTube’s current channel-specific livestream controls and restrictions before starting. Eligibility, duration limits, archive behavior, and channel controls can vary, and the ingest guidance alone does not establish what applies to an individual channel.

Repeatedly looping a playlist also does not by itself establish that a channel complies with YouTube’s monetization or reused-content policies. Review the current YouTube policies that apply to your channel and content, and do not assume that technical acceptance of a live stream grants rights to the material or guarantees monetization.

Or let it run in the cloud

If you want a continuous YouTube stream without keeping an FFmpeg computer running at home, StreamNeo is the cloud alternative: upload a recording or build a playlist, add your YouTube stream key once, and go live. StreamNeo loops uploaded videos from the cloud, so nothing has to stay on at home. It streams the uploaded file as made, up to 4K 60 fps, at one flat price per slot; it does not re-encode or offer quality tiers. It can automatically recover if YouTube drops the stream. The first day is free with no card, one free day per account. Monthly billing is $9.99 per month. StreamNeo is for YouTube livestreams of uploaded videos, not camera broadcasting. See StreamNeo, then start the free day.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

concat demuxerFFmpeglivestreamingVideo StreamingYouTube Live

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.