arut / nginx-rtmp-module

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

RTMP EXEC Command and hls_variant adaptive streaming + record #1229

Open bichkhe opened 6 years ago

bichkhe commented 6 years ago

I settting nginx-rtmp configuration on 10.240.152.231 (my server) by myself as below `rtmp { server { listen 1935; chunk_size 8192; access_log /var/log/nginx/access.log;

error_log /var/log/nginx/error.log debug;

                 application live {
                    live on;
            wait_key on;
            interleave on;
            publish_notify on;
            sync 10ms;
             push rtmp://10.240.152.250;

        exec /bin/ffmpeg -i rtmp://10.240.152.231/live/$name  -async 1 -vsync -1 -c copy -f flv rtmp://localhost/show/$name;
     }

     application show {

                    live on;
                    hls on;
                    hls_path /tmp/hls/;

                    hls_nested on;
                    record on;        
                    # Instruct clients to adjust resolution according to bandwidth

                    hls_variant _720 BANDWIDTH=2048000; # High bitrate, HD 720p resolution
                    hls_variant _480 BANDWIDTH=448000; # Medium bitrate, SD resolution
                    hls_variant _240 BANDWIDTH=288000; # Low bitrate, sub-SD resolution

    }

    }

} `

I use ffmpeg to streaming to 10.240.152.231 with command /bin/ffmpeg -re -i ./source.200kbps.768x320.flv \ -vcodec copy -acodec copy \ -f flv -y rtmp://10.240.152.231/live?user_id=141\&channel=xyz\&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI3V2hKNk9CUFBSRWp1ZW9WRXYxT2p2SHZlb282c1lTUyJ9.2-CxE7GroMHqTTQ8jFyqD9w3smjwJ4zmQfUziZMwo0k/test;

I expected file record at /tmp/hls/ but nothing. I have checked /bin/ffmpeg and command /bin/ffmpeg -i rtmp://10.240.152.231/live/$name -async 1 -vsync -1 -c copy -f flv rtmp://localhost/show/$name. Everything is ok?

Beside, sometime i see file record at /tmp/hls but it is not stable. Why?

Anyone has the ideas to resolve this issue? Please?

bienkma commented 6 years ago

+1. I have same problem.