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 DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
Mountain View desk6 min

MediaMTX HLS to YouTube RTMP Relay Setup: Step-by-Step

Set up an HLS-to-YouTube relay with MediaMTX and a separate encoder, then check compatibility, YouTube ingest settings, and each stage before going live.

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.

To relay an existing HLS live stream to YouTube, configure MediaMTX to pull the HLS playlist, then use FFmpeg or another compatible encoder to read that MediaMTX path and publish it to YouTube using the server URL and stream key from YouTube Live Control Room. MediaMTX handles the incoming source and path; the separate encoder makes the outgoing YouTube connection.

The flow is: HLS source → MediaMTX path → local MediaMTX read URL → FFmpeg/encoder → YouTube RTMPS URL + stream key. The exact encoder command depends on the source codecs, timestamps, target settings, and whether the tracks can be copied or need transcoding. No end-to-end command is established here as tested.

As an Amazon Associate I earn from qualifying purchases.

What MediaMTX does in this relay

MediaMTX is a live media server and proxy that can publish, read, proxy, record, and play back real-time audio and video streams, according to its official project overview. For this setup, it fetches an HTTP(S) HLS playlist as a configured source and makes the resulting path available to a compatible reader. A separate client such as FFmpeg then publishes that read to YouTube.

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

Enabling MediaMTX’s HLS support alone does not configure YouTube as an output destination. YouTube ingest is a distinct connection made by the publishing encoder.

#1 Best Overall
URayCoder HD HEVC H.265 MPEG4 H.264 4K HDMI to Video Streaming IPTV Encoder for HDMI to RTSP RTMP HTTP UDP HLS SRT Facebook YouTube Live Streaming Server
  • 【Innovative Product with Leading Technology】- Equipped with an advanced H.265 /H.264 dual encoding chip, supports 4K UHD (3840x2160) video input and output, with a maximum frame rate of 30fps at 4K resolution and up to 120fps at 2K and lower resolutions, delivering a smooth and detailed visual experience. It also supports HDCP 1.4 decryption, easily decoding various HDMI ultra HD video sources, delivering a cinematic visual experience for both professional live streaming and 4K ultra HD content transmission.
  • 【Multi-protocol and Multi-platform Compatibility】- Fully compatible with streaming protocols such as HTTP, RTSP, RTMP(S), SRT, HLS(M3U8), MP4, Multicast(UDP, RTP, PTL), FLV, WebRTC, TRTC, ICECAST, it can simultaneously output 4 video streams with different protocols and push them to live streaming platforms such as YouTube, Facebook, Twitch, and Vimeo with one click. Simultaneous live streaming across multiple platforms can be achieved without additional equipment.
  • 【Highly Customizable Settings to Meet Individual Needs】- It supports adding static text, scrolling captions, brand logos, and timestamps. Users can freely adjust core parameters such as video resolution, frame rate, and bitrate, and also perform personalized editing functions such as video cropping, rotation, flipping, and mirroring. It supports dual input of HDMI embedded audio and line-in audio, with adjustable sound quality, making your live stream content more distinctive and allowing you to create a unique brand live stream style.
  • 【Stable and Efficient Transmission, Easy Operation】- Employing HDMI to Ethernet core connection technology, it ensures stable and reliable network transmission with low latency and no lag, adapting to various network environments. Equipped with an intuitive user interface and detailed instruction manual, no professional technical background is required; setup can be completed quickly after connecting the device. It is also compatible with multiple terminals such as computers and mobile phones for management, and the video stream status can be viewed in real time via a URL.
  • 【Lifetime Free Warranty and Technical Supports】- All URayCoder video codecs come with a lifetime free warranty and technical supports, supporting secondary development and feature customization to meet enterprise-level personalized needs. Meanwhile, we providing many kinds of customization services such as shell pattern printing, logo addition, hardware and function development, ensuring reliable quality and worry-free after-sales service.

Configure MediaMTX to pull the HLS playlist

Use the source format documented in MediaMTX’s HLS source documentation. Add a named path to the configuration file used by the running MediaMTX instance:

paths:
  youtube_relay:
    source: https://example.com/live/index.m3u8

Replace the example with the actual playlist URL. If the source requires credentials, follow the source’s URL format and encode URL-sensitive characters as MediaMTX advises; do not paste credentials into public configuration examples or logs.

Check the configuration file and process you actually run. The MediaMTX rolling main-branch defaults accessed on October 3, 2026, show HLS on port 8888 and RTMP on port 1935, but a deployed version, configuration override, container port mapping, firewall, or hosting provider can change availability. The path’s read URL and protocol must match the enabled listener and your deployment. See the project’s configuration documentation, HLS reader documentation, and RTMP documentation for the applicable path and reader formats.

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

