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

You can loop a bhajan video with FFmpeg, publish it to MediaMTX, and have MediaMTX forward it to YouTube over RTMPS. The setup needs a source containing both audio and video, a current YouTube ingest URL and a private stream key. Test the complete path before relying on it: YouTube may not archive a stream longer than 12 hours, and rewind can be limited on very long streams.

How the setup works

FFmpeg reads and loops your media file, then publishes it to a MediaMTX path. MediaMTX forwards that path to YouTube Live using RTMPS. MediaMTX describes itself as a server and proxy for publishing, reading, recording and playing back real-time video and audio; the documentation covers both RTSP and RTMP publishing. This is a self-hosted workflow: the machine running FFmpeg and MediaMTX, and its internet connection, must remain available for the stream to continue.

The steps below use the RTSP publishing example documented by MediaMTX. They are a starting point, not a guarantee that every media file will play or loop seamlessly. Check that your source has compatible audio and video, then test the output.

Prepare the bhajan media and YouTube channel

Confirm you can broadcast the recording

Use recordings and compositions you have the right to broadcast. Having an MP4 file does not establish permission to stream its contents. YouTube’s live settings and policies apply to the channel and stream; technical configuration cannot resolve rights questions for a particular recording.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
FIFINE Ampligame SC3 Gaming Audio Mixer with Indi-Fader and Volume Control
  • [XLR Mic Input] One XLR microphone input interface is set on the gaming audio mixer, which is great to up your audio quality with your XLR setup. The XLR mixer is a stepping stone to upgrade your live streaming. Audio mixer offered built-in 48V phantom power which opens up more choices for mics. Directly use it with your condenser microphone but do not solve added peripherals. (NOT available for USB mic)
  • [Individual Channel Control] Gaming audio mixer for one mic recording with smooth volume slider fader take your streaming recording to a whole new level with full pleasure. Four independent channels set on the DJ mixer give audio volume of the MICROPHONE, LINE IN, HEADPHONE, and LINE OUT channels individual control. Configurable on the PC audio mixer instead of just operating on your game or streaming software.
  • [Mute and Monitor] The front mute and monitor buttons but not at the back, make it easier to get the audio interface use. Ability to mute audio, the audio mixer for streaming prevents background noise from damaging your live broadcast. Real-time feedback between speaking and hearing will not distract your attention, which encourage you to speak more confidently. The sturdy-built control button allow you to operate freely and easily during live streaming.
  • [Sound Effects] The computer sound mixer supports four pre-recorded customized button that can be recorded and activated at the press of button to post production. 6 kinds of voice changing modes change your output style. 12 auto tune changes the tone of your voice. The podcast mixer being able to add different and fun effects is a huge bonus for your streaming or game voice.
  • [Controllable Vibrant RGB] RGB button on the audio mixer DJ meets different live streaming themes. Lights on the video mixer is vibrant but not harsh on your eyes. Flowing or frozen RGB color rotation in a decent pace presents a greatly strong impression as a "light show" to your audience. Even a streaming equipment accessory will not be dull looking when video production.

Get the current ingest details

  1. Open YouTube Live Control Room for the channel and create or select the live stream.
  2. Copy the current ingest URL and stream key shown there. Do not rely on an endpoint copied from an old example: YouTube’s ingest details can change.
  3. Keep the stream key private. Treat it like a password; do not put it in a public repository, screenshot, tutorial, or configuration shared with others. If it is compromised, reset it in Live Control Room.

Use RTMPS where available. YouTube recommends RTMPS, which carries RTMP over TLS/SSL. MediaMTX’s forwarding guide shows the destination written as an RTMPS URL followed by # and the stream key.

Loop a video into MediaMTX with FFmpeg

Install FFmpeg and MediaMTX on the machine that will run the channel. Start MediaMTX with its configuration, then publish a file to a path named mystream using FFmpeg’s real-time pacing and infinite looping:

ffmpeg -re -stream_loop -1 -i file.mp4 -c copy -f rtsp rtsp://localhost:8554/mystream

Replace file.mp4 with the path to your media file. The command uses -re to read at real-time pace, -stream_loop -1 to repeat the input indefinitely, and -c copy to pass through the existing streams without re-encoding. The RTSP destination uses MediaMTX’s documented local address and port; change it if your deployment uses a different host or configuration.

Stream-copying avoids an encode step, but it also means FFmpeg is not converting the source to a YouTube-compatible format. Verify the file’s codecs, audio and video tracks, resolution, frame rate and bitrate before using this command. If the source streams are incompatible with YouTube’s current guidance, configure encoding rather than assuming -c copy will make them compatible.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Behringer XENYX 802S Premium Analog 8-Input Mixer with USB Streaming Interface
  • Analog mixing and equalization for pure sound
  • Direct mixing of PC/gaming sounds into the streaming output
  • Ultra-low noise analog mixer for streaming, podcasting and recording
  • Stereo USB audio interface to connect your computer or mobile device

