[Live-devel] About both audio and video working together

xiong xiong at chinadigipro.com
Wed Feb 23 18:12:05 PST 2005


Hi live-devel£¡

	1,
      I create
XXLiveByteStreamFileSource.hh
XXLiveMPEG4VideoFileServerMediaSubsession.hh
XXMICAudioFileServerMediaSubsession.hh
XXMICAudioFileSource.hh

    2,
	  Then I use this code to work.

{
¡¡¡¡        char const* streamName = "mpeg4live.mp4";
        char const* inputFileName_v = "/dev/xxstream_buff0";
         //char const* inputFileName_v = "/flashdisk/test.m4v";
        char const* inputFileName_a = "/dev/xxstream_buff1";
        //char const* inputFileName_a = "/flashdisk/test.pcm";
        Boolean convertToULaw = True;

        ServerMediaSession* sms = ServerMediaSession::createNew(*env, streamName, streamName,descriptionString);
        sms->addSubsession(XXMICAudioFileServerMediaSubsession::createNew(*env, inputFileName_a, reuseFirstSource, convertToULaw));
        sms->addSubsession(XXLiveMPEG4VideoFileServerMediaSubsession::createNew(*env, inputFileName_v, reuseFirstSource));
      rtspServer->addServerMediaSession(sms);

        char* url = rtspServer->rtspURL(sms);
        *env << "\n\"" << streamName << "\" stream, from the file \""<< inputFileName_v << "---" << inputFileName_a << "\"\n";
        *env << "Play this stream using the URL \"" << url << "\"\n";
        delete[] url;
}

	3,
	    sms->addSubsession(XXMICAudioFileServerMediaSubsession::createNew(*env, inputFileName_a, reuseFirstSource, convertToULaw));
        sms->addSubsession(XXLiveMPEG4VideoFileServerMediaSubsession::createNew(*env, inputFileName_v, reuseFirstSource));

		If I set the devices as my inputFile(/dev/xxstream_buff0  dev/xxstream_buff1)
		I want both audio and video working together, My quicktime can only see the live video good, But the sound can play 
only 1 second.
		I can play all this by set the inputFile test.m4v and test.pcm.
		I can paly this good by only one "sms->addSubsession" (video or audio)

	4,
		Would you have any suggestions to give me? 

Thanks and best regards,

xiong



More information about the live-devel mailing list