V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Jokerboozp
V2EX  ›  Java

rtsp 视频流转换为 http 视频流问题

  •  
  •   Jokerboozp · 166 天前 · 1092 次点击
    这是一个创建于 166 天前的主题,其中的信息可能已经有所发展或是发生改变。

    现在有一个 rtsp 视频流 rtsp://172.16.200.32:8554/stream 。我先用 ffmpeg 转码成 rtmp 视频流,格式是 flv ,链接是 rtmp://172.16.200.32/live/stream 。现在视频还是可以正常播放的。然后我用 Nginx 搭配上 nginx-rtmp-module 插件转换成 http 视频流。具体配置如下 rtmp { server { listen 1935; chunk_size 4096;

        application live {
            live on;
            record off;
        }
    }
    

    }

    http { server { listen 8080;

        location /live {
            flv_live on;
            chunked_transfer_encoding off;
        }
    }
    

    } 最后使用的 http 视频流链接是 http://172.16.200.32:8080/live/stream.flv 。但是就是没办法正常播放,提示无法连接。服务器的端口也正常能访问,这是为什么呢?

    6 条回复    2023-11-13 17:26:14 +08:00
    MoonWalker
        1
    MoonWalker  
       166 天前
    直接用 ZLMediakit 完事
    NessajCN
        2
    NessajCN  
       166 天前
    你等于是想通过 http 访问来播放 rtmp 流
    You just can't do that
    建议转成 hls 流
    mightybruce
        3
    mightybruce  
       166 天前
    rtmp 不可以 直接播放,
    毕竟各大浏览器已经淘汰 flv 了,要解析并播放需要前端的库,B 站那个著名 flv.js 可以用用。
    https://github.com/bilibili/flv.js
    另外 http-flv 方案一般也是通过 hls 来传输的。
    另外提供一个视频调试的网址
    https://player.alicdn.com/aliplayer/setting/setting.html

    有用,记得感谢我。
    ludongzhou
        4
    ludongzhou  
       166 天前
    a33291
        5
    a33291  
       166 天前
    zlm+1,直接从 rtsp 拉流就有 http 的 flv 了
    Jokerboozp
        6
    Jokerboozp  
    OP
       166 天前   ❤️ 1
    破案了各位大佬。。。服务器上有两个 nginx ,我配置的一直是没启动的那个 Nginx 。。。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1695 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 16:32 · PVG 00:32 · LAX 09:32 · JFK 12:32
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.