Configure MediaMTX to forward the path to YouTube

Add a forwarding destination for the MediaMTX path that receives the FFmpeg publication. The configuration shape below follows MediaMTX’s forwarding guide; replace both placeholders with the current ingest URL from Live Control Room and the channel’s stream key:

paths:
  mypath:
    forward:
      - dest: rtmps://CURRENT_YOUTUBE_INGEST_URL#STREAM_KEY

Use the same MediaMTX path name for the FFmpeg publication and the forwarding configuration. For example, if the FFmpeg command publishes to /mystream, configure the corresponding MediaMTX path for that stream rather than leaving a mismatched example name. Confirm the configuration format against the MediaMTX version you install, then restart or reload MediaMTX as appropriate for that setup.

The example deliberately uses a placeholder: obtain the current YouTube ingest URL from Live Control Room. Do not publish a real key in a sample file. MediaMTX notes that YouTube requires both video and audio; its forwarding guide warns that a video-only stream can be silently rejected.

Set YouTube-compatible output and test it

YouTube’s current RTMP/RTMPS encoder guidance lists H.264, H.265/HEVC and AV1 video; AAC or MP3 audio; CBR bitrate encoding; and frame rates up to 60 fps. It recommends a two-second keyframe interval and says not to exceed four seconds. For stereo audio, its advanced recommendations are 44.1 kHz and 128 Kbps. Choose the bitrate for the codec, resolution and frame rate using YouTube’s current published ranges, and ensure your upload connection can sustain it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Audio-Technica AT-UMX3 USB Desktop Audio Mixer
  • Compact, feature-rich livestreaming USB audio mixer provides high-quality sound for desktop audio production
  • Plug-and-play connectivity to computer or mobile device (no special drivers required)
  • Loopback function makes it easy to mix mic and instrument inputs with background music, game sounds, or other audio input from a computer – and send the stereo mix back to the computer for streaming
  • High-performance A/D converter with resolution up to 24-bit/192 kHz provides crystal-clear output for voice and instruments
  • Equipped with a single mic input (XLR or ¼"), two LINE inputs for guitar and keyboard, and USB-C input for connecting to a computer
  • Use a valid video track even if the devotional visual is mostly static, and include an audio track.
  • Use a two-second keyframe interval where you control encoding; do not exceed YouTube’s four-second recommendation.
  • Use CBR and select a bitrate that fits the chosen codec, resolution and frame rate, as well as the available upload bandwidth.
  • For stereo audio, use YouTube’s recommended 44.1 kHz sample rate and 128 Kbps bitrate where appropriate.
  • Prefer RTMPS for the YouTube leg of the connection.

No special bhajan-specific preset is established by these recommendations. Run a representative test using audio and motion similar to the intended stream. Check the Live Control Room preview for both audio and video, review stream-health messages, and do not switch to a public continuous broadcast until the actual output is healthy.

Keep the channel running and preserve replays

A looping FFmpeg command does not by itself guarantee uninterrupted broadcasting. The machine, MediaMTX process, FFmpeg process and network connection all need monitoring. Plan how you will notice a failure, restart the relevant process and verify that forwarding resumes. Test your restart or failover procedure before depending on it.

Do not treat a continuous stream as a guaranteed full-length YouTube replay. YouTube says streams shorter than 12 hours can be automatically archived; streams exceeding 12 hours may not be captured at all. If a replay matters, make and retain an independent local recording. YouTube also warns that DVR rewind can be limited or unavailable on very long streams, including streams longer than 12 hours; enabling DVR does not eliminate that limitation.

  • Monitor whether FFmpeg is still publishing and MediaMTX is still forwarding.
  • Watch Live Control Room stream health and confirm viewers receive both audio and video.
  • When keeping a local archive, verify that its file size is growing and check that the resulting recording is intact.
  • Test restart and failover behavior, and confirm the live event remains accessible after recovery.
  • Decide how long local recordings will be retained if YouTube does not produce a complete archive.

When to use MediaMTX rather than publish directly

MediaMTX adds a relay layer between FFmpeg and YouTube: FFmpeg publishes to a local MediaMTX path, and MediaMTX forwards that path to the platform. The documentation also shows FFmpeg publishing directly to MediaMTX over RTMP. These are deployment choices, not a measured performance comparison. A relay can fit a setup that needs MediaMTX’s publishing and forwarding roles; a simpler topology may avoid an extra service. In either case, the process and network must be monitored, the YouTube feed must be tested, and local recording is still needed if a reliable replay is important.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Focusrite Scarlett Solo 3rd Gen USB-C Audio Interface
  • Pro performance with great pre-amps - Achieve a brighter recording thanks to the high performing mic pre-amps of the Scarlett 3rd Gen. A switchable Air mode will add extra clarity to your acoustic instruments when recording with your Solo 3rd Gen
  • Get the perfect guitar and vocal take with - With two high-headroom instrument inputs to plug in your guitar or bass so that they shine through. Capture your voice and instruments without any unwanted clipping or distortion thanks to our Gain Halos
  • Studio quality recording for your music & podcasts - Achieve pro sounding recordings with Scarlett 3rd Gen’s high-performance converters enabling you to record and mix at up to 24-bit/192kHz. Your recordings will retain all of their sonic qualities
  • Low-noise for crystal clear listening - 2 low-noise balanced outputs provide clean audio playback with 3rd Gen. Hear all the nuances of your tracks or music from Spotify, Apple & Amazon Music. Plug-in headphones for private listening in high-fidelity
  • Everything in the box: Includes Pro Tools Intro+, Ableton Live Lite, Cubase LE, and Hitmaker Expansion: a suite of essential effects, powerful software instruments, and easy-to-use mastering tools
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common problems and fixes

YouTube does not show a healthy preview

Check that the current ingest URL and stream key are correct, the MediaMTX path matches the FFmpeg destination, and MediaMTX is forwarding the path. Recheck the key privately in Live Control Room; do not paste it into public logs or support posts.

The stream is rejected or has no sound

Confirm the file contains both audio and video and that both tracks reach the YouTube preview. MediaMTX warns that YouTube requires both tracks and may silently reject video-only forwarding. Verify the audio codec and sample-rate settings against YouTube’s current guidance.

The picture or sound stutters

Compare the chosen bitrate with the actual upload capacity and YouTube’s range for the selected codec, resolution and frame rate. Check stream-health messages, use CBR as recommended, and test with representative content. A local relay cannot compensate for an insufficient or unstable upstream connection.

The loop does not start or repeat cleanly

Check the input path and file readability, then inspect the source streams. The documented -stream_loop -1 approach requests indefinite repetition, but it does not guarantee seamless transitions for arbitrary files. Test the actual media before using it continuously.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
YAMAHA MG10XU 10-Input Stereo Mixer with Effects
  • 10 channel mixer with USB and SPX digital effects
  • Featuring studio grade discrete class A D PRE amps with inverted Darlington circuit providing fat, natural sounding bass and smooth, soaring highs
  • 3 band EQ and high pass filters give you maximum control and eliminate unwanted noise, resulting in a cleaner mix
  • 1 knob compressors allow easy control resulting in livelier guitars, punchier bass lines, a tighter snare and a cleaner vocal sound
  • MG Series mixers feature a rugged, impact resistant, powder coated metal chassis; Equivalent input noise 128 dBu, residual output noise 102 dBu

A long live stream has no complete replay

This can be a YouTube archive limitation rather than a MediaMTX forwarding failure. Streams exceeding 12 hours may not be captured automatically, so use a separate local recording when preserving the full program matters.

Or let it run in the cloud

For a YouTube channel that plays uploaded bhajan videos rather than a live camera feed, StreamNeo is an alternative to maintaining a computer and relay at home. Upload a recording or build a playlist, add your YouTube stream key once, and go live; StreamNeo loops the media from the cloud. Nothing at home has to stay on. Each slot streams uploaded video as made, up to 4K 60fps, at one flat price per slot; it also automatically recovers if YouTube drops the stream. The first day is free with no card.

StreamNeo’s monthly option is $9.99 per month. UPI works for customers in India, alongside cards. See StreamNeo or start the free first day.

Quick Recap

Bestseller No. 2
Behringer XENYX 802S Premium Analog 8-Input Mixer with USB Streaming Interface
Behringer XENYX 802S Premium Analog 8-Input Mixer with USB Streaming Interface
Analog mixing and equalization for pure sound; Direct mixing of PC/gaming sounds into the streaming output
$98.00
Bestseller No. 3
Audio-Technica AT-UMX3 USB Desktop Audio Mixer
Audio-Technica AT-UMX3 USB Desktop Audio Mixer
Plug-and-play connectivity to computer or mobile device (no special drivers required)
$159.00
Bestseller No. 5
YAMAHA MG10XU 10-Input Stereo Mixer with Effects
YAMAHA MG10XU 10-Input Stereo Mixer with Effects
10 channel mixer with USB and SPX digital effects; Note: Please refer to the user manual before use
$294.99

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.