Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I create multiple RTMP **push** link?? #32

Open
siavashfazli opened this issue Jan 16, 2022 · 2 comments
Open

How can I create multiple RTMP **push** link?? #32

siavashfazli opened this issue Jan 16, 2022 · 2 comments

Comments

@siavashfazli
Copy link

Hi dear!!
I have a video source and I need to share it with several RTMP links.
How can I config this?
ONE video source push to multiple RTMP links!!

@TareqAlqutami
Copy link
Owner

Have you tried using FFmpeg. It is capable of doing that. You can see an example in the current config file where it is used to transcode and push a received rtmp into multiple RTMP streams. I am not sure what is your video source type but most probably ffmpeg will support it.

# for each received stream, transcode for adaptive streaming
# This single ffmpeg command takes the input and transforms
# the source into 4 different streams with different bitrates
# and qualities. 
exec_push  /usr/local/bin/ffmpeg -i rtmp://localhost:1935/$app/$name -async 1 -vsync -1
		-c:v libx264 -c:a aac -b:v 256k  -b:a 64k  -vf "scale=480:trunc(ow/a/2)*2"  -tune zerolatency -preset superfast -crf 23 -f flv rtmp://localhost:1935/show/$name_low
		-c:v libx264 -c:a aac -b:v 768k  -b:a 128k -vf "scale=720:trunc(ow/a/2)*2"  -tune zerolatency -preset superfast -crf 23 -f flv rtmp://localhost:1935/show/$name_mid
		-c:v libx264 -c:a aac -b:v 1024k -b:a 128k -vf "scale=960:trunc(ow/a/2)*2"  -tune zerolatency -preset superfast -crf 23 -f flv rtmp://localhost:1935/show/$name_high
		-c:v libx264 -c:a aac -b:v 1920k -b:a 128k -vf "scale=1280:trunc(ow/a/2)*2" -tune zerolatency -preset superfast -crf 23 -f flv rtmp://localhost:1935/show/$name_hd720
		-c copy -f flv rtmp://localhost:1935/show/$name_src;	

@JamiePhonic
Copy link

just add multiple push statements in the application config:

 application live {
      live on; # Allows live input
      drop_idle_publisher 10s; # Drop Publishing connections that havnt sent any stream data for over 10 seconds
      
      # Local push for built in players
      push rtmp://localhost:1935/show;
      
      # YouTube
      push rtmp://a.rtmp.youtube.com/live2/<stream_key>;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants