视频转换 rtsp 流 转rtmp流播放(待完善)

前言:之前的博客找的rtsp流地址,和按照red5 都是为写这篇文章铺垫。

 这篇文章,选择 ffmepg命令 把rtsp流转为rtmp,

接着vlc插件测试下生成的rtmp流。

最后 已经配置好了red5 服务器,并测试成功看到画面之后; 下面就来利用red5 实时查看rtmp 视频流; 

 命令行进入ffmepg目录,

执行命令

 ffmpeg -i rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov  -f flv -r 25 -s 640x480 -ar 44100 rtmp://localhost:1935/live/test2
有颜色的替换对应流名,为了得到后面一个流地址,还是下载nginx.exe
里面nginx.conf
如下
worker_processes  1;

error_log  logs/error.log debug;

events {
    worker_connections  1024;
}

rtmp {
    server {
        listen 1935;

        application live {
            live on;
        }
		
        application hls {
            live on;
            hls on;  
            hls_path temp/hls;  
            hls_fragment 8s;  
        }
    }
}

http {
    server {
        listen      8080;
		
        location / {
            root html;
        }
		
        location /stat {
            rtmp_stat all;
            rtmp_stat_stylesheet stat.xsl;
        }

        location /stat.xsl {
            root html;
        }
		
        location /hls {  
            #server hls fragments  
            types{  
                application/vnd.apple.mpegurl m3u8;  
                video/mp2t ts;  
            }  
            alias temp/hls;  
            expires -1;  
        }  
    }
}

  注意黑体的,test2 是自己取的,执行完命令,把  rtmp://localhost:1935/live/test2   放入vlc插件 中测试

视频流能播放,但是不完整?似乎丢包,得到rtmp流,把流放入red5测试。

原文地址:https://www.cnblogs.com/yizhizhangBlog/p/9953675.html