Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Cloudfront RTMP Streaming?


Has anyone figured out how ...Has anyone figured out how to take advantage of the new Amazon Cloudfront Streaming option announced today? I took a quick look at the RTMP tutorial, but I'm not 100% sure how that translates to use with Cloudfront. I'm assuming the player has to go in a traditional Cloudfront distribution, and the video goes in the streaming one. Anyone have this working yet and care to share?

30 Community Answers

JW Player

User  
0 rated :

Making progress: found this: http://docs.amazonwebservices.com/AmazonCloudFront/2009-12-01/DeveloperGuide/index.html?RTMPStreaming.html

JW Player

User  
0 rated :

Thats very interesting could you possibly post your code when you get it working?

JW Player

User  
0 rated :

still working on the code here too - will post if I figure out anything. Here's to hoping for a game-changing CDN!

JW Player

User  
0 rated :

I'm signed up and working on it too...

JW Player

User  
0 rated :

Here is a working example...

http://planet.casadehood.com/rtmp/cloudfront/bitswitch.html

JW Player

User  
0 rated :

The trick will be finding a way to secure it... I would appreciate any ideas in this area.

JW Player

User  
0 rated :

To secure it, just use the RTMPE protocol instead of the regular RTMP.

CloudFront uses Adobe Flash Media Server 3.5 to stream on-demand content with Adobe's Real-Time Messaging Protocol (RTMP). CloudFront accepts RTMP requests over port 1935 and port 80.

CloudFront supports the following variants of the RTMP protocol:

RTMPAdobe's Real-Time Message Protocol

RTMPTAdobe streaming tunneled over HTTP

RTMPEAdobe encrypted

RTMPTEAdobe encrypted tunneled over HTTP

JW Player

User  
0 rated :

Thanks Dustin... for those that don't want to use bitrate streaming and just want to serve a single file, you can use the following -- just replace the filename and cloudfront name with your own.

bc.. <script type='text/javascript' src='/flv/swfobject.js'></script>

<div id='mediaspace'>This text will be replaced</div>

<script type='text/javascript'>
var so = new SWFObject('/flv/player.swf','ply','640','480','9','#ffffff');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('file','FILENAME.flv');
so.addVariable('streamer','rtmp://CLOUDFRONTNAME.cloudfront.net/cfx/st');
so.write('mediaspace');
</script>

JW Player

User  
0 rated :

Yep, got it working too. Hurrah!

Right - how does this do live streaming?

JW Player

User  
0 rated :

thanks dustin & brad!

JW Player

User  
0 rated :

bc.. To secure it, just use the RTMPE protocol instead of the regular RTMP.


Absolutely you'd have to use RTMPE... When I said secure, I was also referring to more than just encrypting the stream, some sort of token auth or url signing...

JW Player

User  
0 rated :

Anyone was able to stream a mp3 with this? With jw player I only here some noise, then it keeps buffering...

JW Player

User  
0 rated :

do we need to encode the .flv file differently for RTMP?

JW Player

User  
0 rated :

How are you deploying playlists using this method?

On the JW article for Streaming it says:

streamer=rtmp://www.mysite.com/application&file=http://www.mysite.com/path/to/playlist.xml

What would the 'application' element be for this when using amazon cludfront? Any examples?

JW Player

User  
0 rated :

Check out my very own tool CloudBerry Explorer that helps to manage S3 and CloudFront. The latest version supports CloudFront Streaming and you can also generate an HTML code snippets for JW Player. It is a freeware. http://s3.cloudberrylab.com/

JW Player

User  
0 rated :

With Amazon stating that "streaming private media files with a signed URL is not supported", does that mean that anyone who knows the URL of my CloudFront RTMP stream will be able to play it back via a player on their website? Or even a desktop application like VLC?

Should I go for a solution like Influxis if I need more control over who can have access to my paid video content?

JW Player

User  
0 rated :

Hello everyone. I'm trying to stream from Cloudfront and I can't tell if it is just slow or is waiting for the entire mp4 file to load before streaming. I've ran the Adobe Air app that is linked from this site to fix the "moov atom" - but from the response I don't know if 1. it is OK and should work or 2. does not have the moov atom. I created the file in Handbrake and selected the "web streaming" option, fwiw.

I'll include all that I can below, and any help would be greatly appreciated. Thanks, Dale

Link to video:
http://www.overshield.com/videos/teststream.htm

contents of that htm file:
bc.. <script type='text/javascript' src='swfobject.js'></script>
<div id='mediaspace'>This text will be replaced</div>
<script type='text/javascript'>
var so = new SWFObject('player-viral.swf','mpl','640','380','9');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('duration','22');
so.addVariable('file','stream/stream.mp4');
so.addVariable('provider','rtmp');
so.addVariable('bufferlength','5');
so.addVariable('streamer','rtmp://s1kggw42et3qmb.cloudfront.net/cfx/st');
so.write('mediaspace');
</script>



