[Live-devel] streaming video and audio via RTSP
Mike Gilorma
mike.gilorma at apogeelabs.com
Wed Jun 18 06:33:06 PDT 2008
Problem solved:
There was no problem with synchronization between my test program and
VLC. Although my test file played back fine locally in VLC, there must
have been some problems in the file that VLC could overcome when playing
locally that got exposed when trying to stream using RTSP. I was using
the only mp4 file that I had at my disposal because I was having trouble
creating a new test file. But I figured it out, so here's a little help
for those of you who are struggling a little. (I'm running FC7).
1. create avi from dvd:
mencoder dvd://1 -o test.avi -oac faac -ovc lavc -lavcopts vcodec=mpeg4
- or -
mencoder dvd://1 -o test.avi -oac faac -ovc x264
2. convert avi to mp4:
ffmpeg -i test.avi -vcodec mpeg4 test.mp4
- or -
ffmpeg -i test.avi -vcodec h264 test.mp4
3. extract tracks from mpeg4 file:
mp4creator -extract=<track #> test.mp4
On Fri, 2008-06-13 at 11:07 -0400, Mike Gilorma wrote:
> I've attached my test program, each stream has rtcp, and the timestamps
> are being set using timeofday. The VLC says the streams are
> synchronized, but I am looking into doing more debug on the client side.
> It looks like the video is started streaming before the audio and that
> is where the streams get out of sync. I noticed this because I was
> outputting the timestamps and saw that when starting up the video
> streams out data for a little bit before audio starts up.
>
> thanks for the help,
> mike
>
>
> On Thu, 2008-06-12 at 22:56 -0700, Ross Finlayson 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?
> >
> > Using a single "ServerMediaSession", containing two
> > "ServerMediaSubsession" objects - one for video; the other for audio.
> >
> > Also, to ensure that the audio and video get synchronized at the
> > client, you *must* give them accurate presentation times at the
> > server end - and implement RTCP for each stream. Also (and this is
> > important), the presentation times *must* correspond to 'wall-clock'
> > time - i.e., the time that you would get by calling "gettimeofday()".
> >
> > If you do this, then the presentation times that come out the client
> > end (after RTCP-synchronization) *will* be same as those that you
> > gave the frames at the server end, and then the client will be able
> > to use those to synchonize audio and video.
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel
More information about the live-devel
mailing list