# rtmp-flv-rtp-http-flv **Repository Path**: hammerstone/rtmp-flv-rtp-http-flv ## Basic Information - **Project Name**: rtmp-flv-rtp-http-flv - **Description**: RTMP --> FLV --> RTP 组播 --> HTTP-FLV 播放 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 3 - **Created**: 2024-10-09 - **Last Updated**: 2024-10-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## RTMP-FLV :warning: **这个发包还有点问题,先主要参考 dev 分支!!!** :warning: system.png ### 0. 依赖 - [rtmpdump](http://rtmpdump.mplayerhq.hu/librtmp.3.html): 最初的 librtmp 库? - 最初的下载地址: http://rtmpdump.mplayerhq.hu/download/ - 最新的源码: http://git.ffmpeg.org/rtmpdump - [srs-librtmp](https://github.com/ossrs/librtmp): SRS fork rtmpdump,基于 rtmpdump 改的,目前其实和 ffmpeg rtmpdump 是一样的 ### 1. 编译运行 - [CMakeLists.txt](CMakeLists.txt): 指定动态链接库,安装 openssl (版本不能太高,这里使用1.0.1相关版本) 和 zlib 等依赖包 ```shell cd build cmake .. && make ./main 127.0.0.1 recv.flv 30 ``` - g++: 手动链接也可以成功,将 openssl 两个动态库 `libcrypto.so` 和 `libssl.so` 以及 zlib 的一个动态库 `libz.so` 制到 build 文件夹,然后使用 g++ 编译 ```shell cd build g++ ../src/rtmp_receive.cpp -L. -lrtmp -lcrypto -lssl -lz -o main ./main 127.0.0.1 recv.flv 30 ``` ### 2. 常见错误 1. 构造函数初始化成员变量时最好使用 [member initialization](https://stackoverflow.com/questions/1711990/what-is-this-weird-colon-member-syntax-in-the-constructor): 主要参照原版 Rtp.h 中构造函数 2. 依赖 openssl zlib libssl-dev 等库,openssl 版本应该是 1.0.1不能是 openssl 1.1.1 ### 3. 参考 1. [Linux openssl 降级 - 凉城旧巷 - 博客园 (cnblogs.com)](https://www.cnblogs.com/linagcheng/p/15870060.html) 2. [RTMP 协议规范](https://www.cnblogs.com/Kingfans/p/7083100.html) 3. [librtmp库API介绍及其结构概述 H&A的博客](https://blog.csdn.net/qq_34305316/article/details/109401401) 4. [libRTMP使用说明-雷霄骅的博客](https://blog.csdn.net/leixiaohua1020/article/details/14229543) 5. librtmp 基本使用:https://blog.csdn.net/leixiaohua1020/article/details/42104893 ### todo 1. 云端节点 - [x] 接收 rtmp 流转 flv,并且将 flv 封装在 rtp payload 里面 - [ ] 缓存 flv 的数据结构:LRU? 2. 边缘节点 - [ ] 接收 rtp 数据包 - [x] 检测丢失,并通过 quic 重传 - [ ] 需要一个 HTTP 服务器托管 FLV 内容数据 3. 客户端 - [x] flv.js - [ ] mpegts.js