Nginx-rtmp-module: Control Module, Record Stop not working?

Created on 25 Sep 2015  路  2Comments  路  Source: arut/nginx-rtmp-module

I just realized I can't get any of my recordings to stop using the manual control. :(

I'm using the Control Module with recording set to manual. I have up to 12 rtmp video streams coming into the server, and up to 100 viewers all simultaneously.

When I issue the start command for a video stream:
http://localhost/control/record/start?app=live&name=test_stream&rec=stream1
the recording starts exactly as I except it to, but when I issue the stop command.
http://localhost/control/record/stop?app=live&name=test_stream&rec=stream1
I can never seem to get the recording to stop. The only way that I have found to stop the recordings is to stop the inbound video streams at the source.

Any ideas, or is this a known bug that I missed?

Here's my config file:

worker_processes auto;
worker_priority 0;

events {
    worker_connections  256;
}

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

    sendfile on;
    tcp_nodelay on;
    tcp_nopush on;

    server {

        listen  80;

        server_name  localhost;

        location /hls {
            types {
                application/vnd.apple.mpegurl m3u8;
                video/mp2t ts;
            }
            root /Videos/tmp;
            add_header Cache-Control no-cache;
        }

        location /control {
            rtmp_control all;
        }

        location /stat {
            rtmp_stat all;
            allow 127.0.0.1;
        }
    }
}

rtmp_auto_push on;
rtmp_auto_push_reconnect 1s;

rtmp {
    server {
        listen 1935;
        chunk_size 4096;

        application live {
            live on;

            wait_key off;
            wait_video off;
            sync 10ms;
            hls on;
            hls_path /Videos/tmp/hls;
            hls_sync 100ms;
            hls_fragment 300ms;

            recorder stream1 {
                record all manual;
                record_path /Videos/recordings/stream1;
                record_suffix -%d-%b-%y-%T.flv;
                record_unique on;
            }

            recorder stream2 {
                record all manual;
                record_path /Videos/recordings/stream2;
                record_suffix -%d-%b-%y-%T.flv;
                record_unique on;
            }

        }
    }
}

Most helpful comment

DOH!!! :see_no_evil:
I just realized that it's the very first line of my config file.

I put worker_processes auto;

This does NOT work with the nginx-rtmp Control Module when using manual Record Stop commands.

It should be worker_processes 1;

Hopefully this will help others not make the same mistake.

All 2 comments

DOH!!! :see_no_evil:
I just realized that it's the very first line of my config file.

I put worker_processes auto;

This does NOT work with the nginx-rtmp Control Module when using manual Record Stop commands.

It should be worker_processes 1;

Hopefully this will help others not make the same mistake.

Thank you kenjikato! It just solved the issue for me too.

I hadn't carefully read the documentation:
https://github.com/arut/nginx-rtmp-module/wiki/Control-module#record

if the record start/stop request returns nothing sometimes, you should check if you use multi workers. one worker works great.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ama-ableton picture ama-ableton  路  6Comments

hennn picture hennn  路  6Comments

MikuPanda picture MikuPanda  路  4Comments

Mattyzero picture Mattyzero  路  6Comments

durgeshksh1 picture durgeshksh1  路  4Comments