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)
- [功能请求] 是否可以通过添加内置流 不再需要发送post请求或者ffmpeg转推 HOT 23
- [BUG] 往其他国标服务器推流不能播放 HOT 4
- [BUG] 国标取流,个别设备未成功推流到ZLmediaKit HOT 1
- [BUG] 国标取流,ZLmediaKit未识别到个别设备的推流 HOT 10
- [BUG] After a long time running, there is no response to HTTP requests sent to docker container zlmediakit HOT 14
- zlm证书开启https使用腾讯云免费证书提示asn1 encoding routines:asn1_check_tlen:wrong tag HOT 9
- [编译问题] ZLM拉流HLS启用失败,VLC是可以正常播放的 HOT 1
- [BUG] 视频录制缩短问题 HOT 1
- [BUG] 视频录制缩短问题 HOT 1
- [编译问题] 使用wvp-GB28181-pro对接GB28181视频,前后端服务启动后,连接ZLM失败 HOT 1
- 添加FFmpeg拉流代理设置水印参数错误 HOT 8
- rtmp播放首帧水印问题 HOT 1
- rtmp播放首帧水印问题 HOT 2
- [BUG] obs推流报错 HOT 1
- [功能请求] 可以支持点播远程RTSP协议的录像文件吗? HOT 1
- webrtc 播放问题 求各位大佬指导
- webapi中通过api_regist函数启动多线程,会导致多个线程只在一个cpu核心中运行
- In the webAPI, through the api_regist function, multiple threads are launched, which will result in multiple threads running on a single CPU core. HOT 1
- ZLM-心跳超时
- [BUG] The make method of ServiceController may not be thread safe 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.