Ok, so I got it working somewhat. I can play the stream using VLC
(although it stops after 41 seconds for some reason).  I found that
Quicktime plays back the entire stream without any problems.  However,
with both players, the audio is no in sync with the video.  Not sure why
this is, I'm sure there is something I am missing here.  Looking at the
wireshark capture of the network stream, I can see that the timestamps
on the two streams do not match up.  Does that have something to do with
it?  

I have attached my test program.

Again, any help on this subject is greatly appreciated.

-Mike

On Mon, 2008-06-09 at 17:02 -0400, Mike Gilorma wrote:
> How do you go about streaming video and audio at the same time using
> RTSP?  I want to stream two elemental streams that I got out of a mp4
> file to VLC and have them playback just as if I was watching the
> original file.  Using the testOnDemandRTSPServer I can open the video
> stream in one instance of VLC and the audio stream in another instance
> of VLC.  How do you put the pieces together?  
> 
> I'm trying to write a simple program that can take video data and audio
> data from a file (for now...) and stream them in some fashion so that
> they can be payed back on a media player (like VLC) or received by
> another program and broken back out into separate video and audio data.
> 
> Any input on this subject would be greatly appreciated.
> 
> -Mike
> 
> 
> _______________________________________________
> live-devel mailing list
> [email protected]
> http://lists.live555.com/mailman/listinfo/live-devel
#include "liveMedia.hh"
#include "BasicUsageEnvironment.hh"
#include "GroupsockHelper.hh"

int main(int argc, char** argv) {
  // Begin by setting up our usage environment:
    UsageEnvironment* env;
    TaskScheduler* scheduler = BasicTaskScheduler::createNew();
    env = BasicUsageEnvironment::createNew(*scheduler);

    char const* inputFileName = "test.m4e";
    char const* FileName = "test.aac";

    struct in_addr destinationAddress;
    destinationAddress.s_addr = chooseRandomIPv4SSMAddress(*env);

    // Note: This starts RTCP running automatically
    RTSPServer* rtspServer = RTSPServer::createNew(*env, 8554);
    if (rtspServer == NULL) {
        *env << "Failed to create RTSP server: " << env->getResultMsg() << "\n";
        exit(1);
    }

    ServerMediaSession* video = ServerMediaSession::createNew(*env, "testStream", inputFileName,
            "Session streamed by \"testMPEG4VideoStreamer\"", True /*SSM*/);
    video->addSubsession(MPEG4VideoFileServerMediaSubsession::createNew(*env, inputFileName, true));
    video->addSubsession(ADTSAudioFileServerMediaSubsession::createNew(*env, FileName, true));
    rtspServer->addServerMediaSession(video);

    char* url = rtspServer->rtspURL(video);
    *env << "Play this stream using the URL \"" << url << "\"\n";
    delete[] url;

    // Start the streaming:
    *env << "Beginning streaming...\n";

    env->taskScheduler().doEventLoop(); // does not return

    return 0; // only to prevent compiler warning
}
_______________________________________________
live-devel mailing list
[email protected]
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to