How to combine live H.264 source and AAC source
2014-07-24 01:03:54 GMT
发件人: 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
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:
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,NULL);
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!
_______________________________________________ live-devel mailing list live-devel <at> lists.live555.com http://lists.live555.com/mailman/listinfo/live-devel