arut / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
13.44k stars 3.51k forks source link

hls m3u8 file update incorrect after 2 days? #961

Open djstava opened 7 years ago

djstava commented 7 years ago

I use ffmpeg command to stream a udp to nginx-rtmp ffmpeg -report -i "udp://@225.0.0.5:9000?overrun_nonfatal=1&buffer_size=1000000" -vcodec libx264 -acodec aac -preset ultrafast -strict -2 -r 25 -s 720x576 -vf w3fdif -y -f flv rtmp://10.10.10.188/hls/live14

latest git version nginx-rtmp-module works great with nginx-1.11.10,but after 2days, the m3u8 file updated incorrect,like this `longjing@VideoServer:~$ ls /opt/www/live/live14/ -l
total 1928

-rw-r--r-- 1 longjing longjing 903340 Feb 21 10:29 1487644131500.ts
-rw-r--r-- 1 longjing longjing 911236 Feb 21 10:30 1487644182000.ts
-rw-r--r-- 1 longjing longjing 148144 Feb 21 10:30 1487644232000.ts
-rw-r--r-- 1 longjing longjing 240 Feb 21 10:30 index.m3u8
longjing@VideoServer:~$ cat /opt/www/live/live14/index.m3u8

EXTM3U

EXT-X-VERSION:3

EXT-X-MEDIA-SEQUENCE:31603

EXT-X-TARGETDURATION:50

EXT-X-DISCONTINUITY

EXTINF:49.984,

1487644081500.ts

EXT-X-DISCONTINUITY

EXTINF:49.984,

1487644131500.ts

EXT-X-DISCONTINUITY

EXTINF:49.984,

1487644182000.ts`

Then i check the error.log,found the error 2017/02/21 10:31:21 [error] 2125#0: *19839 hls: force fragment split: 50.005 sec, , client: 10.10.10.72, server: 0.0.0.0:1935 2017/02/21 10:31:21 [error] 2125#0: *19839 hls: force fragment split: 50.005 sec, , client: 10.10.10.72, server: 0.0.0.0:1935 2017/02/21 10:32:12 [error] 2125#0: *19839 hls: force fragment split: 50.006 sec, , client: 10.10.10.72, server: 0.0.0.0:1935 2017/02/21 10:32:12 [error] 2125#0: *19839 hls: force fragment split: 50.006 sec, , client: 10.10.10.72, server: 0.0.0.0:1935

And my nginx.conf is here ` worker_processes auto;

rtmp_auto_push on; rtmp_auto_push_reconnect 1s; rtmp_socket_dir /tmp;

error_log logs/error.log info; error_log logs/error.log error;

events { worker_connections 1024; }

rtmp {

publish_time_fix off;

server {

    listen 1935;
    respawn on;
    respawn_timeout 2s;
    ping 20s;
    ping_timeout 10s;
    drop_idle_publisher 20s;
    publish_notify on;
    idle_streams off;

    chunk_size 4000;

    application hls {
        live on;
        hls on;
        dash off;

        wait_key on;

        hls_path /opt/www/live;
        hls_fragment 10s;
        hls_cleanup on;
        hls_fragment_naming system;
        hls_fragment_naming_granularity 500;
        hls_type live;

        # hls_playlist_length 10m;
        hls_sync 100ms;
        hls_continuous on;
        hls_nested on;

        recorder record {
            record all manual;
            record_suffix -%Y-%m-%m-%H_%M_%S.flv;
            record_unique on;
            record_path /opt/www/record;
        }
    }
    application dash {
        live on;
        dash on;
        dash_path /tmp/dash;
    }
}

}

http {

keepalive_timeout  65;

server {

    listen      8081;

    location / {
        root /opt/www/;
    }

    location /control {
        rtmp_control all;
    }

    location /stat {
        rtmp_stat all;
        rtmp_stat_stylesheet stat.xsl;
    }

    location /stat.xsl {
        root /home/longjing/nginx-rtmp-module/;
    }

    location /hls {
        types {
            application/vnd.apple.mpegurl m3u8;
            video/mp2t ts;
        }

        root /opt/www/;
        add_header Cache-Control no-cache;
        add_header Access-Control-Allow-Origin *;
    }

    location /dash {
        root /tmp;
        add_header Cache-Control no-cache;
    }
}

}`

Thanks.

djstava commented 7 years ago

udp stream is ok,vlc can play it.