Nginx Plus not HLS streaming

I installed Nginx Plus and configured HLS for streaming. When requesting a file, m3u8I get an error message:

2015/09/29 13:32:34 [error] 5814#5814: *1 open() "/usr/video/hls/CODECS="avc1.42e00a,mp4a.40.2"" failed (2: No such file or directory)

The file m3u8has the following contents:

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=545600,RESOLUTION=416x234,CODECS="avc1.42e00a,mp4a.40.2"
/usr/video/hls/myvideo_low.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1755600,RESOLUTION=640x360,CODECS="avc1.42e00a,mp4a.40.2"
/usr/video/hls/myvideo_high.m3u8

Nginx Configuration:

location /hls {
      root   /usr/video;
      hls;
      hls_fragment            5s;
      hls_buffers             10 10m;
      hls_mp4_buffer_size     1m;
      hls_mp4_max_buffer_size 5m;
      types {
           application/vnd.apple.mpegurl m3u8;
           video/mp2t ts;
      }
      add_header 'Access-Control-Allow-Origin' '*';
      add_header 'Cache-Control' 'no-cache';
}

In the browser I get a warning: "TS fragments not found."

+4
source share
1 answer

To dynamically create segments tsfrom a static file, such as mp4, the file name and extension must be present in the file name of the playlist m3u8:

myvideo_high.mp4.m3u8 for myvideo_high.mp4

For:

myvideo_high.m3u8

he assumes segments already exist.


NGINX Plus m3u8, - ( ):

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=545600,RESOLUTION=416x234,
CODECS="avc1.42e00a,mp4a.40.2"
/hls/myvideo_low.mp4.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1755600,RESOLUTION=640x360,
CODECS="avc1.42e00a,mp4a.40.2"
/hls/myvideo_high.mp4.m3u8

#EXT-X-STREAM-INF ( ):

 #EXTM3U
 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=545600,RESOLUTION=416x234,CODECS="avc1.42e00a,mp4a.40.2"
 /hls/myvideo_low.mp4.m3u8
 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1755600,RESOLUTION=640x360,CODECS="avc1.42e00a,mp4a.40.2"
 /hls/myvideo_high.mp4.m3u8
+2

Source: https://habr.com/ru/post/1609463/


All Articles