1

I have installed Nginx and configured VOD for adaprive streaming using nginx-vod-module. While requesting the master.m3u8 file I'm getting same ts files served for different network bandwidth.

The master.m3u8 file has the following content:

 #EXTM3U
 #EXT-X-STREAM-INF:PROGRAMID=1,BANDWIDTH=1914317,RESOLUTION=1280x544,CODECS="avc1.64001f,mp4a.40.2"
  http://localhost/content/Input.mp4/index-v1-a1.m3u8

The Nginx configuration is:

   location /content {
        vod hls;
        vod_mode local;

        root /usr/share/nginx/html;

        gzip on;
        gzip_types application/vnd.apple.mpegurl;

        expires 100d;
        add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
    }

How can I get adaptive bitrate enabled using nginx-vod-module and what's the best way to verify it ?

Rachit Gupta
  • 85
  • 2
  • 9

1 Answers1

1
  1. You encode multiple versions of your Input.mp4 with different resolutions/bitrates. The aspect ratio should be the same. Eg: Input_high.mp4, Input_low.mp4

  2. You edit the master m3u8 playlist and add each rendition with its specific bitrate and resolution:

    #EXTM3U
    #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=...,RESOLUTION=...,CODECS="..."
    /content/Input_low.mp4.m3u8
    #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=...,RESOLUTION=...,CODECS="..."
    /content/Input_high.mp4.m3u8
    
  3. When the nginx-vod-module receives a request for a filename.mp4.m3u8 it automatically segments filename.mp4 for HLS and creates the playlist for you. Eg: /content/Input_low.mp4.m3u8 for /content/Input_low.mp4

aergistal
  • 29,947
  • 5
  • 70
  • 92
  • master m3u8 is dynamically served and generated . I dont want to pre create any playlist and segment files . I have kept only a mp4 file . – Rachit Gupta Oct 16 '15 at 10:27
  • @RachitGupta You *must* create the master playlist manually, aka the one that holds the stream information. The media playlist is automatically created for each file. And you must encode your file in multiple `mp4` variants. See: https://www.nginx.com/wp-content/uploads/2015/06/Serving-Media-with-NGINX-Plus1.pdf – aergistal Oct 16 '15 at 11:26
  • What does this means? "encode your file in multiple mp4 variants" . Do i need to put multiple mp4 of different qualities? – Rachit Gupta Oct 16 '15 at 12:30
  • @RachitGupta Yes, the module doesn't encode it just repackages in `HLS` – aergistal Oct 16 '15 at 12:42
  • We are expecting dynamic adaptive bit-rate HLS is it available in nginX-Plus? – Rachit Gupta Oct 16 '15 at 12:45
  • "The NGINX Plus module performs real-time segmentation, packetization, and multiplexing from the MP4 file container to HLS/MPEG-TS **without recoding the content.**" From: https://www.nginx.com/products/streaming-media-delivery/ – aergistal Oct 16 '15 at 12:49