Can AWS support RTMP based Live Streaming with CloudFront or CloudFormation

amazon-cloudfrontcdnred5rtmp

As far as i understand reading all these articles:

docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-rtmp.html
docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-overview.html
docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Tutorials.html
docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/wowza-creating-stack.html
docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-rtmp-creating.html
docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-rtmp-values-specify.html
docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AMS5.0SubscribingToAMS.html
docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/LiveStreamingAdobeMediaServer5.0.html

And in particular the following:

https://aws.amazon.com/it/blogs/aws/amazon-cloudfront-now-supports-streaming-media-content/
https://aws.amazon.com/it/blogs/aws/using-amazon-cloudfront-for-video-streaming/

It looks like it is NOT possible to mirror a live streaming RTMP using CloudFront with a Web or RTMP Distribution on TCP 80 or TCP 1935, since those distributions are based the delivery/mirroring/caching of static files for both players and video files (FLV).

The support on the live streaming is offered by Amazon via CloudFormation stack and Adobe Media Server or WOWZA integration, but in our scenario the client already has its own Red5 streaming server, already working and set up.

How is it possibile to use CloudFront to mirror a Live Streaming RTMP connection on TCP 80 or 1935,
by using an origin server and RTMP flow that is running on a Red5, instead of delivering a static FLV file from an S3 hosting ?

I would like to understand if this solution is supported by Amazon and where to find the knowledge base to perform such configuration.

Basically, in our scenario we already have the RTMP exposed on the public web, we only need AWS to cache it through CloudFront and serve to other clients.

We want to try doing a Web Distribution only for the Flash Player which will be downloaded by the clients to see the streaming, and we would like the player to point to AWS CDN mirroring URL for the live streaming.

Is this possible and how ?

Thank you very much,
Best Regards

Best Answer

I just spent some time working on this recently. The answer is no, as another answer to this question points out.

However, you can essentially string up your own RTMP CDN using AWS. You can set up a bunch of nginx-rtmp instances to be edges.

nginx-rtmp documentation can be found on the project's GitHub (https://github.com/arut/nginx-rtmp-module/). You basically run a bunch of these whichever way you prefer (EC2 instances, ECS as I'm doing, or however you like) but you configure them to pull from the ingest server.

You then load balance the edges and pull from them for viewing.

This gets a bit complicated as you're basically rolling your own CDN from scratch using AWS EC2 instances and probably want to have distribution points in multiple regions. Depending on your scale, it may make sense to have intermediate nodes that serve to pull from the origin and redistribute to regional edges.

See the "pull" directive in nginx-rtmp. A sample config:

rtmp {
   server {
       listen 1935;

       application streamapp {
           live on;
           pull rtmp://my-streaming-server.com:1935/streamapp;
      }
   }
}
Related Topic