arut / nginx-rtmp-module

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

hls_fragment & hls_playlist_length cannot changed #1232

Open areeb111 opened 6 years ago

areeb111 commented 6 years ago

Hello Everyone, I have nginx-1.12 with nginx-rtmp-module - latest version. having a problem with setting hls_fragment and hls_playlist_length which cannot be changed even i have tried to make each fragment with 1s but it's still getting 10 fragments with 4.8 seconds. Config sample: hls_fragment 2s; hls_playlist_length 10s;

Please is there any solution for this ?

Even tried to put these parameters in application and rtmp section and i have the same default results.

limaob commented 5 years ago

Hello Did u solve the problem? I have the same problem. my fragments are 11 seconds. this is my conf:

rtmp { server { listen 1935;

    application live {
        live on;
    }

    application hls {
        live on;
        hls on;  
        hls_path test/hls;  
    hls_fragment 2s;
    hls_playlist_length 6s;
    }
}

}

0x41mmarVM commented 5 years ago

how are you pushing to your server? can you check your error log? it might be that your video source cannot be segmented into such small chunks. See here.

limaob commented 5 years ago

how are you pushing to your server? can you check your error log? it might be that your video source cannot be segmented into such small chunks. See here.

my error log is no problem. my video source is 25 fps/s. how to confirm whether it be segmented into such small chunks? when i use ffmpeg, it can produce .ts file that is 5s. ffempg command line: ffmpeg -i "rtsp://admin:awifi123@192.168.120.99:554" -fflags flush_packets -max_delay 2 -flags -global_header -hls_time 5 -hls_list_size 3 -vcodec copy -acodec aac -y D:\Develop\nginx-rtmp-win32-dev\test\hls\video.m3u8

limaob commented 5 years ago

how are you pushing to your server? can you check your error log? it might be that your video source cannot be segmented into such small chunks. See here. thanks for your suggestion,i have already solved this. when i use ffmpeg to rtmp, i set gop params. let hls_fragment honoured.

misiek08 commented 5 years ago

That's why you should always check logs :)

Streaming software sometimes doesn't send full frames regularly - it's trying to save bandwidth. ffmpeg sets everything to achieve correct .ts fragments length. nginx receiving stream without those full frames won't do it on its own - nginx acts only as splitter and broadcaster and if there is no metadata to split on - it will wait for the closest place after the split point where stream can be split successfully.

czw., 11.04.2019, 11:04 użytkownik limaob notifications@github.com napisał:

how are you pushing to your server? can you check your error log? it might be that your video source cannot be segmented into such small chunks. See here https://stackoverflow.com/questions/38216051/hls-fragment-length-and-playlist-length-with-nginx-rtmp-module . thanks for your suggestion,i have already solved this. when i use ffmpeg to rtmp, i set gop params. let hls_fragment honoured.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/arut/nginx-rtmp-module/issues/1232#issuecomment-482032152, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbp9lew-LUCQGqHz-L14Ynpx0hDkGfhks5vfvqRgaJpZM4Ss09Y .