RTSP --- 推流拉流测试

安装 MediaMTX

用以转发视频流,可直接在github下载编译好的linux版本可执行文件 mediamtx_v1.9.3_linux_amd64.tar.gz

安装 ffmpeg

用以推送或拉取视频流

使用

运行转发服务器

$ ./mediamtx 
2024/11/10 16:39:18 INF MediaMTX v1.9.3
2024/11/10 16:39:18 INF configuration loaded from /home/chenjinhe/Desktop/newVolume/share/mediamtx_v1.9.3_linux_amd64/mediamtx.yml
2024/11/10 16:39:18 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)
2024/11/10 16:39:18 INF [RTMP] listener opened on :1935
2024/11/10 16:39:18 INF [HLS] listener opened on :8888
2024/11/10 16:39:18 INF [WebRTC] listener opened on :8889 (HTTP), :8189 (ICE/UDP)
2024/11/10 16:39:18 INF [SRT] listener opened on :8890 (UDP)

 

推送 1234.mp4 到服务器

ffmpeg -re -stream_loop -1 -i 123.mp4 -c copy -f rtsp rtsp://localhost:8554/mystream

 

ffmpeg -re -stream_loop -1 -i 123.mp4 -vf "crop=469:544:221:0,scale=400:464:flags=lanczos,format=yuv420p" -r 30 -vcodec libx264 -profile:v baseline -level 3 -g 20 -b:v 600k -an -f rtsp rtsp://localhost:8554/mystream

 

 

从服务器拉取视频流

ffplay -i rtsp://127.0.0.1:8554/mystream

 

posted @   流水灯  阅读(300)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
· SQL Server 2025 AI相关能力初探
· 为什么 退出登录 或 修改密码 无法使 token 失效
历史上的今天:
2017-11-10 Qt ------ 覆盖eventFilter(),捕获组件事件,事件处理
2017-11-10 Qt ------ 我定义的规则 之 对象命名规则
2016-11-10 STM8L --- External interrupt
点击右上角即可分享
微信分享提示