【无标题】

ffmpeg推流延迟(已解决)

ffmpeg推流 av_dict_set 参数设置解析(降低延时、处理花屏、改善画面质量)(实时更新)

obs+nginx+ffmpeg搭建流媒体服务器(一)推流和拉流

使用FFmpeg工具进行推流、拉流、截图、变速、转换,及常见问题处理​​​​​​​

-r rate             set frame rate (Hz value, fraction or abbreviation)

可以用来测试的公网rtmp流,不需要搭建服务器可以直接播放

ffplay rtmp://mobliestream.c3tv.com:554/live/goodtv.sdp

苹果提供的测试源(点播):

ffplay http://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/gear2/prog_index.m3u8

ffmpeg -list_devices true -f dshow -i dummy  
 

ffmpeg  -rtbufsize "1G"  -r 30  -f vfwcap  -i 0  -vcodec h264 -muxdelay 1  -preset ultrafast  -tune zerolatency  -f flv  -g 5  -b:v 1000000  rtmp://127.0.0.1/live/test

ffplay rtmp://localhost:1935/live/test

worker_processes  1;   #Nginx进程数,建议设置为等于CPU总核数
 
events {
    worker_connections  1024;  #工作模式与连接数上限
}
 
rtmp_auto_push on;
 
 
#RTMP服务
rtmp{
    server{
        listen 1935;        #服务端口
        chunk_size 4096;    #数据传输块的大小
        
        application vod{
            play ./vod;   #视频文件存放位置
        }
        application live{
            live on;                     #开启直播
            hls on;                      #开启hls直播。这个参数把直播服务器改造成实时回放服务器
            #wait_key on;                #对视频切片进行保护,这样就不会产生马赛克了
            hls_path ./m3u8File;         #切片视频文件存放位置(HLS,m3u8文件存放位置)
            hls_fragment 2s;             #每个视频切片的时长
            hls_playlist_length 16s;
            recorder myRecord{
                record all manual;
                record_suffix _.flv;
                record_path ./rec;    #指定录制的flv文件存放目录
            }
            #hls_continuous on;          #连续模式
            #hls_cleanup on;             #对多余的切片进行删除
            #hls_nested on;              #嵌套模式
        }
    }
}
 
 
#HTTP服务
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
 
    server {
        listen       80;
        server_name  localhost;
 
        location / {
            root   html;
            index  index.html index.htm;
        }
 
        location /live_hls{
            types{
                #m3u8 type设置
                application/vnd.apple.mpegurl m3u8;
                #ts分片文件设置
                video/mp2t ts;
            }
            #指向访问m3u8文件目录
            alias ./m3u8File;
                add_header Cache-Control no-cache; #禁止缓存
        }
 
        location /control{
            rtmp_control all;
        }
        
        location /stat{
            rtmp_stat all;
            rtmp_stat_stylesheet stat.xsl;
        }
        location /stat.xsl{
            root ./nginx-rtmp-module-master;
        }
 
        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值