FFmpeg + nginx-rtmp 推流

ffmpeg -f gdigrab -framerate 25 -i desktop -vcodec libx264 -preset ultrafast -tune zerolatency -pix_fmt yuv420p -f flv rtmp://localhost/live/test

ffplay -fflags nobuffer -flags low_delay -strict experimental rtmp://localhost/live/test

nginx-rtmp-win32

nginx.conf:

worker_processes 1;

events {
    worker_connections 1024;
}

rtmp {
    server {
        listen 1935;
        chunk_size 4096;

        application live {
            live on;
            record off;
        }
    }
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen       8181;
        server_name  localhost;
        location / {
            root   html;
            index  index.html index.htm;
        }
    }
}

使用 FFmpeg 推送桌面画面到本地 nginx-rtmp

远程/虚拟机通过 RTMP 播放了直播画面

image
image

posted @ 2025-08-12 12:39  huh&uh  阅读(28)  评论(0)    收藏  举报