[Live-devel] Streaming aac audio and h264 video error
Francesco, Cuzzocrea
francesco at bltitalia.com
Mon Jul 9 09:03:17 PDT 2018
Hi to all
my target is to use the live555 library in order to stream live audio
and video
source. Video is in h264 format, while audio is in aac format. I found
some
similar questions but none of them exaustive.
As first step I downloaded and compiled all libraries and test program,
all was ok.
Then I used the mediaServer example in order to stream files and all is
ok too.
After this step I attempt to stream only video; so I created a subclass of
OnDemandServerMediaSubsession that I named myLiveServerMediaSession
:public OnDemandServerMediaSubsession.
In this class I created a subclass of FramedSource
(LiveSourceWithmyData :public FramedSource)
and created an H264VideoRTPSink. All works fine and I can stream my
video successfully.
Now I'm working in order to stream audio too, but I am facing a lot of
troubles.
In first step I used two files; an h264 one and an aac one (one for
audio and
one for video). Then I modified the
ServerMediaSession* createNewSMS(UsageEnvironment& env,char const*
fileName, FILE* fid);
adding this simple code:
if (strcmp(extension, ".strm") == 0) {
// Assumed to be an AAC Audio (ADTS format) file:
NEW_SMS("Live custom Stream");
OutPacketBuffer::maxSize = 100000; // allow for some possibly
large VP8 or VP9 frames
sms->addSubsession(H264VideoFileServerMediaSubsession::createNew(env,
"myvideostream.264", false));
sms->addSubsession(ADTSAudioFileServerMediaSubsession::createNew(env,
"reality.aac", reuseSource));
}else if ......
that is I added two subsession, one for video and one for audio, but
it doesn't
work. Using vlc I stream only the first session; in this case the
video one. If
I revert the two lines :
if (strcmp(extension, ".strm") == 0) {
// Assumed to be an AAC Audio (ADTS format) file:
NEW_SMS("Live custom Stream");
OutPacketBuffer::maxSize = 100000; // allow for some possibly
large VP8 or VP9 frames
sms->addSubsession(ADTSAudioFileServerMediaSubsession::createNew(env,
"reality.aac", reuseSource));
sms->addSubsession(H264VideoFileServerMediaSubsession::createNew(env,
"myvideostream.264", false));
}else if ......
I listen only the audio. What I missed ?
--
/*******************************************************************\
* Ing. Francesco Cuzzocrea
* company: BLT Italia srl web: http://www.blt.it
* address: via Rosselli, 91 city: Lido di CAMAIORE
* country: ITALY zip: 55043-i
* Tel. : +39 0584 904788 Fax: +39 0584 904789
* e-mail: francesco at bltitalia.com
\*******************************************************************/
More information about the live-devel
mailing list