October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
AAC

How to Stream a Local Video Playlist to YouTube with FFmpeg (H.264 + AAC)

Use FFmpeg’s concat demuxer to loop compatible local video files to YouTube Live with H.264 and AAC, with setup steps, protocol caveats, and troubleshooting.

By VGSources Team 7 min read
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To stream a playlist of local video files to YouTube Live with FFmpeg, list compatible files in an FFmpeg concat-demuxer file, then encode the combined input as H.264 video and AAC audio while sending it to YouTube’s RTMP ingest URL. The command below loops the list. It is a starting pattern, not a verified universal YouTube preset: check your installed FFmpeg build and YouTube’s current encoder guidance before choosing production settings. This guide means a playlist of files on your computer or server—not a YouTube watch-page playlist URL.

What you need before starting

  • FFmpeg with the required input, muxer, and encoder support. The example uses libx264 for H.264 and FFmpeg’s native AAC encoder; available components can vary by build. See the FFmpeg codec documentation.
  • Local video files you have permission to use, with compatible streams if you plan to use the concat demuxer.
  • A YouTube Live ingest URL and stream key from your live setup. Keep the key private; anyone who obtains it may be able to broadcast to your stream.
  • A terminal or command prompt on a machine that can reach the internet and remain running for the duration of the broadcast.

Prepare a compatible playlist

Inspect the files

Use ffprobe to check each file’s video and audio codecs, dimensions, frame rate, sample rate, and stream layout. For example:

ffprobe -hide_banner -i "/media/clip-01.mp4"

Repeat for every playlist entry. The concat demuxer joins files at the container level; it does not fix different codecs, stream layouts, or time bases. Inputs should have compatible streams and time bases. If clips differ substantially, normalize them first or concatenate with the filter workflow and re-encode. FFmpeg’s FAQ describes concat approaches, including the concat filter for cases that require re-encoding: FFmpeg FAQ: concatenating video files.

Create the concat list

Make a plain-text file named playlist.txt, with one file directive per entry:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
file '/media/clip-01.mp4'
file '/media/clip-02.mp4'
file '/media/clip-03.mp4'

Use paths and quoting that match your operating system. Paths containing apostrophes need appropriate escaping. The command below uses -safe 0 to permit absolute paths; only use a list you control, since this relaxes FFmpeg’s default path-safety restriction.

Send the playlist to YouTube over RTMP

For compatible local files, this representative command reads the playlist in real time, loops it indefinitely, encodes H.264/AAC, and muxes the output as FLV for RTMP:

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.txt 
  -map 0:v:0 -map 0:a:0? 
  -c:v libx264 -pix_fmt yuv420p -preset veryfast 
  -c:a aac -b:a 128k -ar 44100 -ac 2 
  -f flv 'rtmp://YOUR_INGEST_URL/YOUR_STREAM_KEY'

Replace the example destination with the RTMP ingest URL and stream key shown in YouTube’s live setup. Do not publish a script containing the key, commit it to a public repository, or paste it into public logs or support posts.

What the important options do

  • -re reads the file input at its native rate, rather than sending it as fast as the machine can process it.
  • -stream_loop -1 loops the concat input indefinitely. Stop FFmpeg with Ctrl+C when you want to end the output.
  • -f concat selects the concat demuxer; -safe 0 permits the absolute paths in the example list.
  • -map 0:v:0 selects the first video stream. -map 0:a:0? selects the first audio stream if present; the question mark makes that mapping optional. A playlist whose entries have inconsistent audio streams may still fail or produce unwanted results.
  • -c:v libx264 selects H.264 encoding. -pix_fmt yuv420p requests a widely compatible pixel format, and -preset veryfast trades some compression efficiency for lower encoding work.
  • -c:a aac selects AAC audio. -b:a 128k sets the encoder bitrate; FFmpeg’s native AAC encoder uses constant-bitrate mode when a bitrate is specified. AAC-LC is its default profile.
  • -ar 44100 -ac 2 requests 44.1 kHz stereo output. The bitrate, sample-rate, and channel choices shown here are an illustrative starting configuration, not a confirmed current RTMP recommendation from YouTube.
  • -f flv selects FLV output, commonly used with RTMP. Confirm that the URL uses the correct protocol and ingest address for the setup you selected.

The example does not set a resolution, frame rate, video bitrate, or keyframe interval. Choose those against the source footage, available upload capacity, installed encoder, and YouTube’s current general encoder settings. The YouTube documentation cited here establishes HLS requirements and protocol mechanics, but does not establish current numeric RTMP recommendations; do not treat the example as a complete YouTube preset. FFmpeg command behavior can also vary with the installed build and version. Review the FFmpeg command-line documentation and verify the settings for your environment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Check the YouTube preview before going public

