Giter Club home page Giter Club logo

nginx-rtmp-module's People

Contributors

arut avatar carbon198 avatar hlamer avatar itpp16 avatar itsgg avatar jbochi avatar misiek08 avatar nl0 avatar renevolution avatar saintdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nginx-rtmp-module's Issues

NetConnection.Connect.Failed

hi, when I try to connecti to module via flash player in /var/log/nginx/error.log I get :

epoll_ctl(2, 12) failed (2: No such file or directory) while sending client greeting line

but streaming from ffmpeg, I see no errors, should I make an folder for a specific application ?

Vod proxy_pass

Can be stream flv over proxy_pass if file is not found?

Run nginx-rtmp-module in windows

Is it possible to run nginx-rtmp-module in Windows with nginx-build for windows?
What command-line options are needed for this?

Access control for domain

Is it possible to access domain control in client swf url . This is need for use rtmp URL only allowed domains.

Make errors nginx-1.2.1

I cannot compile project on any nginx version. On 1.1.14 (I've found that nginx-rtmp-module is compiled successfully) I have following output:

gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I/root/nginx/rtmp/nginx-rtmp-module -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules -I src/mail
-o objs/addon/nginx-rtmp-module/ngx_rtmp_handler.o
/root/nginx/rtmp/nginx-rtmp-module/ngx_rtmp_handler.c
/root/nginx/rtmp/nginx-rtmp-module/ngx_rtmp_handler.c: In function 'ngx_rtmp_cycle':
/root/nginx/rtmp/nginx-rtmp-module/ngx_rtmp_handler.c:82:33: error: variable 'cscf' set but not used [-Werror=unused-but-set-variable]
/root/nginx/rtmp/nginx-rtmp-module/ngx_rtmp_handler.c: In function 'ngx_rtmp_receive_message':
/root/nginx/rtmp/nginx-rtmp-module/ngx_rtmp_handler.c:739:33: error: variable 'c' set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
make[1]: *** [objs/addon/nginx-rtmp-module/ngx_rtmp_handler.o] Error 1
make[1]: Leaving directory `/root/nginx/nginx-1.1.14/release-1.1.14'
make: *** [build] Error 2

On 1.2.1 (now stable) I have same output.

System: Ubuntu 12.04 amd64.

How can I solve this problem?

metadata support - ID3 tags from ffmpeg

Hi,

does the module also pass the metadata from the provider to the subscriber e.g ID3 Tag information
from ffmpeg? I have the following configuration:

ffmpeg commandline:

ffmpeg -re -i my.mp3 -acodec copy -f flv rtmp://localhost:1935/music

nginx.conf

rtmp {
  server {
        listen 1935;
        chunk_size 4000;

        # TV mode: one publisher, many subscribers
        application music {

            # enable live streaming
            live on;

            # publish only from localhost
            allow publish 127.0.0.1;
            deny publish all;

            allow play all;
        }
    }
}

I tried to read meatadata the metadata in the browser with http://www.schillmania.com/projects/soundmanager2/.

Cheers,
Ruben

Error compiling ngx_rtmp_hls_module

Hi.
I have error when compiling with hls_module

make[1]: Entering directory /home/user1/src/nginx-1.2.1' gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I/home/user1/src/nginx-rtmp-module -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules -I src/http/modules/perl -I src/mail \ -o objs/addon/hls/ngx_rtmp_hls_module.o \ /home/user1/src/nginx-rtmp-module/hls/ngx_rtmp_hls_module.c cc1: warnings being treated as errors /home/user1/src/nginx-rtmp-module/hls/ngx_rtmp_hls_module.c:182: error: ‘CodecID’ is deprecated (declared at /usr/include/libavcodec/old_codec_ids.h:33) make[1]: *** [objs/addon/hls/ngx_rtmp_hls_module.o] Error 1 make[1]: Leaving directory/home/user1/src/nginx-1.2.1'
make: *** [build] Error 2

gcc version 4.4.5 (Debian 4.4.5-8)
libavformat.so.54
libavformat.so.54.22.104

late clients

When client to connect server but not call play request ( sometimes flash players showing advertising banners but connected server ) after 15-20 seconds ( video advertise time ) can't recieve data from server .

I try to other FMS they can handle this late clients after advertising send play request and stream working.

rtmp url problem

if i use in connection string "/" end of rtmp url like "rtmp://localhost/myapp/" your module cant find correct app. i checked debug log, see "myapp/" app not found, other rtmp servers found correct app. if i replace latest slash on your code, module found correct app.

here the diff;
http://pastebin.com/hbi7wyjV

Regards.

Cannot compile under FreeBSD9+

Hi, the current port of nginx-rtmp in the FreeBSD port tree is outdated, so I have decided to compile nginx + nginx-rtmp myself from tarball and freshly cloned nginx-rtmp-module sources (using gcc version 4.2.1)

Here is my ./configure script:
./configure --prefix=/home/stream/local/etc --with-cc-opt="-I /usr/local/include" --with-ld-opt="-L /usr/local/lib" --conf-path=/home/stream/local/etc/nginx.conf --sbin-path=/home/stream/local/sbin/nginx --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx-error.log --user=www --group=www --with-debug --with-ipv6 --http-client-body-temp-path=/var/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/var/tmp/nginx/proxy_temp --http-scgi-temp-path=/var/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp --http-log-path=/var/log/nginx-access.log --with-pcre --with-http_realip_module --with-http_stub_status_module --add-module=../nginx-rtmp-module/ --add-module=../nginx-rtmp-module/hls/

But there are two problems in ngx_rtmp_exec_module.c :

  1. the port tree uses "arut-nginx-rtmp-module-80db4c4", and includes the following patch:
    --- ../arut-nginx-rtmp-module-80db4c4/ngx_rtmp_exec_module.c.orig 2012-06-14 15:14:50.000000000 +0400
    +++ ../arut-nginx-rtmp-module-80db4c4/ngx_rtmp_exec_module.c 2012-06-14 15:15:06.000000000 +0400
    @@ -4,7 +4,11 @@

#include "ngx_rtmp_cmd_module.h"
+#ifdef NGX_FREEBSD
+#include <stdlib.h>
+#else
#include <malloc.h>
+#endif

#ifdef NGX_LINUX
#include <unistd.h>

If the patch is not applied, compile fails complaining malloc.h is deprecated, and advising stdlib.h instead.
Manually applying the patch makes compile go a little further but leads to issue 2)

  1. The real issue after applying the patch and running make :

gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I /usr/local/include -I../nginx-rtmp-module/ -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules -I src/mail -o objs/addon/nginx-rtmp-module/ngx_rtmp_exec_module.o ../nginx-rtmp-module//ngx_rtmp_exec_module.c
cc1: warnings being treated as errors
../nginx-rtmp-module//ngx_rtmp_exec_module.c:186: warning: 'ngx_rtmp_exec_child_dead' defined but not used
../nginx-rtmp-module//ngx_rtmp_exec_module.c:278: warning: 'ngx_rtmp_exec_prepare_arg' defined but not used
*** [objs/addon/nginx-rtmp-module/ngx_rtmp_exec_module.o] Error code 1

Stop in /root/custom-nginx/nginx-1.3.3.
*** [build] Error code 1

I am no programming guru, just an average enlightened freebsd sysadmin, so I cannot fix this by myself..
If someone has an idea on how to solve this, it would much be appreciated, as I would really like to give HLS a shot (plus current port version of nginx-rtmp refuses wirecast connection - i believe this might have been fixed in more recent releases)

Best regards

k.

rtmpdump as a stream source

Are there any possibility to use rtmpdump pipe output as a stream source without using third-party apps like ffmpeg?

issue in publishing live stream

Thank you for this module.

I am facing the initial hick-up. I am not able to publish a live stream.

nginx.conf

rtmp {

server {

    listen 1935;
    application live_test {
       live    on;
    }
}

}

I have added this configuration in my nginx. I have added nginx-rtmp-module.

I have created a streaming client using flash. I am able to successfully establish connection. But when I do NetStream.publish("stream-name") it disconnects!!

I have enabled error log in debug mode. I see only this much

2012/07/25 00:17:11 [info] 2740#0: *1 client connected

Please advice.

I had download the module yesterday.

Display actual livestream fps in stats.

Is it possible to display how many frames per second actually come to server from publisher?

I use ffmpeg to transcode rtmp livestream to h264 baseline for viewing via HLS on my iPad, but my server not always able to transcode it realtime. So often ffmpeg gives less fps than it is needed. When this happens, ffmpeg crashes after some time. So I want to know, how many frames ffpeg sends to automatically adjust it's settings (for example, lower output resolution).

Send ip in http callbacks

I work on authentication system for the streaming server and the sessions are bound to the clients' ip addresses. Can you please send the client's ip along with the rest of the data in the callbacks?

Force pull

Hi,

how can I do to force pull? When I have no rtmp clients, hls clients can't watch also. If i have at least one rtmp client - all works fine.

[error] 64081#0: hls: av: muxrate VBR in logs

Hi, just wondering, with HLS turned on, I get the following lines repeated a zillion times in logs, why ?

[error] 64081#0: hls: av: muxrate VBR,
[error] 64081#0: hls: av: pcr every 0 pkts, sdt every 200, pat/pmt every 40 pkts

The HLS stream is available, but it keeps flooding my logs.

How can I fix this?

Thanks!

nginx: [emerg] unknown directive "rtmp" in /etc/nginx/conf.d/rtmp.conf:1

It gives error below:

nginx: [emerg] unknown directive "rtmp" in /etc/nginx/conf.d/rtmp.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed

nginx version: nginx/1.2.0
built by gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
TLS SNI support disabled
configure arguments: --add-module=/usr/local/src/arut-nginx-rtmp-module/ --prefix=/etc/nginx/ --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --with-cc-opt='-O2 -g -m64 -mtune=generic'

content of rtmp.conf

rtmp {
server {

    listen 1935;

    chunk_size 4000;

    max_buf 1M;


  application fullhd {
        live on;

        # Pull all streams from remote machine
        # and play locally
        pull localhost:1934;
    }

}

http {

server {

    listen 8080;

    # This URL provides RTMP statistics in XML
    location /stat {
        rtmp_stat all;

        # Use this stylesheet to view XML as web page
        # in browser
        rtmp_stat_stylesheet stat.xsl;
    }

    location /stat.xsl {
        # XML stylesheet to view RTMP stats.
        # Copy stat.xsl wherever you want
        # and put the full directory path here
        root /home/film;
    }
}

}

nginx crashes with hls enabled

As it says: nginx crashes. Here's the relevant log part:

*** stack smashing detected ***: nginx: worker process terminated
======= Backtrace: =========
/lib/libc.so.6(__fortify_fail+0x37)[0x7f2ce87956d7]
/lib/libc.so.6(__fortify_fail+0x0)[0x7f2ce87956a0]
/lib/libavformat.so.54(+0x88543)[0x7f2cea8ef543]
/lib/libavformat.so.54(+0x8876c)[0x7f2cea8ef76c]
/lib/libavformat.so.54(av_write_trailer+0x4f)[0x7f2cea93994f]
nginx: worker process[0x48c84d]
nginx: worker process[0x48cdd4]
nginx: worker process[0x48d877]
nginx: worker process[0x47e3fa]
nginx: worker process[0x424660]
nginx: worker process[0x41cdb2]
nginx: worker process[0x422c70]
nginx: worker process[0x42171b]
nginx: worker process[0x423bae]
nginx: worker process(main+0x78d)[0x40632d]
/lib/libc.so.6(__libc_start_main+0xf5)[0x7f2ce86bd725]
nginx: worker process[0x40661d]
======= Memory map: ========
00400000-004b1000 r-xp 00000000 08:03 2900351                            /usr/sbin/nginx-rtmp
006b0000-006c7000 rw-p 000b0000 08:03 2900351                            /usr/sbin/nginx-rtmp
006c7000-00ada000 rw-p 00000000 00:00 0 
028d4000-0293a000 rw-p 00000000 00:00 0                                  [heap]
0293a000-03629000 rw-p 00000000 00:00 0                                  [heap]
7f2ce4b8b000-7f2ce4b97000 r-xp 00000000 08:03 2892098                    /usr/lib/libnss_files-2.16.so
7f2ce4b97000-7f2ce4d96000 ---p 0000c000 08:03 2892098                    /usr/lib/libnss_files-2.16.so
7f2ce4d96000-7f2ce4d97000 r--p 0000b000 08:03 2892098                    /usr/lib/libnss_files-2.16.so
7f2ce4d97000-7f2ce4d98000 rw-p 0000c000 08:03 2892098                    /usr/lib/libnss_files-2.16.so
7f2ce4d98000-7f2ce4d9f000 r-xp 00000000 08:03 2892097                    /usr/lib/librt-2.16.so
7f2ce4d9f000-7f2ce4f9e000 ---p 00007000 08:03 2892097                    /usr/lib/librt-2.16.so
7f2ce4f9e000-7f2ce4f9f000 r--p 00006000 08:03 2892097                    /usr/lib/librt-2.16.so
7f2ce4f9f000-7f2ce4fa0000 rw-p 00007000 08:03 2892097                    /usr/lib/librt-2.16.so
7f2ce4fa0000-7f2ce4fb5000 r-xp 00000000 08:03 2891101                    /usr/lib/libgcc_s.so.1
7f2ce4fb5000-7f2ce51b4000 ---p 00015000 08:03 2891101                    /usr/lib/libgcc_s.so.1
7f2ce51b4000-7f2ce51b5000 rw-p 00014000 08:03 2891101                    /usr/lib/libgcc_s.so.1
7f2ce51b5000-7f2ce529a000 r-xp 00000000 08:03 2885696                    /usr/lib/libstdc++.so.6.0.17
7f2ce529a000-7f2ce5499000 ---p 000e5000 08:03 2885696                    /usr/lib/libstdc++.so.6.0.17
7f2ce5499000-7f2ce54a1000 r--p 000e4000 08:03 2885696                    /usr/lib/libstdc++.so.6.0.17
7f2ce54a1000-7f2ce54a3000 rw-p 000ec000 08:03 2885696                    /usr/lib/libstdc++.so.6.0.17
7f2ce54a3000-7f2ce54b8000 rw-p 00000000 00:00 0 
7f2ce54b8000-7f2ce552d000 r-xp 00000000 08:03 2910164                    /usr/lib/liborc-0.4.so.0.16.0
7f2ce552d000-7f2ce572c000 ---p 00075000 08:03 2910164                    /usr/lib/liborc-0.4.so.0.16.0
7f2ce572c000-7f2ce572e000 r--p 00074000 08:03 2910164                    /usr/lib/liborc-0.4.so.0.16.0
7f2ce572e000-7f2ce5733000 rw-p 00076000 08:03 2910164                    /usr/lib/liborc-0.4.so.0.16.0
7f2ce5733000-7f2ce5739000 r-xp 00000000 08:03 2907982                    /usr/lib/libogg.so.0.8.0
7f2ce5739000-7f2ce5938000 ---p 00006000 08:03 2907982                    /usr/lib/libogg.so.0.8.0
7f2ce5938000-7f2ce5939000 rw-p 00005000 08:03 2907982                    /usr/lib/libogg.so.0.8.0
7f2ce5939000-7f2ce5944000 r-xp 00000000 08:03 2908957                    /usr/lib/libgsm.so.1.0.13
7f2ce5944000-7f2ce5b43000 ---p 0000b000 08:03 2908957                    /usr/lib/libgsm.so.1.0.13
7f2ce5b43000-7f2ce5b44000 rw-p 0000a000 08:03 2908957                    /usr/lib/libgsm.so.1.0.13
7f2ce5b44000-7f2ce5b8c000 r-xp 00000000 08:03 2908971                    /usr/lib/libmp3lame.so.0.0.0
7f2ce5b8c000-7f2ce5d8b000 ---p 00048000 08:03 2908971                    /usr/lib/libmp3lame.so.0.0.0
7f2ce5d8b000-7f2ce5d8c000 r--p 00047000 08:03 2908971                    /usr/lib/libmp3lame.so.0.0.0
7f2ce5d8c000-7f2ce5d8d000 rw-p 00048000 08:03 2908971                    /usr/lib/libmp3lame.so.0.0.0
7f2ce5d8d000-7f2ce5dbb000 rw-p 00000000 00:00 0 
7f2ce5dbb000-7f2ce5de4000 r-xp 00000000 08:03 2909040                    /usr/lib/libopencore-amrnb.so.0.0.3
7f2ce5de4000-7f2ce5fe3000 ---p 00029000 08:03 2909040                    /usr/lib/libopencore-amrnb.so.0.0.3
7f2ce5fe3000-7f2ce5fe4000 r--p 00028000 08:03 2909040                    /usr/lib/libopencore-amrnb.so.0.0.3
7f2ce5fe4000-7f2ce5fe5000 rw-p 00029000 08:03 2909040                    /usr/lib/libopencore-amrnb.so.0.0.3
7f2ce5fe5000-7f2ce5fe6000 rw-p 00000000 00:00 0 
7f2ce5fe6000-7f2ce5ff9000 r-xp 00000000 08:03 2909041                    /usr/lib/libopencore-amrwb.so.0.0.3
7f2ce5ff9000-7f2ce61f8000 ---p 00013000 08:03 2909041                    /usr/lib/libopencore-amrwb.so.0.0.3
7f2ce61f8000-7f2ce61f9000 r--p 00012000 08:03 2909041                    /usr/lib/libopencore-amrwb.so.0.0.3
7f2ce61f9000-7f2ce61fa000 rw-p 00013000 08:03 2909041                    /usr/lib/libopencore-amrwb.so.0.0.3
7f2ce61fa000-7f2ce6221000 r-xp 00000000 08:03 2907263                    /usr/lib/libopenjpeg.so.1.5.0
7f2ce6221000-7f2ce6420000 ---p 00027000 08:03 2907263                    /usr/lib/libopenjpeg.so.1.5.0
7f2ce6420000-7f2ce6421000 r--p 00026000 08:03 2907263                    /usr/lib/libopenjpeg.so.1.5.0
7f2ce6421000-7f2ce6422000 rw-p 00027000 08:03 2907263                    /usr/lib/libopenjpeg.so.1.5.0
7f2ce6422000-7f2ce64e9000 r-xp 00000000 08:03 2909057                    /usr/lib/libschroedinger-1.0.so.0.11.0
7f2ce64e9000-7f2ce66e8000 ---p 000c7000 08:03 2909057                    /usr/lib/libschroedinger-1.0.so.0.11.0
7f2ce66e8000-7f2ce66ea000 r--p 000c6000 08:03 2909057                    /usr/lib/libschroedinger-1.0.so.0.11.0
7f2ce66ea000-7f2ce66ec000 rw-p 000c8000 08:03 2909057                    /usr/lib/libschroedinger-1.0.so.0.11.0
7f2ce66ec000-7f2ce66ee000 rw-p 00000000 00:00 0 
7f2ce66ee000-7f2ce6706000 r-xp 00000000 08:03 2909062                    /usr/lib/libspeex.so.1.5.0
7f2ce6706000-7f2ce6905000 ---p 00018000 08:03 2909062                    /usr/lib/libspeex.so.1.5.0
7f2ce6905000-7f2ce6906000 r--p 00017000 08:03 2909062                    /usr/lib/libspeex.so.1.5.0
7f2ce6906000-7f2ce6907000 rw-p 00018000 08:03 2909062                    /usr/lib/libspeex.so.1.5.0
7f2ce6907000-7f2ce6921000 r-xp 00000000 08:03 2909003                    /usr/lib/libtheoradec.so.1.1.4
7f2ce6921000-7f2ce6b20000 ---p 0001a000 08:03 2909003                    /usr/lib/libtheoradec.so.1.1.4
7f2ce6b20000-7f2ce6b21000 r--p 00019000 08:03 2909003                    /usr/lib/libtheoradec.so.1.1.4
7f2ce6b21000-7f2ce6b22000 rw-p 0001a000 08:03 2909003                    /usr/lib/libtheoradec.so.1.1.4
7f2ce6b22000-7f2ce6b5d000 r-xp 00000000 08:03 2908999                    /usr/lib/libtheoraenc.so.1.1.2
7f2ce6b5d000-7f2ce6d5d000 ---p 0003b000 08:03 2908999                    /usr/lib/libtheoraenc.so.1.1.2
7f2ce6d5d000-7f2ce6d5e000 r--p 0003b000 08:03 2908999                    /usr/lib/libtheoraenc.so.1.1.2
7f2ce6d5e000-7f2ce6d5f000 rw-p 0003c000 08:03 2908999                    /usr/lib/libtheoraenc.so.1.1.2
7f2ce6d5f000-7f2ce6d60000 rw-p 00000000 00:00 0 
7f2ce6d60000-7f2ce6d8c000 r-xp 00000000 08:03 2908013                    /usr/lib/libvorbis.so.0.4.6
7f2ce6d8c000-7f2ce6f8b000 ---p 0002c000 08:03 2908013                    /usr/lib/libvorbis.so.0.4.6
7f2ce6f8b000-7f2ce6f8c000 r--p 0002b000 08:03 2908013                    /usr/lib/libvorbis.so.0.4.6
7f2ce6f8c000-7f2ce6f8d000 rw-p 0002c000 08:03 2908013                    /usr/lib/libvorbis.so.0.4.6
7f2ce6f8d000-7f2ce7240000 r-xp 00000000 08:03 2908016                    /usr/lib/libvorbisenc.so.2.0.9
7f2ce7240000-7f2ce743f000 ---p 002b3000 08:03 2908016                    /usr/lib/libvorbisenc.so.2.0.9
7f2ce743f000-7f2ce745b000 r--p 002b2000 08:03 2908016                    /usr/lib/libvorbisenc.so.2.0.9
7f2ce745b000-7f2ce745c000 rw-p 002ce000 08:03 2908016                    /usr/lib/libvorbisenc.so.2.0.9
7f2ce745c000-7f2ce74f9000 r-xp 00000000 08:03 2908359                    /usr/lib/libvpx.so.1.1.0
7f2ce74f9000-7f2ce76f8000 ---p 0009d000 08:03 2908359                    /usr/lib/libvpx.so.1.1.0
7f2ce76f8000-7f2ce76f9000 r--p 0009c000 08:03 2908359                    /usr/lib/libvpx.so.1.1.0
7f2ce76f9000-7f2ce76fa000 rw-p 0009d000 08:03 2908359                    /usr/lib/libvpx.so.1.1.0
7f2ce76fa000-7f2ce76fc000 rw-p 00000000 00:00 0 
7f2ce76fc000-7f2ce77cc000 r-xp 00000000 08:03 2905086                    /usr/lib/libx264.so.124
7f2ce77cc000-7f2ce79cc000 ---p 000d0000 08:03 2905086                    /usr/lib/libx264.so.124
7f2ce79cc000-7f2ce79ce000 r--p 000d0000 08:03 2905086                    /usr/lib/libx264.so.124
7f2ce79ce000-7f2ce79cf000 rw-p 000d2000 08:03 2905086                    /usr/lib/libx264.so.124
7f2ce79cf000-7f2ce7a4a000 rw-p 00000000 00:00 0 
7f2ce7a4a000-7f2ce7aee000 r-xp 00000000 08:03 2909083                    /usr/lib/libxvidcore.so.4.3
7f2ce7aee000-7f2ce7cee000 ---p 000a4000 08:03 2909083                    /usr/lib/libxvidcore.so.4.3
7f2ce7cee000-7f2ce7cf9000 rw-p 000a4000 08:03 2909083                    /usr/lib/libxvidcore.so.4.3
7f2ce7cf9000-7f2ce7d62000 rw-p 00000000 00:00 0 
7f2ce7d62000-7f2ce7d73000 r-xp 00000000 08:03 2907288                    /usr/lib/libva.so.1.3300.0
7f2ce7d73000-7f2ce7f72000 ---p 00011000 08:03 2907288                    /usr/lib/libva.so.1.3300.0
7f2ce7f72000-7f2ce7f73000 r--p 00010000 08:03 2907288                    /usr/lib/libva.so.1.3300.0
7f2ce7f73000-7f2ce7f74000 rw-p 00011000 08:03 2907288                    /usr/lib/libva.so.1.3300.0
7f2ce7f74000-7f2ce7f79000 rw-p 00000000 00:00 0 
7f2ce7f79000-7f2ce7f88000 r-xp 00000000 08:03 2908423                    /usr/lib/libbz2.so.1.0.6
7f2ce7f88000-7f2ce8187000 ---p 0000f000 08:03 2908423                    /usr/lib/libbz2.so.1.0.6
7f2ce8187000-7f2ce8189000 rw-p 0000e000 08:03 2908423                    /usr/lib/libbz2.so.1.0.6
7f2ce8189000-7f2ce8282000 r-xp 00000000 08:03 2892087                    /usr/lib/libm-2.16.so
7f2ce8282000-7f2ce8481000 ---p 000f9000 08:03 2892087                    /usr/lib/libm-2.16.so
7f2ce8481000-7f2ce8482000 r--p 000f8000 08:03 2892087                    /usr/lib/libm-2.16.so
7f2ce8482000-7f2ce8483000 rw-p 000f9000 08:03 2892087                    /usr/lib/libm-2.16.so
7f2ce8483000-7f2ce849b000 r-xp 00000000 08:03 2909045                    /usr/lib/librtmp.so.0
7f2ce849b000-7f2ce869b000 ---p 00018000 08:03 2909045                    /usr/lib/librtmp.so.0
7f2ce869b000-7f2ce869c000 rw-p 00018000 08:03 2909045                    /usr/lib/librtmp.so.0
7f2ce869c000-7f2ce8837000 r-xp 00000000 08:03 2892103                    /usr/lib/libc-2.16.so
7f2ce8837000-7f2ce8a36000 ---p 0019b000 08:03 2892103                    /usr/lib/libc-2.16.so
7f2ce8a36000-7f2ce8a3a000 r--p 0019a000 08:03 2892103                    /usr/lib/libc-2.16.so
7f2ce8a3a000-7f2ce8a3c000 rw-p 0019e000 08:03 2892103                    /usr/lib/libc-2.16.so
7f2ce8a3c000-7f2ce8a40000 rw-p 00000000 00:00 0 
7f2ce8a40000-7f2ce8a55000 r-xp 00000000 08:03 2889791                    /usr/lib/libz.so.1.2.7
7f2ce8a55000-7f2ce8c54000 ---p 00015000 08:03 2889791                    /usr/lib/libz.so.1.2.7
7f2ce8c54000-7f2ce8c55000 r--p 00014000 08:03 2889791                    /usr/lib/libz.so.1.2.7
7f2ce8c55000-7f2ce8c56000 rw-p 00015000 08:03 2889791                    /usr/lib/libz.so.1.2.7
7f2ce8c56000-7f2ce8c59000 r-xp 00000000 08:03 2903841                    /usr/lib/libdl-2.16.so
7f2ce8c59000-7f2ce8e58000 ---p 00003000 08:03 2903841                    /usr/lib/libdl-2.16.so
7f2ce8e58000-7f2ce8e59000 r--p 00002000 08:03 2903841                    /usr/lib/libdl-2.16.so
7f2ce8e59000-7f2ce8e5a000 rw-p 00003000 08:03 2903841                    /usr/lib/libdl-2.16.so
7f2ce8e5a000-7f2ce903a000 r-xp 00000000 08:03 2894738                    /usr/lib/libcrypto.so.1.0.0
7f2ce903a000-7f2ce9239000 ---p 001e0000 08:03 2894738                    /usr/lib/libcrypto.so.1.0.0
7f2ce9239000-7f2ce9254000 r--p 001df000 08:03 2894738                    /usr/lib/libcrypto.so.1.0.0
7f2ce9254000-7f2ce925f000 rw-p 001fa000 08:03 2894738                    /usr/lib/libcrypto.so.1.0.0
7f2ce925f000-7f2ce9263000 rw-p 00000000 00:00 0 
7f2ce9263000-7f2ce92c3000 r-xp 00000000 08:03 2894737                    /usr/lib/libssl.so.1.0.0
7f2ce92c3000-7f2ce94c2000 ---p 00060000 08:03 2894737                    /usr/lib/libssl.so.1.0.0
7f2ce94c2000-7f2ce94c6000 r--p 0005f000 08:03 2894737                    /usr/lib/libssl.so.1.0.0
7f2ce94c6000-7f2ce94cc000 rw-p 00063000 08:03 2894737                    /usr/lib/libssl.so.1.0.0
7f2ce94cc000-7f2ce94cd000 rw-p 00000000 00:00 0 
7f2ce94cd000-7f2ce952a000 r-xp 00000000 08:03 2891542                    /usr/lib/libpcre.so.1.0.1
7f2ce952a000-7f2ce9729000 ---p 0005d000 08:03 2891542                    /usr/lib/libpcre.so.1.0.1
7f2ce9729000-7f2ce972a000 r--p 0005c000 08:03 2891542                    /usr/lib/libpcre.so.1.0.1
7f2ce972a000-7f2ce972b000 rw-p 0005d000 08:03 2891542                    /usr/lib/libpcre.so.1.0.1
7f2ce972b000-7f2ce972c000 rw-p 00000000 00:00 0 
7f2ce972c000-7f2ce974b000 r-xp 00000000 08:03 2905066                    /usr/lib/libavutil.so.51.54.100
7f2ce974b000-7f2ce994b000 ---p 0001f000 08:03 2905066                    /usr/lib/libavutil.so.51.54.100
7f2ce994b000-7f2ce994f000 r--p 0001f000 08:03 2905066                    /usr/lib/libavutil.so.51.54.100
7f2ce994f000-7f2ce9950000 rw-p 00023000 08:03 2905066                    /usr/lib/libavutil.so.51.54.100
7f2ce9950000-7f2ce9953000 rw-p 00000000 00:00 0 
7f2ce9953000-7f2cea0be000 r-xp 00000000 08:03 2905065                    /usr/lib/libavcodec.so.54.23.100
7f2cea0be000-7f2cea2bd000 ---p 0076b000 08:03 2905065                    /usr/lib/libavcodec.so.54.23.100
7f2cea2bd000-7f2cea2d2000 r--p 0076a000 08:03 2905065                    /usr/lib/libavcodec.so.54.23.100
7f2cea2d2000-7f2cea2ed000 rw-p 0077f000 08:03 2905065                    /usr/lib/libavcodec.so.54.23.100
7f2cea2ed000-7f2cea867000 rw-p 00000000 00:00 0 
7f2cea867000-7f2cea979000 r-xp 00000000 08:03 2905061                    /usr/lib/libavformat.so.54.6.100
7f2cea979000-7f2ceab79000 ---p 00112000 08:03 2905061                    /usr/lib/libavformat.so.54.6.100
7f2ceab79000-7f2ceab81000 r--p 00112000 08:03 2905061                    /usr/lib/libavformat.so.54.6.100
7f2ceab81000-7f2ceab8e000 rw-p 0011a000 08:03 2905061                    /usr/lib/libavformat.so.54.6.100
7f2ceab8e000-7f2ceab96000 r-xp 00000000 08:03 2883905                    /usr/lib/libcrypt-2.16.so
7f2ceab96000-7f2cead95000 ---p 00008000 08:03 2883905                    /usr/lib/libcrypt-2.16.so
7f2cead95000-7f2cead96000 r--p 00007000 08:03 2883905                    /usr/lib/libcrypt-2.16.so
7f2cead96000-7f2cead97000 rw-p 00008000 08:03 2883905                    /usr/lib/libcrypt-2.16.so
7f2cead97000-7f2ceadc5000 rw-p 00000000 00:00 0 
7f2ceadc5000-7f2ceaddc000 r-xp 00000000 08:03 2903617                    /usr/lib/libpthread-2.16.so
7f2ceaddc000-7f2ceafdb000 ---p 00017000 08:03 2903617                    /usr/lib/libpthread-2.16.so
7f2ceafdb000-7f2ceafdc000 r--p 00016000 08:03 2903617                    /usr/lib/libpthread-2.16.so
7f2ceafdc000-7f2ceafdd000 rw-p 00017000 08:03 2903617                    /usr/lib/libpthread-2.16.so
7f2ceafdd000-7f2ceafe1000 rw-p 00000000 00:00 0 
7f2ceafe1000-7f2ceb002000 r-xp 00000000 08:03 2905964                    /usr/lib/ld-2.16.so
7f2ceb1a5000-7f2ceb1d6000 rw-p 00000000 00:00 0 
7f2ceb1d6000-7f2ceb1e3000 rw-p 00000000 00:00 0 
7f2ceb1fe000-7f2ceb200000 rw-p 00000000 00:00 0 
7f2ceb200000-7f2ceb201000 rw-s 00000000 00:04 905152                     /dev/zero (deleted)
7f2ceb201000-7f2ceb202000 rw-p 00000000 00:00 0 
7f2ceb202000-7f2ceb203000 r--p 00021000 08:03 2905964                    /usr/lib/ld-2.16.so
7f2ceb203000-7f2ceb204000 rw-p 00022000 08:03 2905964                    /usr/lib/ld-2.16.so
7f2ceb204000-7f2ceb205000 rw-p 00000000 00:00 0 
7fff6f1f1000-7fff6f212000 rw-p 00000000 00:00 0                          [stack]
7fff6f309000-7fff6f30a000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

Any ideas?

kevent() error on 11 on "on_play" event

Hi,

nginx/1.1.14
OS: FreeBSD 7.0-RELEASE

If use this config everything works fine

rtmp {
    server {
        listen 1935;
        chunk_size 4000;
        application vod {
           play /home/tima/vods;
        }
    }
}

but if add on_play notification

rtmp {
    server {
        listen 1935;
        chunk_size 4000;
        application vod {
           play /home/tima/vods;
           on_play http://localhost:80/play.php;
        }
    }
}

I get following error and nothing works

2012/08/02 14:31:30 [info] 29941#0: *1 client connected
2012/08/02 14:31:30 [error] 29941#0: *1 play: init index error, client: [clientIP], server: 0.0.0.0:1935
2012/08/02 14:31:30 [alert] 29941#0: kevent() error on 11 filter:-2 flags:4000 (2: No such file or directory)

file http://localhost:80/play.php exists and i get request on it

REQUEST Array
(
    [app] => vod
    [flashver] => WIN 11,3,300,265
    [swfurl] => http://<myIP>/flowplayer/flowplayer-3.2.12.swf
    [tcurl] => rtmp://<myIP>/vod
    [pageurl] => http://<myIP>/flowplayer/example/
    [call] => play
    [addr] => [clientIP>]
    [name] => 138523.68763.flv
    [start] => 0
    [duration] => 4294966296
    [reset] => 0
    [hash] => 0123456789ABCDEFGH
)

this scripts returns "200 OK" retcode

i tried nginx 1.2.2 with the same error

Backup Pull URL

Hello,
Is it possible to backup pull URL ? When primary down , switchover another URL .

Cant pass 2 or more variables to onplay (http)handler

Player:
http://www.longtailvideo.com/support/jw-player-setup-wizard/
file: foo.flv?v1=test&v2=test
streamer: [nginx-rtmp-module url]

Nginx config:

#RTMP event handlers, security checks
http { server {
    listen 81;
    server_name localhost;

    location = /rtmp/onpublish {
        #return 200;
        return 403;
    }
    location = /rtmp/onplay {
        content_by_lua '
            ngx.req.read_body()
            local args = ngx.req.get_post_args()
            for key, val in pairs(args) do
                if type(val) == "table" then
                    ngx.log( ngx.ALERT, key .. ": " .. table.concat(val, ", "))
                else
                    ngx.log( ngx.ALERT, key .. ": " .. val)
                end
            end
        ';
    }
}}
#RTMP
rtmp { server {
        listen 1935;
        chunk_size 4000;
        #Simple Video-on-Demand
        application videos {
            play /home/media/;
            on_play http://localhost:81/rtmp/onplay;
        }
}}

Nginx logs:
2012/08/17 14:43:48 [alert] 4631#0: *3 [lua] [string "content_by_lua"]:8: app: videos, client: 127.0.0.1, server: localhost, request: "POST /rtmp/onplay HTTP/1.0", host: "localhost"
2012/08/17 14:43:48 [alert] 4631#0: *3 [lua] [string "content_by_lua"]:8: swfurl: http://player.longtailvideo.com/player.swf, client: 127.0.0.1, server: localhost, request: "POST /rtmp/onplay HTTP/1.0", host: "localhost"
2012/08/17 14:43:48 [alert] 4631#0: *3 [lua] [string "content_by_lua"]:8: flashver: MAC 11,3,300,271, client: 127.0.0.1, server: localhost, request: "POST /rtmp/onplay HTTP/1.0", host: "localhost"
2012/08/17 14:43:48 [alert] 4631#0: *3 [lua] [string "content_by_lua"]:8: v1: test, client: 127.0.0.1, server: localhost, request: "POST /rtmp/onplay HTTP/1.0", host: "localhost"
2012/08/17 14:43:48 [alert] 4631#0: *3 [lua] [string "content_by_lua"]:8: call: play, client: 127.0.0.1, server: localhost, request: "POST /rtmp/onplay HTTP/1.0", host: "localhost"
2012/08/17 14:43:48 [alert] 4631#0: *3 [lua] [string "content_by_lua"]:8: tcurl: [nginx-rtmp-module url], client: 127.0.0.1, server: localhost, request: "POST /rtmp/onplay HTTP/1.0", host: "localhost"
2012/08/17 14:43:48 [alert] 4631#0: *3 [lua] [string "content_by_lua"]:8: name: /Mentor_test/YYYY/0, client: 127.0.0.1, server: localhost, request: "POST /rtmp/onplay HTTP/1.0", host: "localhost"
2012/08/17 14:43:48 [alert] 4631#0: *3 [lua] [string "content_by_lua"]:8: reset: 0, client: 127.0.0.1, server: localhost, request: "POST /rtmp/onplay HTTP/1.0", host: "localhost"
2012/08/17 14:43:48 [alert] 4631#0: *3 [lua] [string "content_by_lua"]:8: start: 0, client: 127.0.0.1, server: localhost, request: "POST /rtmp/onplay HTTP/1.0", host: "localhost"
2012/08/17 14:43:48 [alert] 4631#0: *3 [lua] [string "content_by_lua"]:8: duration: 0, client: 127.0.0.1, server: localhost, request: "POST /rtmp/onplay HTTP/1.0", host: "localhost"
2012/08/17 14:43:48 [alert] 4631#0: *3 [lua] [string "content_by_lua"]:8: addr: 80.70.234.94, client: 127.0.0.1, server: localhost, request: "POST /rtmp/onplay HTTP/1.0", host: "localhost"
2012/08/17 14:43:48 [alert] 4631#0: *3 [lua] [string "content_by_lua"]:8: pageurl: http://www.longtailvideo.com/support/jw-player-setup-wizard/, client: 127.0.0.1, server: localhost, request: "POST /rtmp/onplay HTTP/1.0", host: "localhost"

Issue:
i see only first get-variable (v1) in http POST variables at location /rtmp/onplay/

Playback does not work

I'm trying to get a basic setup working and so far it seems the publishing side is ok. I can stream to the server and I see the publishing stream in the stats. When I try to connect with players though I just get error after a timeout.
ffplay says this:

ffplay -i "rtmp://192.168.2.25/live/myStream live=1"

RTMP_ReadPacket, failed to read RTMP packet header
rtmp://192.168.2.25/live/myStream live=1: Invalid data found when processing input

The config is fairly straightforward:

rtmp {
    server {
        listen 1935;
        chunk_size 4000;

        application live {
            live on;
            allow publish all;
            allow play all;
        }
    }
}

compile error

When i try to compile latest master branch , i recieve this error ,

cc1: warnings being treated as errors
nginx-rtmp-module/hls/ngx_rtmp_hls_module.c: In function ‘ngx_rtmp_hls_init_video’:
nginx-rtmp-module/hls/ngx_rtmp_hls_module.c:255: warning: implicit declaration of function ‘avformat_new_stream’
nginx-rtmp-module/hls/ngx_rtmp_hls_module.c:255: warning: assignment makes pointer from integer without a cast
nginx-rtmp-module/hls/ngx_rtmp_hls_module.c: In function ‘ngx_rtmp_hls_init_audio’:
nginx-rtmp-module/hls/ngx_rtmp_hls_module.c:302: warning: assignment makes pointer from integer without a cast
nginx-rtmp-module/hls/ngx_rtmp_hls_module.c: In function ‘ngx_rtmp_hls_open_file’:
nginx-rtmp-module/hls/ngx_rtmp_hls_module.c:456: warning: implicit declaration of function ‘avio_open’
nginx-rtmp-module/hls/ngx_rtmp_hls_module.c:456: error: ‘AVIO_FLAG_WRITE’ undeclared (first use in this function)
nginx-rtmp-module/hls/ngx_rtmp_hls_module.c:456: error: (Each undeclared identifier is reported only once
nginx-rtmp-module/hls/ngx_rtmp_hls_module.c:456: error: for each function it appears in.)
nginx-rtmp-module/hls/ngx_rtmp_hls_module.c:478: warning: implicit declaration of function ‘avformat_write_header’
nginx-rtmp-module/hls/ngx_rtmp_hls_module.c: In function ‘ngx_rtmp_hls_close_file’:
nginx-rtmp-module/hls/ngx_rtmp_hls_module.c:659: warning: implicit declaration of function ‘avio_flush’
nginx-rtmp-module/hls/ngx_rtmp_hls_module.c:661: warning: implicit declaration of function ‘avio_close’
nginx-rtmp-module/hls/ngx_rtmp_hls_module.c: In function ‘ngx_rtmp_hls_delete_stream’:
nginx-rtmp-module/hls/ngx_rtmp_hls_module.c:834: warning: implicit declaration of function ‘avformat_free_context’
make[1]: *** [objs/addon/hls/ngx_rtmp_hls_module.o] Error 1

exec and idle broadcasters == bad for ffmpeg

Pick a scenario:
nginx is set to exec an ffmpeg script

Some broadcaster, or anything able to proxy an RTMP feed to nginx-rtmp connects to your "live on;" enabled app.
Said broadcaster, publishes a stream "test", starts sending the data, everything is fine, exec fires ffmpeg, your stream is transcoded, yay ...

BUT

The broadcaster stops sending the data, and stays connected to nginx-rtmp
This seems to be the behavior of some rtmp proxies..(Even if they should not be doing it ?)

ffmpeg receiving no data will stop

nginx-rtmp still sees the source as publishing (hence my /stat page), but *bytes counter is obviously idle, and because of that, nginx-rtmp tries to exec ffmpeg once again.
But because the broadcaster isn't pushing anything anymore, ffmpeg fails to transcode the non existing, resulting in ugly things such as

RTMP_ReadPacket, failed to read RTMP packet header
[alert] 37521#0: kevent() error on 9 filter:-1 flags:4000 (9: Bad file descriptor)

Conclusion, exec needs to ensure that data is being pushed before trying to exec whatever it's meant to.

What do you think ?

Cheers !

Cannot use $app & $name in hls_path

As the title suggests, on master branch..

If I use :

hls_path /tmp/stream/hls

hls files are created properly

If i use :

hls_path /tmp/stream/$app/$name

hls files are not created

Limits

Hello,

is there a way to limit simultaneous clients connecting to rtmp to a certain number?
Or as alternative, is it possible to use mod_bandwidth in order to limit rtmp output?

Thanks in advance.

Automatically disconnect "dead" streams

Hi again! =)

I use ffmpeg for streaming video from cameras, and sometimes a stream becomes "dead": the ffmpeg process works and says that it's ok, channel is stated as "publishing" on the statistics page, but the actual stream is empty and has input bitrate 0 kbps and unknown resolution.
Can you please implement detection and automatic disconnection of such streams with optional notification via http callback?
Or maybe you know another way I can achieve that?

Rotate recorded files

Hi.
This module looks very nice and promising, but it lacks a must-have (at least for me) feature: recorded flv-files rotation.
Without it recording does not make much sense: there is only one file which recording goes into permanently and you cannot do anything with it (for example, move it to archive folder).

So I propose the following:

  • each new recorded file is given a timestamp-suffix;
  • when a conditions is met (i.e. reached max size or time interval), the file is closed, a notification is sent (as it is now) and a new file (with the new timestamp-suffix) is created and the recording goes into it.

What do you think about this? Or is it, maybe, possible with the current implementation?

Ignore "restricted" params in the http callbacks

When passing to the url arbitrary params which clash with ones passed by the server itself (flashver, call, addr, etc.) they do get passed to the callback, but I think they shouldn't. It has easy workaround (use the first one), but I think such params should be stripped.

AAC audio problem

I compiled latest (0.17) AVC/H.264 with sequence header video is ok for late clients, but no audio, I added same sequence headers for AAC and now AAC audio is OK, if you need i can share differences.

Problems receiving live stream

Hello,

I'm having problems when connecting to a live stream I'm publishing on live app.
The log: http://paste.ubuntu.com/1051170/
I have an ffmpeg instance which gets the stream and pushes it elsewhere and then I have a flashplayer which connects to the app to watch the live stream.
Well, after some time if I try to reconnect I get no video at all and those errors.
Any idea? Thanks :)

Exec not working in master ?

Here is my simple config for current master branch on FreeBSD 9.x :

I have tried to mimic the "big & small" setup but without luck.

rtmp {
server {
listen 1.2.3.4:1935;
chunk_size 128;
publish_time_fix off;
application proxy {
live on;
exec /usr/local/bin/ffmpeg -re -i rtmp://1.2.3.4:1935/$app/$name -vcodec flv -acodec copy -s 32x32 -f flv rtmp://1.2.3.4:1935/720p/$name;
hls on;
hls_path /home/stream/hls;
hls_fragment 15s;
}
application 720p {
live on;
}
application 480p {
live on;
}
application 360p {
live on;
}
application 240p {
live on;
}
}
}

If I run the following command outside nginx in a shell ..:

/usr/local/bin/ffmpeg -re -i rtmp://1.2.3.4:1935/proxy/test -vcodec flv -acodec copy -s 32x32 -f flv rtmp://1.2.3.4:1935/720p/test;

It works as expected

What would you advise checking ?
(Note HLS works fine)

Can't get live RTMP stream to play

I'm using Flash Media Live Encoder to stream live from a webcam to your module. The stats page shows incoming data and connections, but everything that I try to play the stream with will succesfully connect but report some variation of "[h264 @ 0x7f8ed0c2af40] no frame!" I've tried at least mplayer,vlc, rtmpdump, ffplay, and jwplayer. They all give a similar error. I've tweaked various settings in FMLE to no avail. One thing to note however is that if I use rtmpdump to dump it to a file, rather than try to play it in real time, I can succesfully play the resulting file in any media player.

hls files are not created

rtmp {
server {
listen 1395;

             application hls {
                  live on;

                  hls on;
                  hls_path /tmp/app;
                  hls_fragment 10s;
               }
      }

}

I has mount /tmp/app to tmpfs,but when streaming the hls ts files are not created.
the ffmpeg cmd is :
ffmpeg -i music.m4a -acodec libfaac -ar 44100 -ac 1 -f flv rtmp://localhost:1935/hls/stream

sample access problem

Hi again!
I've run into a problem: a SecurityError is raised when I'm calling BitmapData.draw() in a flash player code. After some googling I've figured out that the server should explicitly allow acces to samples for the clients (some frequently appearing keywords: RtmpSampleAccess, audioSampleAccess, videoSampleAccess).
Have any idea?

worker hog cpu

Hi,

Everyting stop for worker process hog cpu (%100) , I cant see anything on debug.log, i created core dump. If you need more debugging, inform me please.

GDB backtrace:
#0 0x0000000000486628 in ngx_rtmp_relay_disconnect (s=e0x2d16c40, h=0x0, in=) at nginx-rtmp-module/ngx_rtmp_relay_module.c:1021
#1 0x0000000000478e66 in ngx_rtmp_fire_event (s=0x2d16c40, evt=, h=0x0, in=0x0) at nginx-rtmp-module/ngx_rtmp.c:779
#2 0x0000000000479ecf in ngx_rtmp_close_session_handler (e=) at nginx-rtmp-module/ngx_rtmp_init.c:247
#3 0x000000000041d434 in ngx_event_process_posted (cycle=0x20d3cb0, posted=0x6c2ae8) at src/event/ngx_event_posted.c:40
#4 0x0000000000424635 in ngx_worker_process_cycle (cycle=0x20d3cb0, data=) at src/os/unix/ngx_process_cycle.c:806
#5 0x00000000004229a4 in ngx_spawn_process (cycle=0x20d3cb0, proc=0x424560 <ngx_worker_process_cycle>, data=0x0, name=0x48c95e "worker process", respawn=0)

at src/os/unix/ngx_process.c:198

#6 0x0000000000425276 in ngx_reap_children (cycle=0x20d3cb0) at src/os/unix/ngx_process_cycle.c:622
#7 ngx_master_process_cycle (cycle=0x20d3cb0) at src/os/unix/ngx_process_cycle.c:181
#8 0x0000000000406a7b in main (argc=, argv=) at src/core/nginx.c:410

"slow" stream handling

Sometimes it's not enough bandwidth for the stream on the sending side and the streaming is laggy, but it is stated as "published" on the statistics page and is recorded (resulting in broken flvs). Is it possible to detect such laggy streams?

Compilation error 'ngx_listening_t’

I get the following error when trying to compile the module with nginx version 1.0.15 and the module version checkout from github:

../nginx-rtmp-module//ngx_rtmp.c: In function ‘ngx_rtmp_optimize_servers’:
../nginx-rtmp-module//ngx_rtmp.c:596:15: error: ‘ngx_listening_t’ has no member named ‘keepalive’

nginx alone compiles and runs fine. Platform is a current Arch Linux installation. Am I supposed to use a specific version of nginx?

Wirecast cannot connect to NGINX-RTMP

Hi,

I figured I should report this here.
Testing with current nginx-rtmp & nginx-1.3.4

nginx-rtmp's config only consists in a simple:
live {
live on;
}
And has been tested with flashmedialiveencoder and flvplayback.swf

This only happens with wirecast.

Full debug log of wirecast > nginx-rtmp is available here : http://pastebin.com/6Dehre7b

I believe the issue happens between :
line 331 : 2012/08/02 02:29:53 [debug] 1214#0: *215 AMF write (18) 50 75 62 6C 69 73 68 20 73 75 63 63 65 65 64 65 'Publish succeede'
and line 361 : 2012/08/02 02:30:04 [debug] 1214#0: *215 live: delete empty stream 'test'

Note, the wirecast demo only contains an intermittent nag-screen, so you can download it for free @ http://www.telestream.net/wirecast/overview.htm (but requires registration)

And here is the forum thread I created on their side, hopping they might give more insight on what is currently wrong : http://forum.telestream.net/forum/messageview.aspx?catid=45&threadid=11062&STARTPAGE=1

Regards.

feat. request: exec_publish_start & exec_publish_stop

Arut.

I've played with the exec functionalities, they are great, but I quickly come to feel an urge for a way to know when a publisher started to send a stream, and when the stream stopped.

This could be used for instance to generate multi-bitrate style HLS .m3u8 paylists when a stream is pushed to an HLS enabled app, and delete said playlist when the stream stops

I can see many useful ways to use an exec_publish_start and exec_publish_stop (i.e.: launching a transcoding app on publish_start plus several other things ... and launching cleanup files when the stream stops via on publish_stop...)

k.

Notifications don't work for video on demand

Hello.

I can't get the notifications for video on demand. Here is my config:

http {
    server {
        listen 8080;
        location /play {
            return 200;
        }
    }
}
rtmp {
    server {
        listen 1935;
        application vod {
            play /path/to/flvs;
            on_play http://localhost:8080/play;
        }
    }
}

It is impossible to play the file - instead of the video just a black screen. But when I changed the 5th line on the "return 403;" play does not start - all works correctly.

Live stream lost after x seconds

Good day,
I've been trying to use rtmp module as my edge server to serve live streaming to approx 10,000 to 20,000 users. As i have some issues with FMS-edge setup regarding audio/video desync, i've decided to use this module.

Everything is working great but i encounter a problem. While playing a live stream, the stream will get disconnected. The time for the disconnection vary from 1min to 10min.

I've included the log
http://pastebin.com/UrNxQMRx

Config file as followed

worker_processes 1;

error_log logs/error.log debug;

events {
worker_connections 1024;
}

rtmp {
server {
listen 1935;
chunk_size 4000;
application live {
live on;
# Pull all streams from remote machine
# and play locally
pull rtmp://192.168.68.135 app=live tcUrl=rtmp://192.168.68.135:1935/live 'flashVer=LNX 9,0,124,2' live=1;
}
}
}

Undefined symbols: _pcre_free_study

Undefined symbols for architecture x86_64:
  "_pcre_free_study", referenced from:
      _ngx_pcre_free_studies in ngx_regex.o

I get this error when I'm trying to compile on OS X.

question regarding "exec"

Hi, many thanks for the exec fix on FreeBSD, it works just as it's supposed to ... as long as I provide a full ffmpeg line ...

So what I'm wrondering is, am I correct to assume that you cannot specify a shell script on the "exec" line, because nginx will have no interpretor to know what to do with the script ?

Because all tests I made using ffmpeg -re .... worked perfectly
But if I'm trying to execute a shell script, nothing seems to happen...

Sorry if this might be obvious ... I'm just curious ...

Cheers.

on demand

What do you think about on demand streaming with rtmp module ? Future you will add this feature ?

A way to kill session

I needed a way to kill selected session.

I did it with following way:
I will allow connections to rtmp stream only with argument like
rtmp://[ip]/[app]/[stream]?ABCD
where ABCD is session hash, also i show this hash in stat page

If request to stat page consist argument that match sessions hash i will kill this session.

ngx_rtmp.h

typedef struct {
...
ngx_str_t               hash;
...
} ngx_rtmp_session_t;

ngx_rtmp_cmd_module.c

static ngx_int_t
ngx_rtmp_cmd_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
{
...
    if (ngx_strlen(v->args) > 0) {
        s->hash.len = ngx_strlen(v->args);
        s->hash.data = ngx_palloc(s->connection->pool, s->hash.len);
        ngx_memcpy(s->hash.data, v->args, s->hash.len);
    }
...
}

ngx_rtmp_stat_module.c

static void
ngx_rtmp_stat_live(ngx_http_request_t *r, ngx_chain_t ***lll,
        ngx_rtmp_live_app_conf_t *lacf)
{
...
            for (ctx = stream->ctx; ctx; ctx = ctx->next, ++nclients) {
                s = ctx->session;
                if (slcf->stat & NGX_RTMP_STAT_CLIENTS) {
                    if (r->args.len && s->hash.len && r->args.len == s->hash.len) {
                        if (ngx_strncmp(s->hash.data, r->args.data, s->hash.len) == 0) {
                            ngx_rtmp_finalize_session(s);
                            continue;
                        }
                    }
                    ...
                    if (s->hash.len) {
                        NGX_RTMP_STAT_L("<hash>");
                        NGX_RTMP_STAT_ES(&s->hash);
                        NGX_RTMP_STAT_L("</hash>");
                    }

...
}

it is not better way to do this, but it works for me.
Can you look at this code and say is there any mistakes that could cause memory leaks?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.