最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - How to manage hls in Nginx RTMP module - Stack Overflow

programmeradmin8浏览0评论

I would like to manage the hls broadcast on request, like stop/start or some other way in Nginx RMTP module. My rtmp server needs to support many cameras, however, when it does ffmpeg exec for 200-300 rtmp streams, this is very difficult for the processor, so I would like to execute the ffmpeg command in parallel only on request, how could this be done?

Rtmp Server

rtmp {
    server {
        listen 1935;
        chunk_size 8192;

        application live {
            live on;
            record off;
            drop_idle_publisher 10s;
            allow publish all;

            on_publish rtmp-router:8082/on_publish;

              exec ffmpeg -i rtmp://localhost:1935/live/$name
              -f lavfi -i anullsrc -c:v copy -c:a aac -shortest -f flv rtmp://localhost:1935/hls/$name_main;
        }


        application hls {
            live on;
            hls on;
            hls_fragment_naming system;
            hls_fragment 2;
            hls_playlist_length 4;
            hls_path /opt/data/hls;
            hls_nested on;

            hls_variant _main BANDWIDTH=878000,RESOLUTION=640x360;
        }
    }
}

I would like to solve this through nginx or python itself, since the server running with threads is written in FastAPI.

发布评论

评论列表(0)

  1. 暂无评论