Не работает HLS стриминг

457 views
Skip to first unread message

Виктор Пильщиков

unread,
Oct 14, 2013, 5:51:21 AM10/14/13
to nginx-...@googlegroups.com
Здравствуйте!
Никак  не  получается  стримить hls, rtmp  работает  без  проблем.
ОС  FreeBSD 8.3
В  начале  поставил из  сырцов( не знал что плагин  портирован в порт nginx) rtmp работает hls  нет.
Решил  поставить из порта  ситуация  такаяже
Конфиг  следующий

#user  nobody;
worker_processes  1;

error_log  logs/error.log debug;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       8080;
        server_name  localhost;

        

        location /hls {
            root /tmp;
        }


        # rtmp stat
        location /stat {
            rtmp_stat all;
            rtmp_stat_stylesheet stat.xsl;
        }
        location /stat.xsl {
            # you can move stat.xsl to a different location
            root /usr/build/nginx-rtmp-module;
        }

        # rtmp control
        location /control {
            rtmp_control all;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

rtmp {
    server {
        listen 1935;
        ping 30s;
        notify_method get;

        application west {
          live on;
          exec ffmpeg -i rtmp://localhost/west/$name -c:v libx264 -c:a libfaac -ar 44100 -ac 2 -f flv rtmp://localhost/westhls/$name;
        }
        
        
        application westhls {
          live on;
          hls on;
          hls_path /tmp/hls;
          hls_fragment 5s;
          hls_nested on;
        }
        
        application myapp {
            live on;

            # sample play/publish handlers
            #on_play http://localhost:8080/on_play;
            #on_publish http://localhost:8080/on_publish;

            # sample recorder
            #recorder rec1 {
            #    record all;
            #    record_interval 30s;
            #    record_path /tmp;
            #    record_unique on;
            #}

            # sample HLS
            #hls on;
            #hls_path /tmp/hls;
            #hls_sync 100ms;
        }

        # Video on demand
        #application vod {
        #    play /var/Videos;
        #}

        # Video on demand over HTTP
        #application vod_http {
        #    play http://localhost:8080/vod/;
        #}
    }
}


Входящий стрим  идет  на  приложение  west  для  кодирования  h264 aac и  ретранслируется на westhls.  Однако  в папке  /tmp/hls никаких  чанков  не  появляется и  соответственно  при  попытке  посмотреть  выдается 404  Ошибка. Ниже  пример  лога

2013/10/14 01:28:19 [alert] 46495#0: kevent() error on 11 filter:-1 flags:4000 (9: Bad file descriptor)
2013/10/14 01:28:19 [notice] 46495#0: signal 20 (SIGCHLD) received
2013/10/14 01:28:19 [notice] 46495#0: unknown process 46506 exited with code 1
2013/10/14 01:28:24 [alert] 46495#0: kevent() error on 11 filter:-1 flags:4000 (9: Bad file descriptor)
2013/10/14 01:28:24 [notice] 46495#0: signal 20 (SIGCHLD) received
2013/10/14 01:28:24 [notice] 46495#0: unknown process 46508 exited with code 1
2013/10/14 01:28:24 [info] 46495#0: kevent() failed (4: Interrupted system call)
2013/10/14 01:28:29 [alert] 46495#0: kevent() error on 11 filter:-1 flags:4000 (9: Bad file descriptor)
2013/10/14 01:28:29 [notice] 46495#0: signal 20 (SIGCHLD) received
2013/10/14 01:28:29 [notice] 46495#0: unknown process 46512 exited with code 1
2013/10/14 01:28:29 [info] 46495#0: kevent() failed (4: Interrupted system call)
2013/10/14 01:28:30 [error] 46495#0: *2 open() "/tmp/hls/tstream1.m3u8" failed (2: No such file or directory), client: 178.165.19.111, server: localhost, request: "GET /hls/tstream1.m3u8 HTTP/1.1", host: "5.9.79.174:8080"
2013/10/14 01:28:30 [error] 46495#0: *3 open() "/tmp/hls/tstream1.m3u8" failed (2: No such file or directory), client: 178.165.19.111, server: localhost, request: "GET /hls/tstream1.m3u8 HTTP/1.1", host: "5.9.79.174:8080"
2013/10/14 01:28:31 [error] 46495#0: *4 open() "/tmp/hls/tstream1.m3u8" failed (2: No such file or directory), client: 178.165.19.111, server: localhost, request: "GET /hls/tstream1.m3u8 HTTP/1.1", host: "5.9.79.174:8080"
2013/10/14 01:28:31 [error] 46495#0: *5 open() "/tmp/hls/tstream1.m3u8" failed (2: No such file or directory), client: 178.165.19.111, server: localhost, request: "GET /hls/tstream1.m3u8 HTTP/1.1", host: "5.9.79.174:8080"
2013/10/14 01:28:32 [error] 46495#0: *6 open() "/tmp/hls/tstream1.m3u8" failed (2: No such file or directory), client: 178.165.19.111, server: localhost, request: "GET /hls/tstream1.m3u8 HTTP/1.1", host: "5.9.79.174:8080"
2013/10/14 01:28:32 [error] 46495#0: *7 open() "/tmp/hls/tstream1.m3u8" failed (2: No such file or directory), client: 178.165.19.111, server: localhost, request: "GET /hls/tstream1.m3u8 HTTP/1.1", host: "5.9.79.174:8080"
2013/10/14 01:28:34 [alert] 46495#0: kevent() error on 11 filter:-1 flags:4000 (9: Bad file descriptor)
2013/10/14 01:28:34 [notice] 46495#0: signal 20 (SIGCHLD) received
2013/10/14 01:28:34 [notice] 46495#0: unknown process 46516 exited with code 1
2013/10/14 01:28:34 [info] 46495#0: kevent() failed (4: Interrupted system call)
2013/10/14 01:28:39 [alert] 46495#0: kevent() error on 11 filter:-1 flags:4000 (9: Bad file descriptor)
2013/10/14 01:28:39 [notice] 46495#0: signal 20 (SIGCHLD) received
2013/10/14 01:28:39 [notice] 46495#0: unknown process 46520 exited with code 1
2013/10/14 01:28:44 [alert] 46495#0: kevent() error on 11 filter:-1 flags:4000 (9: Bad file descriptor)
2013/10/14 01:28:44 [notice] 46495#0: signal 20 (SIGCHLD) received
2013/10/14 01:28:44 [notice] 46495#0: unknown process 46523 exited with code 1
2013/10/14 01:28:49 [alert] 46495#0: kevent() error on 11 filter:-1 flags:4000 (9: Bad file descriptor)
2013/10/14 01:28:49 [notice] 46495#0: signal 20 (SIGCHLD) received
2013/10/14 01:28:49 [notice] 46495#0: unknown process 46526 exited with code 1
2013/10/14 01:28:54 [alert] 46495#0: kevent() error on 11 filter:-1 flags:4000 (9: Bad file descriptor)

Может  что то  не  так  делаю, или ffmpeg  использую  не  правильно???
С Уважением, Виктор...

Roman Arutyunyan

unread,
Oct 14, 2013, 7:37:01 AM10/14/13
to Виктор Пильщиков, nginx-...@googlegroups.com
Судя по обилию SIGCHLD, ffmpeg умирает практически сразу после запуска, поэтому ничего и нет. Попробуйте запустить его руками в консоли, подставив имя потока вместо $name. Кроме того, убедитесь, что он у вас не лежит в таком месте, куда не может добраться nginx worker, который обычно работает из-под бесправного юзера.


2013/10/14 Виктор Пильщиков <vicl...@gmail.com>

--
Вы получили это сообщение, поскольку подписаны на группу nginx-rtmp-ru.
 
Чтобы отказаться от подписки на эту группу и перестать получать из нее сообщения, отправьте электронное письмо на адрес nginx-rtmp-r...@googlegroups.com.
Настройки подписки и доставки писем: https://groups.google.com/groups/opt_out.



--
--
Roman Arutyunyan
Reply all
Reply to author
Forward
0 new messages