简体   繁体   中英

Live555 to stream live video and audio in one RTSP stream

I have been able to stream video using live555 on its own as well as audio to stream using live555 on its own.

But I want to have the video and audio playing on the same VLC. My video is h264 encoded and audio is AAC encoded. What do I need to do to pass these packets into a FramedSource.

What MediaSubsession/DeviceSource do I override, as this is not a fixed file but live video/live audio?

Thanks in advance!

In order to stream video/H264 and audio/MPEG4-GENERIC in the same RTSP unicast session you should do something like :

#include "liveMedia.hh"
#include "BasicUsageEnvironment.hh"

int main()
{
   TaskScheduler* scheduler = BasicTaskScheduler::createNew();
   BasicUsageEnvironment* env = BasicUsageEnvironment::createNew(*scheduler);
   RTSPServer* rtspServer = RTSPServer::createNew(*env);
   ServerMediaSession* sms = ServerMediaSession::createNew(*env);
   sms->addSubsession(H264VideoFileServerMediaSubsession::createNew(*env, "test.264",false));
   sms->addSubsession(ADTSAudioFileServerMediaSubsession::createNew(*env, "test.aac",false));
   rtspServer->addServerMediaSession(sms);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM