DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
DocumentaryTube
FFmpeg

How to Stream Mixed MP4 and MKV Files to YouTube Live from a VPS

A practical FFmpeg workflow for streaming an ordered MP4 and MKV playlist from a VPS to YouTube Live, including compatibility checks, RTMPS setup, bitrate planning, testing, and troubleshooting.

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

Yes. You can broadcast a sequence of MP4 and MKV files from a VPS to YouTube Live with FFmpeg. The important detail is that MP4 and MKV are containers, not guarantees that the files contain compatible audio and video streams. Inspect the codecs and track layout, then either concatenate compatible files or normalize them to a common format before sending the feed to YouTube over RTMPS.

Before you start: check channel access and your VPS

YouTube’s general live-streaming requirements, verified on October 3, 2026, say that a channel must be verified, must not have a live-streaming restriction in the previous 90 days, and the person going live must be at least 16. Eligibility applies to the channel, so confirm access in YouTube Studio before preparing the broadcast. See YouTube’s live-streaming access guidance.

  • A VPS with the media files available on disk and enough sustained outbound bandwidth for the chosen bitrate.
  • FFmpeg, including ffmpeg and ffprobe, installed on the VPS. Commands below are illustrative; verify behavior with your installed build and test your own files.
  • A YouTube stream created or scheduled in Live Control Room, with its stream URL and key available.
  • Enough disk space and, if transcoding, CPU capacity to read and encode the files continuously.

Inspect the files: extension is not enough

MP4 and MKV describe containers. They do not tell you whether the video is H.264, HEVC, or another codec; whether audio tracks match; or whether dimensions, frame rates, and time bases are compatible. FFmpeg’s concat demuxer expects the files to have the same streams, codecs, and time bases. If those differ, direct concatenation may fail or produce problems; normalize the files first when needed. FFmpeg explains the concat demuxer and its constraints in its format documentation.

Inspect each file, including examples from both containers and any files with unusual audio tracks or subtitles:

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.
ffprobe -hide_banner -i "episode.mp4"

Review the video and audio stream details, frame rate, dimensions, and duration. Do not infer them from the filename extension. FFmpeg’s stream-copy documentation explains that copying compressed streams avoids decoding and re-encoding, but cannot apply filters or convert codecs and may not work when stream or container requirements are incompatible.

Choose whether to copy or normalize

  • Use stream copy when the files have compatible streams and YouTube accepts the codecs. It avoids another encode, reduces CPU work, and does not add a lossy generation.
  • Normalize or transcode first when files differ in codec, dimensions, frame rate, or audio layout, or when the source encoding does not meet your chosen YouTube output settings. Transcoding decodes and re-encodes, uses more CPU, and can reduce quality. Test a representative segment and leave CPU headroom.

Create the ordered playlist

Put compatible files in the intended order in a plain-text playlist. For files in one directory with simple relative names, it can look like this:

ffconcat version 1.0
file 'part-01.mp4'
file 'part-02.mkv'
file 'part-03.mp4'

The first line must be exactly ffconcat version 1.0 for automatic format recognition. Save the list as playlist.ffconcat alongside the files, or adjust the relative paths. FFmpeg’s concat demuxer uses safe relative paths by default and rejects unsafe paths or directives unless configured otherwise. Keep filenames simple, and escape or quote paths containing spaces or special characters according to FFmpeg’s documentation.

The demuxer places files sequentially and adjusts timestamps using their durations. That is not the same as editing them into a guaranteed seamless sequence: inaccurate duration metadata or streams of unequal length can create gaps or artifacts. Test transitions. The playlist format supports a duration directive when a duration needs correction, but validate any adjustment in a test run.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

Configure YouTube Live and protect the stream key

  1. Open YouTube Studio and create or schedule a broadcast in Live Control Room.
  2. Copy the stream URL and stream key shown for that broadcast. YouTube describes the key as the value that identifies where the encoder sends the feed and allows YouTube to accept it. See YouTube’s encoder setup instructions.
  3. Choose the RTMPS ingest URL shown in Live Control Room. YouTube recommends RTMPS, which adds TLS/SSL encryption to RTMP; do not assume the default RTMP URL and RTMPS URL are interchangeable. See YouTube’s streaming settings guidance.
  4. Keep the key private. Do not put it in a public repository, screenshot, log, or shell command saved in shared history. Restrict access to any configuration that contains it.

Use the exact endpoint and key format shown in Live Control Room. Some endpoint displays already include path components, so do not append a path or key blindly.

Choose encoder settings and check bandwidth

YouTube’s encoder guidance, verified October 3, 2026, lists RTMP/RTMPS ingest; H.264, H.265, or AV1 video; up to 60 fps; constant bitrate (CBR); a recommended two-second keyframe interval, not exceeding four seconds; and AAC or MP3 audio for RTMP/RTMPS. Its advanced recommendations include 44.1 kHz stereo and 128 Kbps stereo audio. For standard SDR, it lists Rec. 709 and 8-bit. Match output settings to the source where practical and confirm the current guidance in YouTube’s encoder settings.

For H.264, YouTube’s currently published recommended video bitrates include 14 Mbps for 1080p at 30 fps and 8 Mbps for 720p at 30 fps. These are video figures, not total network use. Add audio bitrate and protocol overhead, then allow the 20% upload headroom YouTube recommends. The total must remain below the VPS’s sustained outbound capacity, not merely its advertised port speed. See YouTube’s bitrate guidance and network guidance.

Use the bitrate row for your actual resolution and frame rate rather than treating the examples above as universal settings. If the VPS cannot sustain the selected output rate, reduce the target or choose a server with adequate network capacity. If you transcode, confirm that the VPS can encode at the required rate without falling behind.

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.
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.

