[Live-devel] streaming video and audio via RTSP

Mike Gilorma mike.gilorma at apogeelabs.com
Thu Jun 12 09:34:03 PDT 2008


It really looks like the timestamps are correct, I think the reason the
voice is not in sync with the video is because the video starts
streaming before the audio.  I put some debug into the source code to
show the timestamp for each packet of video and audio.  This output
shows me that multiple frames of video are being read out before the
audio starts streaming.  How can I resolve this issue?

I've attached the output and my test program.

Thanks,
Mike

On Tue, 2008-06-10 at 17:28 -0400, Mike Gilorma wrote:
> According to the output from VLC it says the rtp source has been
> synchronized twice (once for each??).  I looked through the code and see
> where the timestamp is getting set for each packet, the absolute time
> for each packet is very close, but after convertToRTPTimestamp gets
> called the time stamps for each stream are way off.  Is this what is
> expected? 
> 
> I haven't disabled any of the streams in VLC, but do notice that the
> timer in the lower corner counts up to 2 seconds then starts over at 0.
> Not sure if that has something to do with anything, just thought I would
> mention it.  At this point however, I am more concerned with
> synchronizing the streams than with VLC acting weird.  
> 
> Thanks for the assistance, 
> 
> -Mike
> 
> 
> On Tue, 2008-06-10 at 11:24 -0700, Jerry Johns wrote:
> > For both streams to be synchronized, u need to ensure that you set the
> > presentationTime for each packet of either audio or video – that is
> > the only way a receiver can synchronize what otherwise would seem to
> > be asynchronously transmitted streams. This can be done by getting it
> > from the input stream, or by manually calculating it using increments
> > of the frame time, etc. The latter method is however prone to drift,
> > and might not be applicable in all codec scenarios (variable time
> > encoded frames). The drift might also cause VLC/Quicktime to lose sync
> > after a while
> > 
> >  
> > 
> > As for your video/audio streams playing back, VLC will play them back
> > at the same time by default, unless you have disabled it manually (go
> > to the Video-> and Audio-> tabs to see if your stream is active, you
> > can disable it there too and that might have been what you did)
> > 
> >  
> > 
> > Hope it helps,
> > 
> >  
> > 
> > Jerry
> > 
> > 
> > _______________________________________________
> > live-devel mailing list
> > live-devel at lists.live555.com
> > http://lists.live555.com/mailman/listinfo/live-devel
> 
> 
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: elementStreamer.cpp
Type: text/x-c++src
Size: 1477 bytes
Desc: not available
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20080612/d81b2723/attachment-0001.bin>
-------------- next part --------------
fileName = test.m4e
fileName = test.aac
in 2nd part of create new
MPEG4ESVideoRTPSink rtpTimestampFrequency: 90000
playing dummy file
video timeStamp: 1213285996 322987
video timeStamp: 1213285996 322987
video timeStamp: 1213285996 322987
video timeStamp: 1213285996 322987
video timeStamp: 1213285996 322987
video timeStamp: 1213285996 322987
video timeStamp: 1213285996 322987
video timeStamp: 1213285996 322987
video timeStamp: 1213285996 322987
video timeStamp: 1213285996 322987
video timeStamp: 1213285996 322987
video timeStamp: 1213285996 322987
video timeStamp: 1213285996 322987
video timeStamp: 1213285996 322987
video timeStamp: 1213285996 322987
video timeStamp: 1213285996 388987
video timeStamp: 1213285996 388987
video timeStamp: 1213285996 454987
video timeStamp: 1213285996 454987
in create new stream source
in source:  payload: 97  frequency: 32000  configStr: 1290  numChans: 2
MPEG4GenericRTPSink rtpTimestampFrequency: 32000
MPEG4ESVideoRTPSink rtpTimestampFrequency: 90000
in create new stream source
in source:  payload: 97  frequency: 32000  configStr: 1290  numChans: 2
MPEG4GenericRTPSink rtpTimestampFrequency: 32000
setting fTimestampBase: 3895402619
setting fTimestampBase: 1697640784
audio timestamp: 1213285996 427267
video timeStamp: 1213285996 425460
video timeStamp: 1213285996 425460
video timeStamp: 1213285996 425460
video timeStamp: 1213285996 425460
video timeStamp: 1213285996 425460
video timeStamp: 1213285996 425460
video timeStamp: 1213285996 425460
video timeStamp: 1213285996 425460
video timeStamp: 1213285996 425460
video timeStamp: 1213285996 425460
video timeStamp: 1213285996 425460
video timeStamp: 1213285996 425460
video timeStamp: 1213285996 425460
video timeStamp: 1213285996 425460
video timeStamp: 1213285996 425460
video timeStamp: 1213285996 491460
video timeStamp: 1213285996 491460
audio timestamp: 1213285996 459267
audio timestamp: 1213285996 491267
video timeStamp: 1213285996 557460
video timeStamp: 1213285996 557460
audio timestamp: 1213285996 523267
audio timestamp: 1213285996 555267
video timeStamp: 1213285996 623460
video timeStamp: 1213285996 623460
audio timestamp: 1213285996 587267
audio timestamp: 1213285996 619267
video timeStamp: 1213285996 689460
video timeStamp: 1213285996 689460
audio timestamp: 1213285996 651267
video timeStamp: 1213285996 755460
audio timestamp: 1213285996 683267
video timeStamp: 1213285996 755460
audio timestamp: 1213285996 715267
audio timestamp: 1213285996 747267
video timeStamp: 1213285996 821460
video timeStamp: 1213285996 821460
audio timestamp: 1213285996 779267
audio timestamp: 1213285996 811267
video timeStamp: 1213285996 887460
video timeStamp: 1213285996 887460
audio timestamp: 1213285996 843267
audio timestamp: 1213285996 875267
video timeStamp: 1213285996 953460
video timeStamp: 1213285996 953460
audio timestamp: 1213285996 907267
audio timestamp: 1213285996 939267
video timeStamp: 1213285997 19460
video timeStamp: 1213285997 19460
audio timestamp: 1213285996 971267
audio timestamp: 1213285997 3267
video timeStamp: 1213285997 85460
video timeStamp: 1213285997 85460
audio timestamp: 1213285997 35267
audio timestamp: 1213285997 67267
video timeStamp: 1213285997 425460
video timeStamp: 1213285997 425460
video timeStamp: 1213285997 425460
video timeStamp: 1213285997 425460
video timeStamp: 1213285997 425460
video timeStamp: 1213285997 425460
audio timestamp: 1213285997 99267
audio timestamp: 1213285997 131267
audio timestamp: 1213285997 163267
audio timestamp: 1213285997 195267
audio timestamp: 1213285997 227267
audio timestamp: 1213285997 259267
audio timestamp: 1213285997 291267
audio timestamp: 1213285997 323267
audio timestamp: 1213285997 355267
audio timestamp: 1213285997 387267
audio timestamp: 1213285997 419267
video timeStamp: 1213285997 491459
video timeStamp: 1213285997 491459
video timeStamp: 1213285997 491459
audio timestamp: 1213285997 451267
audio timestamp: 1213285997 483267
video timeStamp: 1213285997 557460
video timeStamp: 1213285997 557460
video timeStamp: 1213285997 557460
audio timestamp: 1213285997 515267
audio timestamp: 1213285997 547267
video timeStamp: 1213285998 425460
video timeStamp: 1213285998 425460
video timeStamp: 1213285998 425460
video timeStamp: 1213285998 425460
video timeStamp: 1213285998 425460
video timeStamp: 1213285998 425460
audio timestamp: 1213285997 579267
audio timestamp: 1213285997 611267
audio timestamp: 1213285997 643267
audio timestamp: 1213285997 675267
audio timestamp: 1213285997 707267
audio timestamp: 1213285997 739267
audio timestamp: 1213285997 771267
audio timestamp: 1213285997 803267
audio timestamp: 1213285997 835267
audio timestamp: 1213285997 867267
audio timestamp: 1213285997 899267
audio timestamp: 1213285997 931267
audio timestamp: 1213285997 963267
audio timestamp: 1213285997 995267
audio timestamp: 1213285998 27267
audio timestamp: 1213285998 59267
audio timestamp: 1213285998 91267
audio timestamp: 1213285998 123267
audio timestamp: 1213285998 155267
audio timestamp: 1213285998 187267
audio timestamp: 1213285998 219267
audio timestamp: 1213285998 251267
audio timestamp: 1213285998 283267
audio timestamp: 1213285998 315267
audio timestamp: 1213285998 347267
audio timestamp: 1213285998 379267
audio timestamp: 1213285998 411267
video timeStamp: 1213285998 491460
video timeStamp: 1213285998 491460
audio timestamp: 1213285998 443267
audio timestamp: 1213285998 475267
video timeStamp: 1213285998 557459
video timeStamp: 1213285998 557459
audio timestamp: 1213285998 507267
audio timestamp: 1213285998 539267
video timeStamp: 1213285998 623460
video timeStamp: 1213285998 623460
audio timestamp: 1213285998 571267
audio timestamp: 1213285998 603267
video timeStamp: 1213285998 689460
video timeStamp: 1213285998 689460
audio timestamp: 1213285998 635267
audio timestamp: 1213285998 667267
video timeStamp: 1213285998 755459
video timeStamp: 1213285998 755459
audio timestamp: 1213285998 699267
audio timestamp: 1213285998 731267
video timeStamp: 1213285998 821460
video timeStamp: 1213285998 821460
audio timestamp: 1213285998 763267
audio timestamp: 1213285998 795267
video timeStamp: 1213285998 887460
video timeStamp: 1213285998 887460
audio timestamp: 1213285998 827267
audio timestamp: 1213285998 859267
audio timestamp: 1213285998 891267
video timeStamp: 1213285998 953459
video timeStamp: 1213285998 953459
audio timestamp: 1213285998 923267
audio timestamp: 1213285998 955267
video timeStamp: 1213285999 19460
video timeStamp: 1213285999 19460
audio timestamp: 1213285998 987267
audio timestamp: 1213285999 19267
video timeStamp: 1213285999 85460
video timeStamp: 1213285999 85460
audio timestamp: 1213285999 51267
audio timestamp: 1213285999 83267
video timeStamp: 1213285999 151459
video timeStamp: 1213285999 151459
audio timestamp: 1213285999 115267
audio timestamp: 1213285999 147267
video timeStamp: 1213285999 217460
video timeStamp: 1213285999 217460
audio timestamp: 1213285999 179267
audio timestamp: 1213285999 211267
video timeStamp: 1213285999 283460
video timeStamp: 1213285999 283460
audio timestamp: 1213285999 243267
audio timestamp: 1213285999 275267
video timeStamp: 1213285999 349459
video timeStamp: 1213285999 349459
audio timestamp: 1213285999 307267
audio timestamp: 1213285999 339267
video timeStamp: 1213285999 415460
video timeStamp: 1213285999 415460
audio timestamp: 1213285999 371267
audio timestamp: 1213285999 403267
video timeStamp: 1213285999 481460
video timeStamp: 1213285999 481460
audio timestamp: 1213285999 435267
audio timestamp: 1213285999 467267
video timeStamp: 1213285999 547459
video timeStamp: 1213285999 547459
audio timestamp: 1213285999 499267
audio timestamp: 1213285999 531267
video timeStamp: 1213285999 613460
video timeStamp: 1213285999 613460
audio timestamp: 1213285999 563267
audio timestamp: 1213285999 595267
video timeStamp: 1213285999 679460
video timeStamp: 1213285999 679460
audio timestamp: 1213285999 627267
audio timestamp: 1213285999 659267
video timeStamp: 1213285999 745459
video timeStamp: 1213285999 745459
audio timestamp: 1213285999 691267
audio timestamp: 1213285999 723267
video timeStamp: 1213285999 811460
video timeStamp: 1213285999 811460
audio timestamp: 1213285999 755267
audio timestamp: 1213285999 787267
video timeStamp: 1213285999 877460
video timeStamp: 1213285999 877460
audio timestamp: 1213285999 819267
audio timestamp: 1213285999 851267
video timeStamp: 1213285999 943459
video timeStamp: 1213285999 943459
audio timestamp: 1213285999 883267
audio timestamp: 1213285999 915267
audio timestamp: 1213285999 947267
video timeStamp: 1213286000 9460
video timeStamp: 1213286000 9460
audio timestamp: 1213285999 979267
audio timestamp: 1213286000 11267
video timeStamp: 1213286000 75460
video timeStamp: 1213286000 75460
audio timestamp: 1213286000 43267
audio timestamp: 1213286000 75267
video timeStamp: 1213286000 141459
video timeStamp: 1213286000 141459
audio timestamp: 1213286000 107267
audio timestamp: 1213286000 139267
video timeStamp: 1213286000 207460
video timeStamp: 1213286000 207460
audio timestamp: 1213286000 171267
audio timestamp: 1213286000 203267
video timeStamp: 1213286000 273460
video timeStamp: 1213286000 273460
audio timestamp: 1213286000 235267
audio timestamp: 1213286000 267267
video timeStamp: 1213286000 339459
video timeStamp: 1213286000 339459
audio timestamp: 1213286000 299267
audio timestamp: 1213286000 331267
video timeStamp: 1213286000 405460
video timeStamp: 1213286000 405460
audio timestamp: 1213286000 363267
audio timestamp: 1213286000 395267
video timeStamp: 1213286000 471460
video timeStamp: 1213286000 471460
audio timestamp: 1213286000 427267
audio timestamp: 1213286000 459267
video timeStamp: 1213286000 537460
video timeStamp: 1213286000 537460
audio timestamp: 1213286000 491267
audio timestamp: 1213286000 523267
video timeStamp: 1213286000 603459
video timeStamp: 1213286000 603459
audio timestamp: 1213286000 555267
audio timestamp: 1213286000 587267
video timeStamp: 1213286000 669459
video timeStamp: 1213286000 669459
audio timestamp: 1213286000 619267
audio timestamp: 1213286000 651267
video timeStamp: 1213286000 735459
video timeStamp: 1213286000 735459
audio timestamp: 1213286000 683267
audio timestamp: 1213286000 715267
video timeStamp: 1213286000 801460
video timeStamp: 1213286000 801460
audio timestamp: 1213286000 747267
audio timestamp: 1213286000 779267
video timeStamp: 1213286000 867460
video timeStamp: 1213286000 867460
audio timestamp: 1213286000 811267
audio timestamp: 1213286000 843267
video timeStamp: 1213286000 933460
video timeStamp: 1213286000 933460
audio timestamp: 1213286000 875267
audio timestamp: 1213286000 907267
video timeStamp: 1213286000 999459
video timeStamp: 1213286000 999459
audio timestamp: 1213286000 939267
audio timestamp: 1213286000 971267
audio timestamp: 1213286001 3267
video timeStamp: 1213286001 65459
video timeStamp: 1213286001 65459
audio timestamp: 1213286001 35267
audio timestamp: 1213286001 67267
video timeStamp: 1213286001 131459
video timeStamp: 1213286001 131459
audio timestamp: 1213286001 99267
audio timestamp: 1213286001 131267
video timeStamp: 1213286001 197460
video timeStamp: 1213286001 197460
audio timestamp: 1213286001 163267
audio timestamp: 1213286001 195267
video timeStamp: 1213286001 263460
video timeStamp: 1213286001 263460
audio timestamp: 1213286001 227267
audio timestamp: 1213286001 259267
video timeStamp: 1213286001 329460
video timeStamp: 1213286001 329460
audio timestamp: 1213286001 291267
audio timestamp: 1213286001 323267
video timeStamp: 1213286001 395459
video timeStamp: 1213286001 395459
audio timestamp: 1213286001 355267
audio timestamp: 1213286001 387267
video timeStamp: 1213286001 461459
video timeStamp: 1213286001 461459
audio timestamp: 1213286001 419267
audio timestamp: 1213286001 451267
video timeStamp: 1213286001 527459
video timeStamp: 1213286001 527459
audio timestamp: 1213286001 483267
audio timestamp: 1213286001 515267
video timeStamp: 1213286001 593460
video timeStamp: 1213286001 593460
audio timestamp: 1213286001 547267
audio timestamp: 1213286001 579267
video timeStamp: 1213286001 659460
video timeStamp: 1213286001 659460
audio timestamp: 1213286001 611267
audio timestamp: 1213286001 643267
video timeStamp: 1213286001 725460
video timeStamp: 1213286001 725460
audio timestamp: 1213286001 675267


More information about the live-devel mailing list