Start the command and check the preview and stream health in YouTube’s live setup before making the broadcast public. If you need exact account-eligibility criteria or current Studio screen labels, consult YouTube’s live setup documentation; the protocol pages cited below do not establish those details. YouTube’s live streaming help covers setup and eligibility information.

RTMP and HLS are different workflows

Do not switch an RTMP command to an HLS URL and assume the rest stays the same. YouTube HLS ingest has packaging and upload requirements that differ from the FLV-over-RTMP example.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Aspect RTMP example above YouTube HLS ingest
Packaging FLV output over RTMP in the example; this is not a universal YouTube preset. MPEG-TS segments and a rolling playlist are required by YouTube’s HLS guidance.
Playlist and delivery The example sends a continuous RTMP output; the cited material here does not establish numeric RTMP bitrate, resolution, or keyframe recommendations. HTTPS POST or PUT; the rolling playlist must have no more than five outstanding segments.
Segment duration Not applicable to this continuous RTMP example. YouTube’s HLS documentation specifies segments of one to four seconds.
Video and audio guidance The example uses H.264 and AAC, but its audio numbers should not be treated as separately verified RTMP guidance. YouTube’s HLS materials support H.264 and AAC and recommend 44.1 kHz stereo audio at 128 Kbps for stereo.

For HLS packaging and ingest requirements, see YouTube HLS ingest protocol and YouTube Help: HLS live streaming. YouTube also documents DASH ingest; it is another protocol, not an RTMP URL substitution.

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

Copyright and playlist suitability

Only stream videos and audio you are authorized to broadcast. A playlist made from local files is not automatically safe to stream just because the files are on your device. YouTube may identify copyrighted material during a live broadcast, and a stream can be interrupted or restricted. Review YouTube’s applicable live-streaming and copyright rules before broadcasting. For a practical preflight, use the copyright safety checklist.

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.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Looping a set of videos does not itself establish eligibility for monetization. YouTube evaluates channels under its policies, including reused-content rules; rights to use media and monetization eligibility are separate questions. Check YouTube’s current channel monetization policies if monetization is relevant.

Troubleshooting common failures

FFmpeg rejects the concat list or stops at a file boundary

  • Likely cause: A path is misspelled, quoting is invalid, or an entry uses a format the demuxer cannot read.
  • Fix: Test each path individually with ffprobe, correct the list syntax, and ensure the files are accessible to the user running FFmpeg.

Playback breaks, timestamps jump, or audio/video goes out of sync

  • Likely cause: Playlist entries have mismatched streams, codecs, time bases, frame rates, or audio layouts.
  • Fix: Inspect every input. Normalize the files to compatible properties or use a concat-filter workflow that decodes and re-encodes them.

The command says an encoder or muxer is unavailable

  • Likely cause: The installed FFmpeg build lacks libx264 or the required output support.
  • Fix: Check the build’s available encoders and formats, then install or select a build with the needed support. Consult the codec documentation.

YouTube does not receive the stream

  • Likely cause: The ingest URL or key is wrong, the key was rotated, the network blocks the connection, or the selected protocol does not match the destination.
  • Fix: Copy the current RTMP ingest details from YouTube, verify that the key is intact and private, and confirm connectivity. Check the YouTube preview and health indicators.

The broadcast buffers or encoding falls behind

  • Likely cause: The machine cannot encode the chosen output in real time, or its upload connection cannot sustain the output.
  • Fix: Reduce encoding workload or output demands, check for dropped frames in FFmpeg and YouTube’s status display, and make sure the source files themselves decode smoothly. Select specific bitrate and resolution settings from current YouTube guidance and your connection’s sustained capacity rather than relying on a universal value.

Let the playlist run without leaving a computer on

FFmpeg is a do-it-yourself option, but the computer running it and its network connection must remain available. StreamNeo is a cloud service for keeping a YouTube channel live from uploaded videos: upload a recording or build a playlist, add your YouTube stream key once, and go live. It loops the uploaded videos from the cloud, so no home computer or OBS session has to stay on. StreamNeo streams to YouTube only.

  • One flat price per slot for any uploaded quality up to 4K 60fps, with no re-encode or quality tiers.
  • Automatic recovery if YouTube drops the stream.
  • One free day per account, with no card required to start.
  • Each slot includes one always-on stream, 10 GB storage pooled across active slots, 24/7 looping and playlists, and StreamNeo team support. The same product is included on every plan; only the billing length changes.

Billing options: Daily $0.99 per day · Weekly $2.99 per week · Monthly $9.99 per month · 6 months $49.99 for 6 months · Yearly $89.99 a year. UPI and cards are available in India; card checkout is available worldwide. For five or more slots, contact support. See StreamNeo for details. To try it, start the free first day.

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.

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

Leave a Reply

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

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

More from Patch Notes

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.