Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Cloudfront RTMP Streaming?

30 replies [Last post]
Reply

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?

Reply
Reply

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

Reply

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

Reply

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

Reply
Reply

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

Reply

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:

RTMP—Adobe's Real-Time Message Protocol

RTMPT—Adobe streaming tunneled over HTTP

RTMPE—Adobe encrypted

RTMPTE—Adobe encrypted tunneled over HTTP

Reply

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.

<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>

Reply

Yep, got it working too. Hurrah!

Right - how does this do live streaming?

Reply

thanks dustin & brad!

Reply

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...

Reply

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

Reply

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

Reply

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?

Reply

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/

Reply

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?

Reply

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:

<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:

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
Reply

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

Reply

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?

Reply

This is quoted from the Developer Guide for cloudfront

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.ht...

Reply

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

why is that?

Reply

@Dustin: Ah, not good...

Reply

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

Mike.

Reply

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?

Reply

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.

Reply

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

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

Any help is appreciated.

Reply

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?

Reply

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!

Reply

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.

Reply

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

Post new comment

  • Allowed HTML tags: <code> <blockquote> <em> <strong> <strike> <ul> <li> <ol>
  • You may post code using <code>...</code> .
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options