Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

successdav's avatar

Video on Demand

Hi, can you point me to a resource to guide me on how to set up a video on Demand streaming from Amazon S3

0 likes
9 replies
Flor's avatar

If you have videos in proper format, you could just embed them with the HTML5 video tag:

<video width="1280" height="720" controls>
  <source src="https://s3.amazonaws.com/path/to/video.mp4" type="video/mp4">
  <source src="https://s3.amazonaws.com/path/to/video.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>

Other than that, Amazon has its own "Video on Demand" solution and guide:

https://aws.amazon.com/solutions/implementations/video-on-demand-on-aws/

successdav's avatar

@flor Thank you for your reply. Here is what I have done so far

What I am trying to achieve. I am working on a website for teaching Graphics Design Course and video editing, I am able to upload to amazon s3 bucket from my application. but when I try streaming from s3 with the video url, it doesn't work.

Secondly, I am concern with the security of the videos, I dont want anyone to have access to the video unless that person is subscribe to my application.

Can you recommend a simple solution for me? Please.

martinbean's avatar

@successdav As someone who’s built, launched, and operated a video on demand platform for a few years now, this is a big topic.

Getting videos into S3 is the easy part. You then need to transcode it in formats that can be understood by as many browsers and devices as possible. Whilst MP4 is pretty well supported, it’s a single bitrate encoding. If you want videos to play back even on a patchy network connection, then you’ll need to look at adaptive bitrate encoding, so that the quality adjusts based on the user’s bandwidth, like YouTube or Vimeo or even Netflix does. Unfortunately, there’s not one ABR encoding that’s supported cross-platform, there are various standards such as DASH and HLS.

Then, as you’ve pointed out, you have security to contend with. It’s fine embedding an MP4 or HLS video/stream in a video tag in your HTML page, but not if a nefarious user can then grab that URL, send it to their pals, and then they can just watch that stream directly, too.

As you can see, video on demand isn’t “simple”. AWS do provide a “cookbook” of a pre-built solution, but you’ll need to have a working knowledge of each of the individual components it uses in the solution, and also be aware of the costs involved in spinning up all of those services without your AWS account. So I’d say choose a balance: if time and money is no object, build your own. If you just want to record videos and have them locked behind a subscription, do what Laracasts itself does and host them on Vimeo with playback restricted to your application’s domain. Vimeo have already taken care of the storage, transcoding, delivery, and security aspects. All you need to do is upload your videos to Vimeo and then embed them into your web page using a HTML embed code.

2 likes
Tjyoung's avatar

Maybe use ziggeo There is a cost but you can host them on your aws account and stream It does all the encoding etc Provides a player etc We have done roughly 200,000 videos so far this way

successdav's avatar

@martinbean - Thank you very much for taking the time to explain things in details.

But what if I dont want to go with the video on demand solution?

Is there a way to just play this video from amazon s3 and still have it accessible only via my application?

if there is, what are the downside?

Amazon s3 offers one year free trial, this free period can help me raise funds as a starter, then move to a better solution in time.

@tjyoung you mentioned ziggeo and still host my video on aws, can you help me understand better?

martinbean's avatar
Level 80

Is there a way to just play this video from amazon s3 and still have it accessible only via my application?

@successdav No. S3 is just storage. I explained the security implications above.

Amazon s3 offers one year free trial

@successdav Amazon offers a free tier, yes, but you’ll quickly exceed those limits storing, transcoding, and streaming HD video. Amazon’s free trial doesn’t just let you run on AWS without limit for a year.

My best advice as someone who’s been there and done that is, if you’re short on time and funds, to just get a Vimeo Pro account and upload your videos there. You can restrict what domains the videos play back on, and is what Laracasts do. Vimeo have dozens of engineers working daily on storage, transcoding, and streaming solutions. They’ve already done the work for you.

2 likes
Tjyoung's avatar

Hi, ziggeo has their push service that you can specify your s3 storage and have it place the transcoded video there. The videos typically have a unique name so in essence ‘security by obscurity’. Mine for example are the video token each is named after (a 32 character unique string).mp4. Stored on S3 and accessible to the app only because you’d have to know the URL to access it which would be very challenging for someone to guess etc.

malkaro's avatar

Amazon offers is for first year after you are need e true hosting for your files.

Please or to participate in this conversation.