Comments (2)
ZLMediaKit处理Rtmp推流的对象是RtmpSession类,该对象具体处理推流音视频rtmp数据的代码如下:
上图中_pPublisherSrc
变量其实是RtmpToRtspMediaSource类型,我们现在看看RtmpToRtspMediaSource对象的onWrite方法:
从上图中我们看到了_rtmpDemuxer变量,该变量是RtmpDemuxer对象,用于解析rtmp包并解复用为H264和AAC。
RtmpToRtspMediaSource派生于RtmpMediaSource对象,除了基类的功能,它还实现了rtmp转rtsp/hls、mp4录制的功能。实现这些功能前都要先解复用成H264和AAC才能实现。所以你可以在RtmpToRtspMediaSource对象中提取到你想要的帧数据,也能知道此处对应的推流来自哪里。
RtmpDemuxer对象是你实现你想要功能的关键,通过RtmpDemuxer::getTracks
方法你能获取到音视频的Track对象,Track对象可以提取出譬如sps、pps等信息,也能获取到音视频流。
你可以通过这种方式来截取帧数据并处理:
from zlmediakit.
十分感谢!
from zlmediakit.
Related Issues (20)
- [技术咨询] k8s部署集群模式时,源站是否能支持动态的扩缩容呢? HOT 2
- [编译问题] 建议修改项目构建目录命令(必填) HOT 2
- webrtc一直转圈圈 HOT 4
- zlm报错超大的rtp包,日志见内容 HOT 20
- [技术咨询] 升级webrtc拉取最新的ZLM程序,sdp交换请求失败,提示regex_error HOT 21
- 请问发送端有什么bug呢?rtsp流是可用的,用rtsp播放器是可以正常播放的 HOT 3
- [技术咨询] 如果使用k8s部署,端口暴露问题怎么解决(端口范围)? HOT 3
- [技术咨询] 请问一下分辨率问题 HOT 1
- [BUG] 添加拉流代理,开启mp4 录像,设置auto_close:false 没有效果 HOT 5
- [技术咨询] 如何开启rtp dump 文件 HOT 2
- RtmpMediaSourceMuxer类在析构时crash[BUG] BUG现象描述(必填) HOT 4
- [技术咨询] /index/api/addFFmpegSource 接口的咨询 HOT 5
- [BUG] iOS真机调用mk_player_play进行拉流时发生crash HOT 1
- [技术咨询] 咨询描述(必填)
- 手机端浏览器如何播放 HOT 3
- WebRTC P2P connection HOT 4
- [功能请求] mp4点播接口loadMP4File 流能支持倍数播放以及根据seek 指定时间播放 HOT 7
- [BUG] 发送hook时 unable to get local issuer certificate is:closed HOT 6
- 使用rtsp推流时,webrtc测试页面无法播放该流,但显示播放成功,跪求指教 HOT 1
- IO速度优化 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zlmediakit.