kaltura / nginx-vod-module

NGINX-based MP4 Repackager
GNU Affero General Public License v3.0
2k stars 439 forks source link

multi bitrate files and different path locations #1053

Open Sulieman9 opened 5 years ago

Sulieman9 commented 5 years ago

Hello There I started using VOD module, but I need to ask how to configure nginx that could use different versions of bit rate that located at exists at different pathes.

the playlist from the toturial : http://185.180.15.101/oceans,6,9,15,00k.mp4.urlset/playlist.m3u8 works fine but the 3 versions of the movie are located at the same directroy. now my storage was working with wowza server so I generate the files this way:

600K version located at: /storage/600/movie.mp4 900K version located at: /storage/900/movie.mp4 1500K version located at: /storage/1500/movie.mp4

how can tell nginx to use these pathes and not to search over the file renderation in the same directory and generate the m3u8 list based on these locations. attached the conf file: `http { upstream fallback { server 127.0.0.1:80; }

server {
    # vod settings
    vod_mode local;
    vod_fallback_upstream_location /fallback;
    vod_last_modified 'Sun, 19 Nov 2000 08:52:00 GMT';
    vod_last_modified_types *;
    vod_hls_master_file_name_prefix playlist;

    # vod caches
    vod_metadata_cache metadata_cache 512m;
    vod_response_cache response_cache 128m;

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

    # file handle caching / aio
    open_file_cache max=1000 inactive=5m;
    open_file_cache_valid 2m;
    open_file_cache_min_uses 1;
    open_file_cache_errors on;

    aio on;

    location ^~ /fallback/ {
        internal;
        proxy_pass http://fallback/;
        proxy_set_header Host $http_host;
    }

    location / {
        root /storage/;
        vod hls;
        add_header Access-Control-Allow-Headers '*';
        add_header Access-Control-Expose-Headers 'Server,range,Content-Length,Content-Range';
        add_header Access-Control-Allow-Methods 'GET, HEAD, OPTIONS';
        add_header Access-Control-Allow-Origin '*';
        expires 100d;
    }
}

}` Thanks

erankor commented 5 years ago

The commas can be used anywhere in the path, not only on the file name. So, in your example, you can just use - /storage/,6,9,15,00/movie.mp4.urlset/master.m3u8