October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
FFmpeg

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

Use FFmpeg on a VPS to play mixed MP4 and MKV files to YouTube Live. Learn how to inspect codecs, build a concat playlist, set encoder output, and test the stream.

By VGSources Team 8 min read

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.

Use FFmpeg on the VPS to play an ordered playlist of MP4 and MKV files into YouTube Live. The file extensions are only containers: first check that the video and audio streams inside each file are compatible. Then create a concat list, send it in real time to the RTMPS ingest URL and stream key from YouTube Live Control Room, and test the transitions before going public.

Check YouTube live-streaming access first

YouTube’s general onboarding guidance says a channel needs to be verified, must not have a live-streaming restriction in the previous 90 days, and the person live-streaming must be at least 16. Confirm eligibility for the specific channel in YouTube Studio before setting up the VPS. YouTube’s live-streaming setup guidance is the place to check the current requirements.

Inspect the MP4 and MKV files

MP4 and MKV describe containers, not the codecs or track layouts inside them. Two files with different extensions may have compatible streams; two files with the same extension may not. The FFmpeg concat demuxer expects corresponding streams to have the same codecs and time bases. Check video, audio, dimensions, frame rate, and duration rather than inferring compatibility from the filename.

Inspect representative files with ffprobe

Run this for each file, or at least for each distinct type of file in the playlist, including files with different audio tracks:

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

ffprobe is distributed with FFmpeg. If the streams differ in ways that prevent concatenation or do not suit the intended YouTube output, create normalized copies with consistent video and audio codecs, dimensions, frame rate, and audio layout. Normalization is not required just because the extensions differ; it is a remedy for actual incompatibilities or output requirements.

Know what stream copy can and cannot do

With compatible inputs, FFmpeg’s -c copy passes the compressed streams through without decoding or re-encoding. That reduces CPU use and avoids another lossy encode, but it cannot resize, filter, or convert codecs. It may also fail if a target container cannot represent required source information. Transcoding decodes and re-encodes the media, which takes more CPU and can reduce quality; use it when the inputs need conversion or normalization.

Create an ordered FFconcat playlist

Put the files in the order they should play and create a plain-text playlist such as:

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.
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. Keep paths simple and relative when possible: the concat demuxer’s safe-path behavior rejects unsafe paths and directives by default. Paths containing spaces or special characters need appropriate quoting or escaping.

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

Check the joins, not just the playlist order

The concat demuxer reads files sequentially and adjusts timestamps so the first begins at zero and following files start after the preceding file’s duration. This is not an edit that guarantees seamless transitions. Unequal audio and video lengths, inaccurate duration metadata, or incompatible streams can create gaps or artifacts. Test transitions with representative files. The list supports a duration directive if duration metadata is inaccurate, but validate any adjustment with a test before relying on it.

Get the YouTube ingest URL and protect the stream key

  1. In YouTube Studio, open the Live Control Room and create or schedule the stream.
  2. Copy the stream URL and stream key shown for the broadcast. The key identifies where the encoder sends its feed and allows YouTube to accept it.
  3. Choose the RTMPS URL shown in Live Control Room. YouTube describes RTMPS as RTMP over TLS/SSL and recommends it; do not assume the default RTMP URL is interchangeable with RTMPS.
  4. Store the URL and key securely. Do not expose the key in a public repository, screenshot, log, or shared shell history. Use the exact endpoint format YouTube provides; do not blindly append a key if the displayed URL already includes the needed path.

YouTube’s encoder setup instructions explain where to find the stream URL and key.

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.

Choose YouTube-compatible video, audio, and network settings

YouTube’s encoder guidance, verified on 2026-10-03, lists RTMP/RTMPS ingest, H.264, H.265, or AV1 video, frame rates up to 60 fps, constant bitrate (CBR), and AAC or MP3 audio for RTMP/RTMPS. It recommends a keyframe every two seconds and says not to exceed four seconds. Its advanced recommendations include 44.1 kHz stereo audio and 128 Kbps stereo audio; for standard SDR, it lists Rec. 709 and 8-bit. Choose settings that match the source, encoder build, and intended broadcast. See YouTube’s current encoder settings guidance before configuring a long stream.

Published H.264 video-bitrate recommendations

Output YouTube-recommended H.264 video bitrate
1080p at 30 fps 14 Mbps
720p at 30 fps 8 Mbps

These are YouTube’s published H.264 video-bitrate recommendations, verified on 2026-10-03; they do not include audio or protocol overhead. Add those to estimate total outbound traffic. YouTube recommends 20% upload-bandwidth headroom, so the VPS must be able to sustain more than the configured total bitrate continuously. An advertised port speed alone does not establish sustained throughput. See YouTube’s bitrate and encoder settings guidance and its network guidance.

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

Start FFmpeg on the VPS

For a compatible playlist that already has suitable codecs, this is a schematic stream-copy command:

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

