Search code examples
amazon-web-servicesamazon-s3http-live-streaming

Proper HLS format?


I want to convert some m4v video files into a format that can be streamed from cloud storage.

I first uploaded the files to AWS S3, then I ran an AWS elastic transcoder job to convert them to HLS v3 (Apple HTTP Live Streaming), 600 kilobits/second, but I can't get the output files to play, even though the input m4vs play fine.

Here is one output: [note this video has been removed] https://s3.amazonaws.com/lookvideo.streams/v/845f5b39d854687d79e5823e0499c9c2370de0f4.m3u8

I'm testing it with an HTML document

<!DOCTYPE html>
<html>
   <body>
      <video controls autoplay >
             <source src="https://s3.amazonaws.com/lookvideo.streams/v/845f5b39d854687d79e5823e0499c9c2370de0f4.m3u8">
      </video>
  </body>
</html>

Do I need to use use a different file format? Or could something else be causing the output to be corrupted?

Formats: http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/system-presets.html


Solution

  • The file extension appears to be wrong. Files with a .m3u8 extension are used for playlists. The content type header in the response (video/MP2T) indicates that it's a .ts file, not a playlist.

    The src attribute should be the URL of a playlist, which contains the references to the individual segments (.ts). Take a look at some playlist examples on Apple's site.