Get the YouTube ingest URL and stream key

  1. Open YouTube Studio and enter Live Control Room; create or select the live stream you intend to use.

    Rank #2
    UNISHEEN 1080P60 HDMI Video Encoder, H.265/H.264 Live Streaming Encoder, HDMI to RTSP/RTMP/SRT/HLS/WebRTC IPTV Encoder for YouTube Facebook Live, Browser Setup, No PC Software Needed
    • 【Hardware H.265/H.264 Encoding at 1080P60】Dedicated hardware encoder delivers broadcast-quality 1080P60 streams with H.265/H.264 compression. Reduces bandwidth usage by up to 50% compared to legacy H.264-only solutions, while maintaining crisp, crystal-clear video output.
    • 【Broad Protocol Support for IP Distribution】 Supports SRT, RTMP(S), RTSP, UDP, HTTP, HLS, WebRTC, TRTC, Icecast and SHOUTcast — integrate seamlessly with CDNs, surveillance NVRs, IPTV systems and browser-based monitoring dashboards. One device replaces multiple single-purpose streaming boxes.
    • 【Browser-Based Setup in Minutes】 Set up in minutes through any browser — no software, drivers or OS compatibility issues. DHCP is enabled by default to prevent IP address conflicts on your network. Note: basic networking knowledge (IP address, RTSP/RTMP configuration) is recommended for advanced streaming setups.
    • 【Compact Design with Flexible Deployment】Palm-sized form factor (approx. 90×54×29mm) fits easily behind monitors, on shelves, or in equipment racks. Low power consumption ensures reliable 24/7 operation for live events, remote monitoring, and digital signage.
    • 【Professional Audio & OSD Overlay + 1-Year Warranty】 Supports HDMI embedded audio plus external 3.5mm input. Built-in OSD generator adds scrolling text, logos, or timestamps directly to the video stream — ideal for branding, event info, or security labeling. Backed by a 1-year warranty and 24/7 online technical support.
  2. Copy the server URL and stream key shown for that stream. YouTube’s encoder setup guidance says to enter these values into the encoder.

  3. Keep the stream key private. YouTube treats it like a password; avoid exposing it in shell history, logs, screenshots, or public examples. If it is exposed, use YouTube’s stream-key reset workflow.

Prefer RTMPS when supported by the encoder and the server URL YouTube provides. RTMPS encrypts the RTMP connection; use the exact ingest URL supplied by YouTube rather than assuming a fixed hostname or path.

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

Read the MediaMTX path and publish it to YouTube

Once MediaMTX has fetched the source, configure FFmpeg or another encoder to read the MediaMTX path and connect to YouTube with its ingest URL and stream key. For example, the FFmpeg command structure is:

Rank #3
H.265 H.264 4K HDMI to IP Network Video Encoder, 1080P HD Video Audio Encoder Supports RTSP RTMPS UDP HLS SRT HTTP WebRTC ICECAST, for IPTV, Live Streaming, YouTube, Facebook, OBS, ONVIF NVR, etc.
  • ⭐【Innovative Product with Leading Technology】- Equipped with an advanced H.265 /H.264 dual encoding chip, supports 4K UHD (3840x2160) video input and output, with a maximum frame rate of 30fps at 4K resolution and up to 120fps at 2K and lower resolutions, delivering a smooth and detailed visual experience. It also supports HDCP 1.4 decryption, easily decoding various HDMI ultra HD video sources, delivering a cinematic visual experience for both professional live streaming and 4K ultra HD content transmission.
  • ⭐【Multi-protocol and Multi-platform Compatibility】- Fully compatible with streaming protocols such as HTTP, RTSP, RTMP(S), SRT, HLS(M3U8), MP4, Multicast(UDP, RTP, PTL), ONVIF, FLV, WebRTC, TRTC, ICECAST, it can simultaneously output 4 video streams with different protocols and push them to live streaming platforms such as YouTube, Facebook, Twitch, and Vimeo with one click. Simultaneous live streaming across multiple platforms can be achieved without additional equipment.
  • ⭐【Highly Customizable Settings to Meet Individual Needs】- It supports adding static text, scrolling captions, brand logos, and timestamps. Users can freely adjust core parameters such as video resolution, frame rate, and bitrate, and also perform personalized editing functions such as video cropping, rotation, flipping, and mirroring. It supports dual input of HDMI embedded audio and line-in audio, with adjustable sound quality, making your live stream content more distinctive and allowing you to create a unique brand live stream style.
  • ⭐【Stable and Efficient Transmission, Easy Operation】- Employing HDMI to Ethernet core connection technology, it ensures stable and reliable network transmission with low latency and no lag, adapting to various network environments. Equipped with an intuitive user interface and detailed instruction manual, no professional technical background is required; setup can be completed quickly after connecting the device. It is also compatible with multiple terminals such as computers and mobile phones for management, and the video stream status can be viewed in real time via a URL.
  • ⭐【Lifetime Free Warranty and Technical Supports】- All URayCoder video codecs come with a lifetime free warranty and technical supports, supporting secondary development and feature customization to meet enterprise-level personalized needs. Meanwhile, we providing many kinds of customization services such as shell pattern printing, logo addition, hardware and function development, ensuring reliable quality and worry-free after-sales service.
ffmpeg -i "<MediaMTX read URL for youtube_relay>" 
  -c:v copy -c:a copy 
  -f flv "<YouTube RTMPS ingest URL>/<STREAM_KEY>"

This is a command template, not a verified end-to-end command. Replace both placeholders with the correct values and confirm the exact URL form expected by your encoder and YouTube. The -c:v copy -c:a copy option is appropriate only when the incoming video and audio codecs, timestamps, and stream structure are compatible with YouTube’s ingest requirements. If not, remove stream-copy settings and transcode to an accepted format with suitable rate control, keyframes, resolution, frame rate, and audio settings.

MediaMTX’s ability to route a stream does not guarantee that every HLS source can be copied directly into every RTMP(S) destination. Check the HLS tracks and timestamps and the encoder’s output before relying on the relay.

Set encoder output for YouTube Live

YouTube’s current encoder settings and bitrate guidance for RTMP/RTMPS lists H.264, H.265 (HEVC), and AV1 video, AAC or MP3 audio, constant bitrate (CBR), and up to 60 fps. It recommends a 2-second keyframe interval and says not to exceed 4 seconds. YouTube recommends RTMPS where supported.

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

Choose a bitrate for the intended codec, resolution, and frame rate rather than applying a single preset to every source. Selected H.264 recommended bitrate rows in YouTube’s current table, accessed in 2026 (the access year, not a claimed publication year), are:

Rank #4
HEVC MPEG4 H.265 H.264 HDMI to IP Network Video Encoder, 1080P HD Digital Video Audio Encoder Hardware Supports RTSP RTMPS UDP HLS SRT, for IPTV, Live Streaming, YouTube, Facebook, OBS, NVR, etc.
  • ⭐【Innovative Product with Leading Technology】- Equipped with an advanced H.265/H.264 dual encoding chip, supports 1920x1080 resolution input and output, achieving 60fps high-definition presentation with realistic and delicate color reproduction and lossless detail. It also supports HDCP 1.4 decryption, easily decoding various HDMI high-definition video sources, delivering a cinematic visual experience for both professional live streaming and high-definition content transmission.
  • ⭐【Multi-protocol and Multi-platform Compatibility】- Fully compatible with streaming protocols such as HTTP, RTSP, RTMP(S), SRT, HLS(M3U8), MP4, Multicast(UDP, RTP, PTL), ONVIF, FLV, it can simultaneously output 4 video streams with different protocols and push them to live streaming platforms such as YouTube, Facebook, Twitch, and Vimeo with one click. Simultaneous live streaming across multiple platforms can be achieved without additional equipment.
  • ⭐【Highly Customizable Settings to Meet Individual Needs】- It supports adding static text, scrolling captions, brand logos, and timestamps. Users can freely adjust core parameters such as video resolution, frame rate, and bitrate, and also perform personalized editing functions such as video cropping, rotation, flipping, and mirroring. It supports dual input of HDMI embedded audio and line-in audio, with adjustable sound quality, making your live stream content more distinctive and allowing you to create a unique brand live stream style.
  • ⭐【Stable and Efficient Transmission, Easy Operation】- Employing HDMI to Ethernet core connection technology, it ensures stable and reliable network transmission with low latency and no lag, adapting to various network environments. Equipped with an intuitive user interface and detailed instruction manual, no professional technical background is required; setup can be completed quickly after connecting the device. It is also compatible with multiple terminals such as computers and mobile phones for management, and the video stream status can be viewed in real time via a URL.
  • ⭐【Lifetime Free Warranty and Technical Supports】- All URayCoder video codecs come with a lifetime free warranty and technical supports, supporting secondary development and feature customization to meet enterprise-level personalized needs. Meanwhile, we providing many kinds of customization services such as shell pattern printing, logo addition, hardware and function development, ensuring reliable quality and worry-free after-sales service.
Output YouTube H.264 recommended bitrate
720p at 30 fps 8 Mbps
1080p at 30 fps 14 Mbps
1080p at 60 fps 17 Mbps

These are recommendations for those specific YouTube H.264 rows, not universal minimums or a claim that every HLS source can sustain those settings. For other resolutions or codecs, consult the relevant row in YouTube’s table. If you transcode, ensure the encoder actually emits the selected CBR, keyframe interval, and audio settings; stream-copy mode preserves the source rather than applying new encoding settings.

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

