Comments (3)
你好,这个可以同时推流H.264和AAC,可以参考这个 https://github.com/PHZ76/DesktopSharing
from rtmp.
你好,这个可以同时推流H.264和AAC,可以参考这个 https://github.com/PHZ76/DesktopSharing
感谢回复,我这边还有个语法上的问题向你请教下:
就是addTriggerEvent 触发事件的使用场景问题,比如rtmp publish中,使用handshake完成握手。如下所示:
m_taskScheduler->addTriggerEvent(this{
m_rtmpConn->handshake();
});
在rtsp server 代码中也使用此类触发事件完成channel 的增加和删除,但我看rtmp server代码中有的地方注释掉了addTriggerEvent,比如
//m_taskScheduler->addTriggerEvent([=]() {
m_rtmpConn->sendAudioData(timestamp, payload, payloadSize);
//});
我实际注释掉了握手部分的addTriggerEvent,如下所示,也是可以运行的。并在源码中实现时是采用将回调函数压栈,然后通过lambda表达式的方式进行事件触发。貌似不压栈也可以?
//m_taskScheduler->addTriggerEvent([this](){
m_rtmpConn->handshake();
//});
所以向你请教下,TriggerEvent使用场景是什么时候呢?为什么有的地方适合调用这个函数,有的地方不适用,需要注释掉呢?
from rtmp.
因为调用pushAudioFrame的线程 和 EventLoop的事件处理线程 不是同一个线程, addTriggerEvent 是为了线程安全,作用是投递事件到EventLoop的线程。这边改为在内部调用了,所以上面那里注释掉了。
from rtmp.
Related Issues (12)
- Error writing trailer of rtmp://127.0.0.1/live/stream: Connection reset by peer HOT 3
- What is audio_specific_config ????
- 这个RtmpPusher好像不能直接推flv格式 HOT 1
- 使用ASAN工具检测会提示一些内存异常
- StreamId is 4 bytes
- Cannot play in video.js HOT 1
- uint32_t capacity = rtmpMsg.length + rtmpMsg.length/m_outChunkSize*5 + 1024; 这里是怎么算的? HOT 2
- 时间长了音频和视频不同步 HOT 1
- 使用bilibili公司的flvjs无法播放http flv,使用ffplay.exe却可以播放http flv HOT 1
- 音视频不同步
- 能支持H265么?
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 rtmp.