Streaming live H264 video from DM368
来源:互联网 发布:央视网络春晚策划方案 编辑:程序博客网 时间:2024/06/05 10:54
Appro already got a reference design on how to stream livevideo, but it's based on Appro's own framework. For people like mewho want to use DVSDK4, it's not very helpful. The Appro designalso used WIS-Streamer, which is not really necessary.
To build a simple live h264 streaming RTSP server, this is allyou need:
1. Download latest live555 source code. Modify config.armlinux,so that its CC options point to the compiler you use, run"./genMakefiles armlinux"
2. Modify testH264VideoStreamer.cpp
#include <liveMedia.hh>#include<BasicUsageEnvironment.hh>#include <GroupsockHelper.hh>#include<H264VideoFileServerMediaSubsession.hh>H264VideoStreamFramer* videoSource;int main(int argc, char** argv) {RTPSink* videoSink;char *inputFileName = argc>1?argv[1]: (char*)"live.264";// Begin by setting up our usageenvironment:TaskScheduler* scheduler =BasicTaskScheduler::createNew();UsageEnvironment*env =BasicUsageEnvironment::createNew(*scheduler);// Create 'groupsocks' for RTP andRTCP:struct in_addr destinationAddress;destinationAddress.s_addr =chooseRandomIPv4SSMAddress(*env);const unsigned short rtpPortNum =18888;const unsigned short rtcpPortNum =rtpPortNum+1;const unsigned char ttl = 255;const Port rtpPort(rtpPortNum);const Port rtcpPort(rtcpPortNum);Groupsock rtpGroupsock(*env,destinationAddress, rtpPort, ttl);rtpGroupsock.multicastSendOnly();Groupsock rtcpGroupsock(*env,destinationAddress, rtcpPort, ttl);rtcpGroupsock.multicastSendOnly();// Create a 'H264 Video RTP' sink from theRTP 'groupsock':OutPacketBuffer::maxSize =1<<17;videoSink = H264VideoRTPSink::createNew(*env,&rtpGroupsock, 96);RTSPServer* rtspServer =RTSPServer::createNew(*env, 8554);if (rtspServer == NULL) {*env<< "Failed to create RTSP server: "<< env->getResultMsg()<< "\n";exit(1);}ServerMediaSession* sms =ServerMediaSession::createNew(*env, "live", "live stream","Session streamed by "live264Streamer"", True );sms->addSubsession(H264VideoFileServerMediaSubsession::createNew(*env,inputFileName,True));rtspServer->addServerMediaSession(sms);char* url =rtspServer->rtspURL(sms);*env << "Play thisstream using the URL "" << url<< ""\n";delete[] url;env->taskScheduler().doEventLoop(); // does notreturnreturn 0; // only to prevent compilerwarning}void afterPlaying(void* ) {Medium::close(videoSource);}3. create a named pipe: mkfifo live.264
4. Redirect your output stream to live.264, if your code isbased on the encode demo, change writer.c
转自:http://blog.sina.com.cn/s/blog_5e330a280100r88v.html
- Streaming live H264 video from DM368
- Streaming live H264 video from DM368
- Streaming live video from ios(ios 流媒体)
- HowTo: Live streaming video/audio from VLC to your Android device (self.Android)
- HTML5 Dev (1) Live Video Streaming Player
- Scalable Live Video Streaming with NGINX Plus and BITMOVIN
- Android Streaming Live Camera Video to Web Page
- STREAMING LIVE WEBM VIDEO WITH FFMPEG.https://www.virag.si/2012/11/streaming-live-webm-video-with-ff
- Live Streaming
- Linux Video Streaming
- Jollen--Video Streaming 探讨
- p2p live streaming
- HLS HTTP Live Streaming
- Apple: HTTP Live Streaming
- HTTP Live Streaming 分析
- HTTP Live Streaming
- HLS (HTTP Live Streaming)
- HTTP Live Streaming直播
- Axis2整合spring
- android源码编译生成ramdisk.img和system.img解压和使用
- 最快速度找到内存泄漏
- hdu 1206 快速进制转换
- 我们在囧途之年终奖篇
- Streaming live H264 video from DM368
- 写了一个行代码,感觉挺好的,mark留念
- Core Graphics 101: 光滑的按钮
- 关于Android系统字体的一些知识
- 指尖下的代码 论程序猿的武功修为
- Java String.Format() 方法及参数说明
- Win8 在给列表绑定数据时,如果有需要 异步加载的数据时,一定要使用ObservableCollection
- myeclipse中修改默认编码(转)
- Hibernate的一个经典异常(org.hibernate.NonUniqueObjectException)