How do I change YOUTUBE Live Stream to another RTMP server url?

Does anyone know the best (or easy way that doesn’t break anything else) way to change URL that the Live Streaming option sends? (currently it goes to youtube, I want to send to custom rtmp url)
thanks!

3 Likes

I’d also like to know this.

I haven’t had time to try this hack yet but I would simply modify the hosts file on Linux to redirect the youtube domain name url to our own RTMP server IP address and make sure it accepts same format.

1 Like

There is a similar thread here with more detail:

I don’t have the ability to edit and build from source but I’d be willing to pay someone to make the “live stream” portion more open to accepting any RTMP source with key.

You could redirect using an outbound firewall rule to redirect from the YouTube domain (rtmp://a.rtmp.youtube.com) and or (mountmount /live2) to your custom RTMP Stream.

I suspect though that if you can do that you could also figure how to compile from source.

thanks… now i need to figure out how to build

i’ll replace that rtmp url with my own rtmp nginx proxy & no need to key.

OR replace that with a periscope rtmp url & update key . the only issue is how to add this to the menu as an additional option?!!

The simplest way for use another rtmp service (from my view, without recompile anything nor installing unstable packages) is create a fake ffmpeg script wich accept all parameters sent by jibri and make there server remap.

In my case I’ve created the file /opt/util/ffmpeg with this content:

#!/usr/bin/bash

COMANDO="/usr/bin/ffmpeg"

while test $# -gt 0
do
    T="$1"
    if [ "${T:0:32}" == "rtmp://a.rtmp.youtube.com/live2/" ]; then
	COMANDO="$COMANDO rtmp://my-server-for-rtmp:1935/sub-rtmp-url/${T:32}"
    else
	COMANDO="$COMANDO $T"
    fi
    shift
done

echo "Llamando a ffmpeg sustituyendo rtmp si hay: «$COMANDO»."

exec $COMANDO 
PROCESO_FFMPEG=$!

echo "Esperando finalización del proceso: ${PROCESO_FFMPEG}."
wait $PROCESO_FFMPEG

Bash (first line) and ffmpeg path must be same than results of:

$ which bash
/usr/bin/bash
$ which ffmpeg
/usr/bin/ffmpeg

Then I’ve edited the jibri service with:

systemctl edit --full jibri

and specify:

[Service]
Environment="PATH=/opt/util:/usr/lib/jvm/oracle-java8-jdk-amd64/jre/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
...

And it uses my rtmp service.


MODIFED (2020-05-16T22:00:00Z): This script has been modified because didn’t stop correctily. Now it stops correctly according to below post.

9 Likes

Interesting. I will give it a try. That you for the information.

@lodopidolo Bravo! I haven’t tried it yet but seems like a very smart trick! Thx! :slight_smile:

@lodopidolo

brilliant

i had to change #!/usr/bin/bash to #!/bin/bash for this to work for me

In my system is there. It is possible to execute from command line:

which bash

and this shows full path of bash.

yeah its

$which bash
/bin/bash

for me

Thank You for sharing. I appreciate your efforts

Hi,

How to create a ffmpeg file /opt/util/ffmpeg?

Just use nano, vi or vim to create the directory & file

sudo mkdir -p /opt/util

sudo nano /opt/util/ffmpeg

Copy & paste the content & make necessary changes

sudo chmod +x /opt/until/ffmpeg

Make changes too the jibri.service

You’re good to go

2 Likes

Hi,

 Thanks for your support, currently it's support only one live streaming. how to make to support multiple steaming or make running multiple Jibri instances.

Hi, in:

you can specify:

COMANDO="$COMANDO $T"

and then all key you put in the web is passed to ffmep. You are open to indicate all rtmp services you want.

1 Like

Hi,

When I try to start multiple live streaming in different conferences, I am getting the below error response, becauseof one Jebri per Server. how to overcome this.

“ALL streams are currently busy, we are working on freeing streaming resources”

you can only start 1 stream with 1 jibri

you need multiple jibri instances, for the above tip to work

instead setup a NGINX rtmp proxy … way easier to implement

will this work with “rtmps” streams?