Wowza Community

Multi-bitrate Push Publishing to Edgecast w/ their HLS/HDS Transmuxing Tutorial

As many of you may know the documentation to multi-bitrate PushPublish via RTMP to Edgecast is scattered throughout this forum and to be honest isn’t well organized.

Since my company (Sin City Cloud) is a Edgecast reseller I feel it is important to share back with the community here how we got multi-bitrate Push Publishing to Edgecast using their HLD/HDS transmuxing to work successfully across multiple players, browsers, mobile devices, and IPTV platforms (Roku, Android TV, Chromecast, Apple TV etc) for our Live Streaming clients; and we can do to same for you if you ever needed the help.

There is also a Live HLS/HDS pull option from Edgecast if you prefer not to have the transmux service and want your Wowza server to handle everything.

Keep in mind Edgecast is an all Adobe “shop” so with that said the standard “default” settings in the Wowza transcoder need to me massaged to avoid video with no audio or vice versa when being RTMP ingested and HLS/HDS transmuxed by them, as well as the PushPublishmap.txt file rtmp push string settings.

Another important factor to make sure are set properly is your encoder / switcher pushing RTMP to the Wowza Server. So I will start at the encoder with live production settings currently being used & deployed by our clients from their studios.

1) ENCODER (Wirecast / Adobe Media Live Encoder etc)

Be sure your encoder can handle ether 1080P or 720P, if you see field/frame jitter or artifacting at the Wowza Server’s test player output or further down the line take a look at your encoders CPU, Memory, and bandwidth usage; we typically like our clients to keep their CPU at a average of 65-75% or lower use with no more than the occasional peek to 85%, if you are noticing your CPU is churning & burning at higher than 85% consistently you should consider stepping back from 1080P and encoding at 720P.

Now this is just our opinions but we find these are our suggestions which have turned out the most success and best results in our experience.

So for these particular clients we used in their Wirecast:

H.264 / 720p / 16:9 (1280x720)

29.97 Frames per second

2525 kbits/s (2,525,000 bps / bits per second)

Quality 3- (Very Fast encoding)

Profile (Main) - This is very important as Edgecast says they prefer the RTMP pushed to them use a main profile

Key Frame Every 30 frames

Audio - AAC

Channels Stero

Target bit rate 192 kbits/s

Sample rate 44.100


Now don’t push from the Encoder to the Wowza Server via RTMP yet… Lets massage the Transcoder settings in Wowza


(2) Wowza Transcoder & Live Applications Settings

Where going to assume you know how to setup a live application and have enabled the Transcoder Addon. Go to “Applications”, select your application name and click on “Transcoder Addon”. Click “Copy Template”, select “Transrate” from the drop down, and name it what ever you like to call it; we named ours “Transrate-CDN” then hit OK.

Now click on your copied template name / “Transrate-CDN”

Then click on the following:

“source” you can ether leave it enabled and everything default / “passthrough”, if you are feeding from your encoder 1080p rename the Outgoing Stream Name last part from _source to _1080p or click disable encode. We are only using this one if 1080p comes into play or as a second video stream for reference.

720p if you are feeding into Wowza from the encoder 720p set Video & Audio to PassThrough or if feeding 1080p from the encoder use the above video settings for Video Codec, Video Bitrate, Profile, and set your width/height accordingly and Key Frame Interval but leave audio as “PassThrough”

360p Set your Video Codec to H.264, Video Biterate to 1120000, Profile to main, Key Frame Interval to 30, set your width/height accordingly and leave Audio Codec to Passthrough.

240p Set your Video Codec to H.264, Video Biterate to 746000, Profile to baseline, Key Frame Interval to 30, set your width/height accordingly and leave Audio Codec to Passthrough.

160p Set your Video Codec to H.264, Video Biterate to 560000, Profile to baseline, Key Frame Interval to 30, set your width/height accordingly and leave Audio Codec to Passthrough.

The above are just samples of what has worked for us on several occasions when using Edgecast transmuxing and have yielded the best results, but obviously the source video quality from the encoder comes into play.

Next depending on the switcher / encoder video source; you may have to enable deinterlacing, which we typically have to do if the encoder is being fed by a HD/SDI studio switcher or the prerecorded video requires it; this is a judgement call and milage will vary. To enable deinterlacing in the Wowza Transcoder Addon menu click your Transcoder Template name, select “Decode”, “Edit”, then check “Deinterlace source stream” and click on save.


NOW WE AREN’T READY TO STREAM YET, STILL MORE TO DO; BUT WE ARE ALMOST THERE!


(3) Lets enable ModulePushPublish

Click on your live Application name, select “Modules”, click “Edit”, now select “Add Module”. Populate fields as follows:

Name: ModulePushPublish

Description: ModulePushPublish

Fully Qualified Class Name: com.wowza.wms.pushpublish.module.ModulePushPublish

Click “Add”

Now be sure to set your template as active by going to the “Transcoder Addon” click “Edit” under Status and select from the drop down your custom template.


NEXT STEP IS GO TO YOUR EDGECAST ENGINEER / SUPPORT OR RESELLER (Insert shameless plug… SinCityCloud.com )to get setup with HLS/HDS Transmuxing, a RTMP Ingest point, live HLS/HDS event etc so you can push your multiple bitrate rtmp streams)