And here is a copy of the mp4 file (about 5.5 MB) that I'm trying to stream:
http://www.overshield.com/download/index.php?path=&download=stream.mp4

And the response from the Adobe Air app that fixes the moov atom when I process that mp4:
bc.. File.size: 5675044
Reading Atom Metadata: [code: ftyp,size: 28,offset: 0]
Reading Atom Metadata: [code: moov,size: 31402,offset: 28]
Reading Atom Metadata: [code: mdat,size: 5643614,offset: 31430]
ACTION: Parsing Bytes for Information 5675044
ERROR: The MOOV atom is not located at the end of the file, the file is ready for progressive download or it is a invalid file
Completed Time: 0.149s

JW Player

User  
0 rated :

You don't need to post process MP4 files with MP4Box for RTMP streaming.

Use a version 4.7 player until Longtail gets RTMP streaming working correctly in Player 5.

http://developer.longtailvideo.com/trac/log/trunk/as3/player.swf

JW Player

User  
0 rated :

jamix, I think I have read that amazon supports securing the stream with a crossdomain.xml file that limits access to the stream from your url. So People should not be able to play your stream from a stand alone player like vlc or from a web-player on another domain.

@all:
Any opinions on how secure this would be?

JW Player

User  
0 rated :

This is quoted from the Developer Guide for cloudfront
bc.. Crossdomain.xml

Adobe Flash Media Server allows the use of a crossdomain.xml file that specifies which domains can access media files in a particular domain. CloudFront supplies a default file that allows all domains to access the media files in your streaming distribution. If you implement a more restrictive crossdomain.xml file, CloudFront ignores it.


http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/index.html?RTMPStreaming.html

JW Player

User  
0 rated :

I'm using the CloudFront too, but when I use the option to show the bandwidth I got an NaN kbps...

why is that?

JW Player

User  
0 rated :

@Dustin: Ah, not good...

JW Player

User  
0 rated :

@ Andy,
Thanks for your post on CloudBerry Explorer and your explanations on your site.

Mike.

JW Player

User  
0 rated :

I'm trying to stream via cloudfront with a playlist of mp3 mixes.

Should the 'streamer' variable have the 2-part parameter or just the streaming-server part?
(and also, or not) With the 'playlistfile' variable having the full path or just the local filename?

so.addVariable('streamer','rtmp://streaming.mydomain.com/cfx/st&http://mybucket.s3.amazonaws.com/tld/2009/playlist.xml');

so.addVariable('playlistfile','http://mybucket.s3.amazonaws.com/path/playlist.xml');

I've also got cloudfront.mydomain.com (obviously 'mydomain' is not the real one) set for download, so that can replace the bucket url...

Then as I understand it the playlist.xml file is supposed to have just the filename in the location field as the server/player already knows it's supposed to be streaming it.
Does that sound right?

JW Player

User  
0 rated :

I had the problem that i included the bucket name in the file path ...

[bucket]/folder1/folder2/movie.flv

should become

/folder1/folder2/movie.flv

Just in case someone else is wrangling with the same problem.

JW Player

User  
0 rated :

All, I am trying to finagle the playlist into compliance with Adobe's "SarbanesOxley on Crack" security restrictions.

The thread is here:
https://forums.aws.amazon.com/thread.jspa?messageID=210379&#210379

Any help is appreciated.

JeroenW

JW Player Support Agent  
0 rated :

I have no clue what you mean with this. The AWS thread simply talked about some people why forgot to add crossdomain.xml files. Can you elaborate?

JW Player

User  
0 rated :

Just solved some problems using CloudFront and AS3.

Using your NetConnection, use:
_connection.connect('rtmp://your_cloud.cloudfront.net/cfx/st');

Note the "/cfx/st" at the end. Even if you are using your own CNAME, you will have to add this.

With your NetStream, use:
_stream.play('mp4:my_videos/video.mp4');

Note the "mp4:" in front of the MP4 location. "my_videos" would be the folder you have your videos in.

Hope this helps!

JW Player

User  
0 rated :

Can anyone tell me how can I access from a web server a RTMP CloudFront stream which has also a signature?

The url looks something like that:rtmp://xxxxxxxxx.cloudfront.net/cfx/st/movies/6.mp4?Expires=xxxxxxxxxxxxx&Signature=LtSjyjxY9lc~xxxxxxxxxxxxxxxxxxxxxxxxxx_&Key-Pair-Id=xxxxxxxx.

Any help is appreciated.

JeroenW

JW Player Support Agent  
0 rated :

marin, you should URLEncode the video URL. That will make it work!

This question has received the maximum number of answers.