arut / nginx-rtmp-module

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

hls_nested on; not working #1242

Open t1amat9409 opened 6 years ago

t1amat9409 commented 6 years ago

Hi

I have a problem with hls_nested, when it's set on, it's not working. no files or directory is created, and and when i turn it off, file are created in the same folder with not ".m3u8" file

worker_processes auto;

events { worker_connections 1024; }

rtmp_auto_push on; rtmp { server { listen 1935; chunk_size 400000;

timeout 10s;

    application live{
        live on;
        #deny play all;
        push rtmp://localhost/hls/;
        #record all;
        #record_path /usr/local/nginx/html/video;

        #on_publish http://localhost:3001/api/on-live-auth;
        #on_publish_done http://localhost:3001/api/on-live-done;
    }

    application hls {
        live on;

        #session_relay on;

        hls on;
        hls_nested on;
        hls_fragment 5s;
        hls_continuous on;
        hls_fragment_naming system;
        hls_path /usr/local/nginx/html/video/;
    }
}

}

http { default_type application/octet-stream; sendfile off; tcp_nopush on;

server {
    listen       2017;
    server_name  localhost;

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

        root /usr/local/nginx/html/;
        index index.html index.htm;
    }
}

}

nxtreaming commented 6 years ago

Can nginx write the diretory "/usr/local/nginx/html/video/"?

t1amat9409 commented 6 years ago

Yes, well at least i think so, if not I'm open to suggestions... but i did chmod 777 the path.

nxtreaming commented 6 years ago

try to lower the chunk_size to chunk_size 8182;

t1amat9409 commented 6 years ago

I did, nothing changed... keep in mind, it's working on my localhost, but on my vps its doing this

nxtreaming commented 6 years ago

strange if your nginx is configured for user www, try chown -R www:www /usr/local/nginx/html/video/

t1amat9409 commented 6 years ago

www said user invalid, so i tried www-data

t1amat9409 commented 6 years ago

but still nothing changed... if i remove hls_nested, it creates the .ts files, but doesn't create the .m3u8 file

t1amat9409 commented 6 years ago

I think the app crashes once it reaches _nested...

t1amat9409 commented 6 years ago

I managed to see the log file, my disk space is full.. so it failed to exec mkdirs()...

nxtreaming commented 6 years ago

Nice found.

t1amat9409 commented 6 years ago

Thanks for helping out