(4) SSH into your Wowza server and setup connections strings to Edgecast in PushPublishingMap.txt

Ok at this point you have everything you need setup with Edgecast directly or through a reseller and your are ready to tell Wowza the stream, source and destination to Push via RTMP

SSH to your server as root, if Ubuntu make sure you SSH with your admin username then sudo su to become root.

“cd” to /usr/local/WowzaStreamingEngine/conf

Then vi or nano PushPublishMap.txt (we prefer nano cause why bother making this anymore complicated than it has to be) .

Now to properly have a multi bitrate HLS/HDS stream transmuxed by Edgecast you have to push a different RTMP source stream for each bitrate, and here is how we do it, obviously properly replacing the fields with your ingest point host name, account ID/path, stream names, and access keys etc:

TESTTV_720p={profile:"rtmp", host:"flvs.lax.CDNHOSTNAME.com", application:"2XXXXXX/LIVE", streamName:"TESTTV_720p?GLOBALKEY&adbe-live-event=TVLIVEEVENT"}
TESTTV_360p={profile:"rtmp", host:"flvs.lax.CDNHOSTNAME.com", application:"2XXXXXX/LIVE", streamName:"TESTTV_360p?GLOBALKEY&adbe-live-event=TVLIVEEVENT"}
TESTTV_240p={profile:"rtmp", host:"flvs.lax.CDNHOSTNAME.com", application:"2XXXXXX/LIVE", streamName:"TESTTV_240p?GLOBALKEY&adbe-live-event=TVLIVEEVENT"}
TESTTV_160p={profile:"rtmp", host:"flvs.lax.CDNHOSTNAME.com", application:"2XXXXXX/LIVE", streamName:"TESTTV_160p?GLOBALKEY&adbe-live-event=TVLIVEEVENT"}

Now save your file. Go back into Wowza Engine Web interface, click applications, and in the top right corner click restart so the PushPublishMap File & Module is ready for your stream to be initiated and Pushed.


NOW START YOUR STREAM FROM YOUR ENCODER / SWITCHER


(5) TEST YOUR HLS/HDS BEING SERVED BY EDGECAST

So now how do you test your stream, well that can be done many ways by getting the HTTP LARGE link and using stream/bitrate bracketing or creating your own playlist_all.m3u8 and serving the file from the CDN since Edgecast does not provide a multi bitrate m3u8 or manifest

To test via a mobile device, tablet, iPhone or Safari Web Browser on a Mac this is the bracketed format:

httplg.CDNHOSTNAME.com/hls-live/2XXXXX/TESTTV/TESTTVLIVE/TESTTV_,720,360,240,160,p.m3u8

or you can create your own playlist_all.m3u8 file in a text editor and serve it via the CDN as follows:

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=720000
http://httplg.CDNHOSTNAME.com/hls-live/2XXXXX/TESTTV/TESTTVLIVE/TESTTV_720p.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=360000
http://httplg.CDNHOSTNAME.com/hls-live/2XXXXX/TESTTV/TESTTVLIVE/TESTTV_360p.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=240000
http://httplg.CDNHOSTNAME.com/hls-live/2XXXXX/TESTTV/TESTTVLIVE/TESTTV_240p.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=160000
http://httplg.CDNHOSTNAME.com/hls-live/2XXXXX/TESTTV/TESTTVLIVE/TESTTV_160p.m3u8


And that is it!

NOW ONE THING TO NOTE IS THAT IF YOU HAVE TO STOP YOUR STREAM OR RESTART THE WOWZA APPLICATION IT IS IMPORTANT TO ALLOW ABOUT 15 to 30 SECONDS GIVE OR TAKE FOR THE EDGECAST INGEST & TRANSMUXING SYSTEMS TO SEE THIS TO AVOID NO VIDEO BUT AUDIO OR VICE VERSA TYPE ISSUES, WE SUGGEST STOPPING & STARTING THE SERVICES FROM THE COMMAND LINE VS USING THE RESTART BUTTON IN WOWZA AS THIS BUTTON DOES NOT ALLOW FOR ENOUGH OF A DELAY FOR EDGECAST TO DETECT THE CHANGE.

NOW MILAGE MAY VARY! AND THIS IS SIMPLY A GUIDE OF WHAT BITRATES / KEYFRAMES ETC WORK FOR US COMMONLY, SO ADJUSTMENTS MAY NEED TO BE MADE BASED ON YOUR APPLICATION!


If you have any questions please feel free to ask here, private message, connect with me on Linked-In or call us!

Best Wishes! Happy Streaming!

Donald R. D’Avanzo

Chief Technology Officer

Red Rock Tech LLC / Sin City Cloud

www.sincitycloud.com

www.linkedin.com/in/donalddavanzo

(702)660-1500 x 212

Hi Donald,

We always appreciate customer contributions explaining how they solve their own particular design issues, particularly for more complex setups, so thank you very much for this.

Paul

Hello,

As I understood from Donald’s explanation, you can get the M3U8 desriptor file containing all the available renditions using a playback URL of the following format:

http://httplg.CDNHOSTNAME.com/hls-live/2XXXXX/TESTTV/TESTTVLIVE/TESTTV_,720,360,240,160,p.m3u8

Zoran

Is it possible to generate playlist_all.m3u8 automatically? I would like to have such m3u8 for each live stream.