Send the playlist to YouTube with FFmpeg

For compatible inputs and a first video and audio stream in every file, this illustrative command reads the playlist in real time and copies the streams into an FLV output for the YouTube ingest endpoint:

ffmpeg -re -f concat -safe 1 -i playlist.ffconcat 
  -map 0:v:0 -map 0:a:0 -c copy 
  -f flv "$YOUTUBE_RTMPS_URL/$YOUTUBE_STREAM_KEY"

Set YOUTUBE_RTMPS_URL and YOUTUBE_STREAM_KEY from the values in Live Control Room, adjusting the endpoint syntax to match exactly what YouTube displays. The -re input option reads at native frame rate, which is useful when sending media at live speed. The stream maps select the first video and audio streams; change or omit them if your files use different track layouts. The example is not a tested command and may require changes for your FFmpeg build, input files, or endpoint.

If you need to transcode, replace -c copy with explicit video and audio encoders and parameters. H.264 video with AAC audio is a conventional SDR target, but set dimensions, frame rate, bitrate, CBR behavior, and keyframe interval to match your chosen YouTube settings. Check FFmpeg’s documentation and YouTube’s current encoder guidance rather than relying on unspecified defaults.

Looping, continuity, and recovery

The command above sends one playlist; it does not guarantee infinite looping, automatic restart at the end, or recovery after a dropped connection. Configure and test your chosen repeat or process-supervision approach for the installed FFmpeg version. Check what viewers see at the end of the list, between files, and after a network interruption before relying on unattended operation. FFmpeg documents a FIFO muxer with separate recovery behavior, but that is not automatic recovery provided by the simple command above.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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

A sequential concat playlist may also have visible or audible discontinuities between files even when it runs successfully. Check representative transitions for gaps, abrupt audio changes, missing tracks, or timestamp issues. If a transition is unacceptable, normalize or edit the source files rather than assuming concatenation will make an invisible join.

Test the feed and monitor the broadcast

  1. Start a test with representative motion and sound, as YouTube recommends.
  2. Wait for the encoder feed to appear in Live Control Room preview. Check stream health messages before starting a public broadcast.
  3. Verify picture, sound, resolution, frame rate, and transitions. Check that the selected audio stream is present in every file.
  4. During the broadcast, monitor YouTube’s stream health and playback as well as VPS network egress, CPU load if encoding, and disk reads.
  5. If the feed drops, diagnose the ingest connection and FFmpeg process; the illustrative command does not restart itself or reconnect by guarantee.

YouTube recommends testing before going live, keeping total bitrate within available upload capacity, and leaving 20% bandwidth headroom. Its testing and stream-health guidance is available in YouTube’s live encoder help and network recommendations.

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

Common problems and fixes

Symptom Likely cause What to check
Concat reports mismatched streams or fails at a file boundary Inputs differ in stream layout, codecs, or time bases. Inspect each file with ffprobe. Normalize incompatible inputs to a common set of streams before concatenating.
Black frames, silence, or missing tracks The mapped first video or audio stream is absent or is not the intended track in one or more files. Inspect stream indexes in every input and change the -map options or normalize track layouts.
Gaps, artifacts, or an abrupt join Unequal stream lengths, inaccurate duration metadata, or a discontinuity in source material. Test transitions, check durations, and validate any playlist duration adjustment.
YouTube does not receive the feed Wrong endpoint or key, an incorrectly combined URL, or a connection problem. Copy the RTMPS URL and key from the correct Live Control Room broadcast; follow the endpoint format displayed there and check the encoder output.
Buffering or unstable stream health Outbound capacity is insufficient or inconsistent for the total bitrate. Include audio and overhead, leave YouTube’s recommended 20% headroom, and check sustained VPS egress.
Encoding falls behind or the VPS becomes overloaded Transcoding demand exceeds available CPU capacity. Test a representative segment, monitor CPU, reduce encoding demands if appropriate, or use compatible stream copy.
Broadcast ends when the playlist finishes or the connection drops The process is running a one-pass command without a tested loop or recovery arrangement. Configure and test looping and process supervision separately; do not assume the simple command reconnects or restarts automatically.

Or let it run in the cloud

If the goal is simply to keep uploaded videos playing as a YouTube Live stream, StreamNeo is an alternative to operating FFmpeg on a VPS. Upload your recording or build a playlist, add your YouTube stream key once, and go live. It plays uploaded videos, not a live camera feed.

  • Your computer and home connection do not have to stay on; the stream runs in the cloud.
  • Each slot streams files as uploaded, up to 4K 60 fps, at one flat price per slot, with no re-encode or quality tiers.
  • Automatic recovery is included if YouTube drops the stream.
  • The first day is free, with no card required.

The monthly option is $9.99 per month. Each slot includes one always-on stream, 10 GB storage per slot pooled across active slots, 24/7 looping and playlists, and StreamNeo team support. StreamNeo offers daily, weekly, monthly, six-month, and yearly billing; cancel any time. UPI and cards are accepted in India, and card checkout is available worldwide. For five or more slots, contact support. See StreamNeo for details. Start the free first day.

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.

Frequently Asked Questions

Can a YouTube Live stream use both MP4 and MKV files?

Yes, if FFmpeg can read the files and their streams are compatible for the method you choose. The extensions alone do not establish compatibility.

Does this FFmpeg command loop the playlist forever?

No. It sends one playlist pass. Looping and restart behavior must be configured and tested separately.

Can I use stream copy if the files have different video codecs?

Not reliably with the concat demuxer’s compatibility requirements. Inspect the streams and normalize incompatible files before concatenating.

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 the Screening Room

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

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.