Haivision / srt

Secure, Reliable, Transport
https://www.srtalliance.org
Mozilla Public License 2.0
3.12k stars 851 forks source link

stransmit example for Wowza 4.7.2 #84

Closed jbroberg closed 6 years ago

jbroberg commented 7 years ago

Just released Wowza 4.7.2 has support for SRT.

https://www.wowza.com/docs/how-to-create-and-use-stream-files-in-wowza-streaming-engine-manager https://www.wowza.com/docs/how-to-specify-per-stream-settings-in-stream-files#srtstreams

Has anyone had any success pushing to it from stransmit? I have not. If you have, can you share the commands used?

midicase commented 7 years ago

I've been working with Wowza on SRT and have been pushing a stream from an encoder for 2 days. We haven't tested authentication yet. I use the library so no command line, but it does work.

colleenkhenry commented 7 years ago

I too think this would be a useful example, from Wowza and on here :).

colleenkhenry commented 7 years ago

Alright so I figured it out.

Install Wowza.

Update it to the most recent version.

Basically go to Wowza's UI. on http://wowzaserverurl:8088/

Go to the roles area and give your admin account the permissions for the advanced settings UI.

Go to your app, like "live"

Create a stream file, named something, "showmewhatyougot" with the stream URI as "srt://0.0.0.0:1337".

Hit add.

Go back to stream files.

Hit under actions "Connect a Stream File. Under the media caster type drop down choose "srt (linux-only)

Now run something like to stream your webcam from a mac to send in a stream...

ffmpeg -pix_fmt uyvy422 -s 1280x720 -r 30 -f avfoundation -i "0:0" -c:v libx264 -crf 23 -preset veryfast -g 120 -keyint_min 120 -c:a aac -pix_fmt yuv420p -vf scale=640:360 -f mpegts - | stransmit -v "file://con" "srt://wowzaserverurl:1337"

or something like this to simply generate a pattern for testing without a webcam...

ffmpeg -f lavfi -re -i life=s=300x200:mold=10:r=30:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16 -f lavfi -re -i sine=frequency=1000:sample_rate=44100 -pix_fmt yuv420p -c:v libx264 -b:v 1000k -g 30 -keyint_min 120 -profile:v baseline -preset veryfast -c:a aac -b:a 96k -f mpegts - | stransmit -v "file://con" "srt://wowzaserverurl:1337"

Then you can watch on quicktime / safari / bitmovin / StreamShark player like

http://wowzaserverurl:1935/live/showmewhatyougot.stream/playlist.m3u8

Or pop this DASH url into your StreamShark player / Shaka / DASH.js / Bitmovin

http://wowzaserverurl:1935/live/showmewhatyougot.stream/manifest.mpd

Let me know if that helps.

jordicenzano commented 7 years ago

@jbroberg Yes, this is the command (create a test video on the fly and sends it to stransmit using a pipe):

ffmpeg -f lavfi -re -i smptebars=duration=60:size=1280x720:rate=30 -f lavfi -re -i sine=frequency=1000:duration=60:sample_rate=44100 -pix_fmt yuv420p -c:v libx264 -b:v 1000k -g 30 -keyint_min 120 -profile:v baseline -preset veryfast -c:a libfdk_aac -b:a 96k -f mpegts - |  ./stransmit -v "file://con" "srt://192.168.1.48:9000?mode=server"

PS: Try to avoid UDP as stransmit input, it did not work in my case. See https://github.com/Haivision/srt/issues/86

jbroberg commented 6 years ago

Hi guys - I will close this issue out.

It works fine for me with latest stransmit (now srt-live-transmit) and latest Wowza 4.7.6. @colleenkhenry 's instructions were right on.

Below is an example of me pulling a local UDP stream and sending it to a Wowza instance hosted in the cloud:

./srt-live-transmit -v -s:500 -r:500 -pf:json udp://:45003 "srt://wowzahostname:4434"