If YouTube reports an unsupported codec when you send a prerecorded file through GStreamer, the fix depends on which part of the pipeline is rejecting it. For the common RTMP/RTMPS workflow, decode the file, convert its audio and video to compatible raw formats, encode video as H.264 and audio as AAC, then mux them into FLV for the RTMP sink. First confirm the selected YouTube ingest protocol: YouTube documents HLS as a separate option for codecs RTMP does not support and for HDR workflows.
What “unsupported codec” can mean
The message alone does not identify the cause. It may refer to YouTube’s ingest protocol, a codec in the source file, a missing local GStreamer decoder or encoder, or a negotiation failure between GStreamer elements. The exact error text, input container and codecs, GStreamer version, installed plugins, and chosen ingest protocol are needed to determine which case applies.
For RTMP/RTMPS, think of the conversion as a chain: prerecorded file → demux and decode → raw audio/video → convert → encode for the ingest protocol → mux → network sink. YouTube’s current live encoder guidance lists H.264, H.265/HEVC, and AV1 video and AAC or MP3 audio for RTMP/RTMPS, and recommends RTMPS. The pipeline below uses the familiar H.264/AAC combination. Check YouTube’s live encoder settings guidance for current requirements for your stream mode.
Convert a prerecorded file for RTMP/RTMPS
This illustrative launch pipeline decodes a local file, encodes video as H.264 and audio as AAC, muxes the streams into FLV, and sends the result to YouTube over RTMPS. Replace the file URI and endpoint with your own values. Never publish a real stream key or leave it visible in logs or screenshots.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11#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.
gst-launch-1.0 -e
uridecodebin uri="file:///path/to/input.mkv" name=d
flvmux name=mux streamable=true !
rtmpsink location="rtmps://a.rtmp.youtube.com/live2/REDACTED_KEY live=1"
d. ! queue ! videoconvert ! x264enc ! mux.
d. ! queue max-size-time=5000000000 max-size-bytes=0 max-size-buffers=0 !
audioconvert ! audioresample ! voaacenc ! mux.
This is a starting shape, not a command guaranteed to work unchanged on every operating system, GStreamer build, or media file. It assumes the file has both audio and video, that matching decoder and encoder plugins are installed, and that the selected YouTube ingest protocol accepts the output. If the file has only one stream, remove the branch for the absent stream.
Check the required elements
Element availability depends on the GStreamer version and how it was packaged. Check the machine that will run the pipeline rather than assuming an element is installed:
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.
gst-inspect-1.0 uridecodebin
gst-inspect-1.0 x264enc
gst-inspect-1.0 voaacenc
gst-inspect-1.0 flvmux
gst-inspect-1.0 rtmpsink
Remove the leading space before each command after the first if you copy these lines into a shell. If voaacenc is unavailable, inspect the installed AAC encoders and use one whose output caps can negotiate with flvmux. A missing decoder is a separate issue: uridecodebin can only select decoders provided by installed plugins.
Understand the branches and muxer
uridecodebin discovers and decodes streams from the URI. The two dynamic pads are linked to separate branches: video passes through videoconvert and x264enc; audio passes through audioconvert, audioresample, and the AAC encoder. flvmux combines the encoded streams into FLV, and rtmpsink sends that output to the RTMP server. The GStreamer FLV muxer expects H.264 in AVC stream format. Consult the official references for flvmux and rtmpsink if caps or sink behavior are unclear.
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.
For a file with multiple audio or video tracks, a production application should select streams and handle dynamic pads explicitly. The launch example is convenient for demonstrating the shape, but it is not a full stream-selection policy.
Handle startup stalls and queue errors
GStreamer documents that x264enc can buffer for multiple seconds before producing output. A multi-branch pipeline can therefore stall if the audio branch’s queue fills while video encoding is still buffering. The example gives the audio queue more time capacity. If startup or preroll still fails, inspect the complete bus error and queue behavior rather than removing queues blindly.
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
tune=zerolatency is another possible encoder setting for live use, but it trades away some encoding quality. Do not copy bitrate, profile, GOP, resolution, or keyframe values without checking current YouTube guidance and matching the requirements of the particular stream.
Diagnose the problem in order
- Capture the full error. Record YouTube’s complete encoder report and GStreamer’s full bus error. The phrase “unsupported codec” by itself does not establish which component failed.
- Confirm the ingest protocol. Match the output format to the protocol selected in YouTube Live Control Room. YouTube’s HLS setup guidance describes a distinct HLS workflow for codecs not supported by RTMP and for HDR. Changing a codec inside an RTMP/FLV pipeline does not turn it into an HLS sender.
- Inspect the input streams and local decoders. Use GStreamer discovery or a playback pipeline to establish which audio and video streams are present and whether suitable decoders are available.
uridecodebincannot decode a format for which the installation has no decoder. - Check element capabilities and negotiated caps. Run
gst-launch-1.0 -vto see negotiated caps, andgst-inspect-1.0 ELEMENTto inspect an element’s installed pad capabilities. Caps filters can constrain formats, but add one only where you know the required target format. - Verify the RTMP output path. Confirm encoded video negotiates with
flvmux, the muxed output reachesrtmpsink, and the endpoint and stream key are correct. For an RTMP workflow, YouTube recommends the secure RTMPS option. - Switch workflow only if the protocol requires it. If the intended codec or HDR mode belongs in YouTube’s HLS workflow, use an HLS-capable sender and follow that setup rather than expecting RTMP/FLV to carry it.
Choose between pass-through, transcoding, and HLS
| Approach | When it fits | What to verify |
|---|---|---|
| Pass through compatible encoded streams | The source codecs, container, and chosen muxer already agree with the selected ingest path. | Check that the pipeline can link the existing streams to the muxer and sink without conversion. Do not assume every file can safely be passed through. |
| Decode and re-encode for RTMP/RTMPS | The source is incompatible with the RTMP pipeline, but the output can use codecs and muxing supported by that path. | Verify installed decoders and encoders, caps negotiation, FLV muxing, and the current YouTube encoder guidance. Transcoding uses compute and can reduce quality. |
| Use YouTube HLS ingest | The required codec is not supported by RTMP or the workflow requires HDR. | HLS is a different ingest workflow. Confirm that your sender supports YouTube’s HLS setup and use the corresponding muxing and delivery method. |
Or let it run in the cloud
If the goal is to keep uploaded prerecorded video running as a 24/7 YouTube stream, StreamNeo is a separate cloud option rather than a GStreamer conversion fix. Upload a recording or build a playlist, add your YouTube stream key, and go live; the cloud keeps the stream running without a computer or home connection staying on. It does not stream from a camera.
Recommended Free Tools
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.
- Nothing has to stay powered on at home.
- Uploaded video streams as made, up to 4K 60fps, at one price per slot rather than quality tiers.
- Automatic recovery is included if YouTube drops the stream.
- The first day is free with no card required, one free day per account.
- Monthly: $9.99 per month.
See StreamNeo for service details, then start the free day.
Quick Recap
Sources and further reading
- YouTube Help: Choose live encoder settings, bitrates, and resolutions
- YouTube Help: Set up an HLS stream
- GStreamer Basic tutorial 10: GStreamer tools
- GStreamer Basic tutorial 14: Handy elements
- GStreamer flvmux reference and rtmpsink reference
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.




