[Live-devel] How to combine live H.264 source and AAC source

Xuan lkxkfl at hotmail.com
Wed Jul 23 18:03:54 PDT 2014


 

 

发件人: Xuan [mailto:lkxkfl at hotmail.com] 
发送时间: 2014年7月23日 23:01
收件人: live-devel at lists.live555.com
主题: How to combine live H.264 source and AAC source

 

Hello,

  I am working on a testing program based on live555. In my program, I use a
thread to capture video frames by webcam, and another thread to capture
audio frames. In each thread, both video and audio frames are encoded with
ffmpeg. Then I use a third thread to stream one of them. 

  My problem is that streaming either of them is Ok, but how can I stream
them together? If I do like this in a thread:

sms->addSubsession(PassiveServerMediaSubsession::createNew(*vSink, rtcp));

sms->addSubsession(PassiveServerMediaSubsession::createNew(*aSink,
audioRtcp));

rtspServer->addServerMediaSession(sms);

H264RealTimeStreamSource* naluSource =
H264RealTimeStreamSource::createNew(*env_live,&pThis->videoCList2,frame_rate
);

h264Source = H264VideoStreamDiscreteFramer::createNew(*env_live,
naluSource);

adtsSource =
ADTSRealTimeStreamSource::createNew(*env_live,&pThis->audioCList,1,44100,2,N
ULL);

pThis->startVideoLive = vSink->startPlaying(*h264Source,
afterPlayingLiveH264, NULL);

pThis->startAudioLive = aSink->startPlaying(*adtsSource,
afterPlayingLiveAAC, NULL);

I can only receive video frames with VLC player, and also timestamp of VLC
player is rather unstable.

Could I do anything wrong, or maybe I should stream h.264 and aac in
different thread rather than in one thread at the same time?

 

Thank you a lot. Looking forward for reply!

 

Xuan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20140724/b58f9f68/attachment.html>


More information about the live-devel mailing list