Keep FFmpeg’s YouTube output running and switch content inside the pipeline; do not stop and restart FFmpeg if your goal is to preserve the same encoder session. For a playlist known in advance, use FFmpeg’s concat filter and its next command. For runtime control, a ZeroMQ-enabled FFmpeg build can send commands to filters already in the graph. Neither approach can guarantee uninterrupted playback if the network or YouTube ingest fails.
Choose a switching method
| Method | Best for | Runtime flexibility | Main constraint |
|---|---|---|---|
| Preconfigured concat filter | A finite sequence of clips known before FFmpeg starts | Advance through configured segments with next |
Inputs must fit the graph and meet stream, timestamp, and format requirements. |
| Concat filter controlled through ZeroMQ | A prepared graph that needs an external runtime command | Send supported commands to filters already in the graph | Requires FFmpeg built with libzmq; it is not a documented way to add arbitrary new input files. |
| Separate switcher feeding one FFmpeg output | Open-ended changes or more complex transitions | Depends on the switcher or controller | More system complexity; validate timing, audio, and that one continuous output reaches FFmpeg. |
| Restart FFmpeg | Manual recovery or reconfiguration when continuity is not essential | Change inputs or command-line options on restart | Stopping the encoder’s content can disrupt or end the YouTube event. |
For a fixed playlist, the concat filter is the direct choice. FFmpeg’s documentation says its next command closes the current segment and steps to the next configured one. This advances within the prepared graph; it does not dynamically add a new command-line input. See the FFmpeg concat filter documentation.
Prepare clips for the concat filter
The concat filter joins synchronized audio and video segments in sequence. Each segment must have the same number of audio and video streams, related audio and video should be concatenated together, and every segment must start at timestamp zero. Corresponding streams need compatible parameters. The filter can select a common pixel or sample format, but resolution differences should be explicitly scaled. Different frame rates can result in variable-frame-rate output.
- Inspect every clip. Check its video and audio streams, dimensions, frame rate, channel layout, and starting timestamps. Confirm that each clip has the audio/video stream arrangement your graph expects.
- Normalize mismatches. Scale clips to the same output dimensions, set a consistent frame rate if required, and reset timestamps in each segment with
setpts=PTS-STARTPTSandasetpts=PTS-STARTPTS. - Choose the output and ingest settings. Set the codec, pixel format, bitrate, frame rate, keyframe interval, and audio encoding for the intended YouTube stream and available upload bandwidth.
- Test the exact sequence and switch command. Confirm segment order, transitions, timestamps, and audio before using the setup live.
Example: two prepared clips
This illustrative template scales both inputs to 1080p, sets them to 30 fps, resets their timestamps, joins their audio/video, and sends one encoded output to YouTube. It is not a tested command; adapt it to your input streams, installed FFmpeg build, desired quality, and YouTube ingest configuration.
Recommended Free Tools
#1 Best Overall
- 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.
ffmpeg -re -i clip1.mp4 -re -i clip2.mp4
-filter_complex "[0:v]scale=1920:1080,fps=30,setpts=PTS-STARTPTS[v0];[0:a]asetpts=PTS-STARTPTS[a0];[1:v]scale=1920:1080,fps=30,setpts=PTS-STARTPTS[v1];[1:a]asetpts=PTS-STARTPTS[a1];[v0][a0][v1][a1]concat=n=2:v=1:a=1[v][a]"
-map "[v]" -map "[a]"
-c:v libx264 -pix_fmt yuv420p -r 30 -g 60 -b:v 5M -maxrate 5M -bufsize 10M
-c:a aac -b:a 128k -ar 44100
-f flv "$YOUTUBE_RTMP_URL/$YOUTUBE_STREAM_KEY"
The example assumes both clips have audio and video. If a clip lacks a stream, the graph needs to be adjusted rather than blindly using these labels. Its bitrate is an example, not a universal recommendation. Also confirm the effect of -re for your inputs and setup. Keep the stream key private: YouTube describes it as a password-like credential that lets the encoder send its feed.
Advance to the next clip at runtime with ZeroMQ
FFmpeg’s zmq and azmq filters receive client messages and forward them to filters in the existing graph. The video zmq filter belongs between video filters, and FFmpeg must be configured with --enable-libzmq. Its default bind address uses local TCP. The filter documentation describes the message format as TARGET COMMAND [ARG] and lists next as a concat command. See the FFmpeg ZeroMQ filter documentation and the concat filter reference.
Rank #2
- 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.
- Check that your installed FFmpeg build includes the needed filters and libzmq support; online documentation may describe a newer revision than your local binary.
- Place a command-capable ZeroMQ filter in the graph and configure its bind address as appropriate for your environment.
- Address the concat filter instance from a ZeroMQ client and send its
nextcommand using the documented message format. - Verify the command syntax, response, and resulting audio/video transition on the exact FFmpeg version you will use before relying on it live.
ZeroMQ controls supported filters that are already present; it is not a general hot-plug interface for arbitrary files absent from FFmpeg’s input list. If you need unrestricted source replacement, a controller built on FFmpeg libraries or a separate switching/mixing layer may suit the requirement, but validate timestamps and audio behavior in the chosen design.
Concat demuxer and restarting: what they do differently
FFmpeg distinguishes the concat filter, concat demuxer, and concat protocol. The FFmpeg concat FAQ recommends the filter when re-encoding is needed and describes the demuxer as a way to concatenate without re-encoding when formats allow. A static demuxer list can serve a prepared sequence, but it is not a runtime source-switch command.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Rank #3
- 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.
Restarting FFmpeg is the simple fallback if you need to change the command or its inputs, but it does not preserve a single ongoing encoder session. YouTube’s encoder setup instructions explain that the encoder sends content to YouTube using a server URL and stream key, and that ending content ends the stream. Keeping FFmpeg alive avoids deliberately stopping that output; it does not eliminate network, ingest, processing, or account-related interruptions.
Set YouTube ingest parameters and verify stream health
YouTube’s currently published live encoder settings list RTMP/RTMPS ingest, H.264, H.265/HEVC, or AV1 video, frame rates up to 60 fps, AAC or MP3 audio, and CBR. YouTube recommends RTMPS and a two-second keyframe frequency, with a maximum interval of four seconds. Its published bitrate recommendations include:
Rank #4
- 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
| Output | AV1 or H.265/HEVC | H.264 | Source and qualification |
|---|---|---|---|
| 720p at 30 fps | 6 Mbps | 8 Mbps | YouTube Help’s current published guidance, accessed 2026-10-03; recommendation, not a universal requirement. |
| 1080p at 30 fps | 10 Mbps | 14 Mbps | YouTube Help’s current published guidance, accessed 2026-10-03; recommendation, not a universal requirement. |
| 1080p at 60 fps | 12 Mbps | 17 Mbps | YouTube Help’s current published guidance, accessed 2026-10-03; recommendation, not a universal requirement. |
| Stereo audio | 128 Kbps recommended | YouTube Help’s current published guidance, accessed 2026-10-03. | |
| 5.1 audio | 384 Kbps recommended | YouTube Help’s current published guidance, accessed 2026-10-03. | |
These values are recommendations. Choose settings your upload connection can sustain, test before the event, and watch stream health and messages in YouTube Live Control Room. YouTube’s guidance is current as accessed on 2026-10-03 and may change.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot a failed or rough switch
- The concat filter rejects the inputs: Check that every segment has matching counts of audio and video streams, compatible corresponding stream parameters, and timestamps reset to zero. Normalize resolution and other mismatches before joining.
- The next command has no effect: Confirm that the graph contains a configured concat filter with another prepared segment, that the target name and command are correct, and that the installed FFmpeg build includes the required filters and libzmq support.
- Video changes but audio does not, or the transition is out of sync: Join related audio and video together, check stream mapping and each segment’s duration and timestamp reset, then test the complete sequence.
- The stream drops despite FFmpeg still running: A persistent local process cannot prevent upload-network faults or YouTube ingest interruptions. Check YouTube’s stream-health messages and available upload capacity; test again with settings appropriate to the connection.
- The command works on another machine but not this one: Verify the local FFmpeg version and build configuration. Current online FFmpeg documentation may not match an older installed binary.
Or let it run in the cloud
If the goal is to keep uploaded videos playing on a YouTube channel without leaving a home computer on, StreamNeo is a cloud option: upload a recording or playlist, add your YouTube stream key, and go live. Nothing has to stay on at home; it loops uploaded videos, supports any quality up to 4K 60fps at one flat price per slot, and automatically recovers if YouTube drops the stream. It is for uploaded videos, not a live camera feed, and streams to YouTube only. The first day is free with no card. Monthly pricing is $9.99 per month. Start your free day with StreamNeo.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsQuick Recap
Best Value
- 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.
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.