Test the relay before depending on it

  1. Confirm the origin. Check that the HLS playlist is reachable and continues to update, and that its media segments are accessible from the machine running MediaMTX.

  2. Confirm the MediaMTX path. Inspect MediaMTX logs and path status for source-fetch errors, then try reading the configured path locally with a compatible client.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  3. Confirm tracks and timestamps. Verify that the encoder can decode the incoming audio and video and that timestamps progress cleanly. Decide whether stream copy is compatible or transcoding is needed.

    Best Value
    URayCoder HEVC H.265 H.264 SD HD 3G SDI to IP Encoder IPTV HD Video Audio Live Streaming Encoder HD-SDI Transmitter with HTTP, RTSP, UDP, SRT, HLS, RTMP, Multicast, Unitcast
    • 【Innovative Product with Leading Technology】- This URayCoder video encoder is ideal for broadcast video and audio, support live broadcast for Youtube, Facebook, Ustream, Livestream, Twitch, Vimeo, Streamspot, Dacast, Tikilive, Netrmedi, etc.
    • 【Multiple Video Stream Output】- Supports output 4 video streams simultaneously, and each video stream can use different streaming protocols. You can push these video streams to different streaming servers at the same time.
    • 【Multiple Streaming Protocols】- Support HTTP, RTSP, RTMP(S), SRT, HLS(M3U8), UDP, RTP, MP4, Multicast, Unitcast, FLV, ONVIF and other streaming protocols. Choose between multiple video streaming types to reduce bandwidth consumption or enhance image quality.
    • 【Multiple Video Stream Settings】- You can add static text, scrolling text, logo or time to the output video streams to customize the displayed video. Of course, you can also adjust other parameters, such as resolution, frame rate, bitrate, etc., and even crop, rotate, flip, and mirror. The output audio is also adjustable.
    • 【Free Lifetime Support and Service】- All URayCoder video encoders and video decoders include free lifetime technical support and warranty. We also provide SDK and API as well as CGI control protocol documents for secondary development. At the same time, we provide a variety of customizations, such as shell pattern printing, control panel logo addition, firmware or hardware function development, etc.
  4. Confirm the outbound connection. Check the exact YouTube URL, stream key, outbound network access, and RTMPS support. Treat authentication and connection errors separately from source-fetch errors.

  5. Check YouTube’s preview and stream health. Verify that the feed appears in Live Control Room, inspect its preview and health indicators, and check audio, motion, resolution, and frame rate before making the broadcast public or relying on it.

Troubleshoot by stage

Symptom Likely area to check What to do
MediaMTX never shows the path as ready HLS URL, credentials, playlist or segment reachability, network rules Open the playlist from the MediaMTX host, verify any authentication and URL encoding, and inspect MediaMTX logs for fetch failures.
The path is ready but the reader cannot open it Read URL, listener, port mapping, firewall, path name Use the protocol and path format supported by the running configuration; verify the listener is enabled and reachable from the encoder host.
FFmpeg opens the path but reports decode or timestamp errors Source tracks, codec support, discontinuities, timestamps Inspect the incoming tracks and timestamps. Try a compatible transcode rather than stream-copying if the input format or timing is unsuitable.
YouTube does not receive the feed Destination URL, key, transport, outbound connectivity Copy the current server URL and key from Live Control Room, confirm RTMPS is supported by the encoder, and check firewall or provider egress rules.
YouTube receives video but flags poor or incompatible output Codec, CBR, bitrate, keyframe interval, audio, resolution or frame rate Compare the encoder output—not only the source—to YouTube’s current settings and bitrate table; adjust or transcode as needed.

Do not confuse HLS input with YouTube HLS ingest

In this workflow, HLS is the incoming source format and RTMP(S) is the YouTube destination. YouTube also supports HLS ingest as a separate destination mode with its own segment and upload constraints. YouTube says that segmented HLS delivery has higher latency than RTMP; see its HLS ingest instructions if you specifically want to send HLS to YouTube rather than RTMP(S).

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

Keep a YouTube stream running without maintaining this relay at home

A MediaMTX-plus-encoder relay needs an always-on host with the required network access. That can be a suitably configured server; availability and cost depend on the hosting arrangement, and this setup has no established benchmark or guaranteed uptime.

Or let it run in the cloud

For a pre-recorded video or playlist that should loop as a YouTube live stream, StreamNeo is a cloud alternative: upload the video, add your YouTube stream key, and go live. Nothing has to stay on at home. It streams the uploaded file as made, up to 4K 60fps, at one price per slot regardless of quality; it can automatically recover if YouTube drops the stream. The first day is free with no card. Monthly pricing is $9.99 per month. StreamNeo streams to YouTube and plays uploaded videos; it is not a live camera relay. See StreamNeo or its plans. 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.

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 Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.