This is an illustrative command, not a tested configuration. -re reads the input at its native rate, which is useful when the feed must flow in real time. The maps assume every input has a first video and first audio stream; change or omit them if track layouts differ. Check the installed FFmpeg build and use the exact URL/key arrangement displayed in Live Control Room. FFmpeg documents the concat demuxer and real-time input options in its formats documentation and command-line documentation.

When the inputs need transcoding

If the files differ in codec, dimensions, frame rate, or audio layout, replace -c copy with explicit video and audio encoders and parameters for one common output. H.264 video with AAC audio is a conventional SDR target, but set the output resolution, frame rate, bitrate, keyframe interval, and audio parameters to the applicable YouTube guidance. Encoding can be CPU-intensive on a VPS; benchmark a representative segment and leave CPU capacity for sustained operation.

Plan looping and restarts separately

The command above does not loop the playlist forever or automatically recover after a network drop. Configure and test repeat playout for the installed FFmpeg version, including what happens at end-of-list, between files, and if the connection fails. FFmpeg’s FIFO muxer has separate recovery behavior, but that does not make recovery part of the simple command shown here.

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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Test the preview and monitor the VPS

  1. Start with a private or otherwise appropriate test broadcast and wait for the encoder feed to appear in Live Control Room.
  2. Include movement and audio representative of the intended stream. Check the preview, stream-health messages, and sound before making the broadcast public.
  3. Watch the playlist transitions for picture gaps, silence, unexpected tracks, or timestamp problems.
  4. During the stream, monitor the VPS’s outbound throughput, CPU load if transcoding, and disk reads. Keep total output below available sustained upload capacity with YouTube’s recommended headroom.

YouTube advises testing before a live event and checking preview and stream health. Its network guidance also covers upload capacity.

Choose between stream copy and normalization

Approach Use it when Trade-off or check
Concat demuxer with stream copy Corresponding streams, codecs, and time bases match, and the source output is suitable. Low CPU use and no re-encode loss; duration or stream mismatches can cause failure, gaps, or artifacts.
Normalize and transcode first Sources differ materially or need scaling, frame-rate conversion, or audio conversion. Requires more CPU and another encode may be lossy; test VPS capacity and output quality.
RTMPS ingest YouTube Live Control Room provides an RTMPS endpoint for the encoder. Use the copied endpoint and keep the key private.

Troubleshoot common failures

  • Concat reports stream or codec errors: compare ffprobe output across files. Normalize incompatible streams or use a different playback workflow; the MP4/MKV extension is not the compatibility test.
  • Black video or missing audio: confirm that each file actually has the mapped stream, then adjust -map for the actual track layout. Check that the selected codecs are supported by the chosen output and ingest path.
  • Gaps, glitches, or out-of-sync transitions: inspect stream lengths and duration metadata, then test the joins. The concat demuxer places each next file using the prior file’s duration; inaccurate durations or unequal stream lengths can disrupt timing.
  • YouTube does not receive the feed: re-check the copied RTMPS URL and stream key in Live Control Room, confirm the key has not been replaced, and review FFmpeg’s connection output. Do not publish the key while debugging.
  • Buffering, dropped frames, or unstable ingest: compare total video, audio, and overhead against sustained VPS outbound capacity. Reduce the output bitrate or resolution if needed, and retain the recommended 20% upload headroom.
  • VPS CPU stays saturated: if transcoding, reduce encoding workload or output demands and test again; stream copy may be an option if the input streams are already compatible and suitable.
  • Playback stops at the last file or after a disconnect: configure looping and restart/recovery separately, then test end-of-list and network-failure behavior. The sample command does not provide either automatically.

Or let it run in the cloud

If the goal is a YouTube channel that keeps uploaded videos playing around the clock, StreamNeo is a cloud alternative to maintaining FFmpeg on a VPS. 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 computer, OBS, or home connection has to stay on. StreamNeo plays uploaded videos, not a live camera feed, and streams to YouTube only.

Each slot has one always-on stream, 10 GB storage per slot pooled across active slots, playlists and 24/7 looping, automatic recovery if YouTube drops the stream, and StreamNeo team support. Videos stream as uploaded, up to 4K 60fps, with one flat price per slot rather than quality tiers. The first day is free with no card, one free day per account. Billing options are a day, week, month, six months, or year, and you can cancel any time. UPI and cards are available in India; card checkout is available worldwide. For five or more slots, contact support.

Monthly: $9.99 per month. Start your free day with StreamNeo.

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

Copyright and YouTube monetization considerations

A technically valid feed does not establish that you have the rights to broadcast the videos or that a channel will qualify for monetization. Use media you own or are licensed to stream, and check YouTube’s copyright and monetization policies for the channel and content. Repeating a playlist does not itself establish originality or eligibility. Before scheduling a long broadcast, review the copyright safety checklist.

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.

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
Outdated Drivers Are Slowing You DownFree scan - exact matches
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.