[Ffmpeg-devel] Audio/Video Syncing...

Ryan Martell rdm4
Sat Oct 14 00:58:57 CEST 2006


I have implented the rtsp streaming over h264.  Everything works  
against Darwin Streaming Server (packetization mode 1 & 2).  The only  
problem is that I can't figure out what I'm doing wrong on getting  
the audio/video to sync.

I have called this on the stream:
     av_set_pts_info(stream, 33, 1, 90000)

And 90kHz is the standard for h264 streaming.

When I let ffmpeg figure out the frame rate, sometimes it shows up as  
10 fps(r), and other times it shows up at 29.97 fps(r).

If I hardcode the fps (num=30000, and den= 1001), it will still  
sometimes playback at 10.

When I enable DEBUG_SYNC in ffplay, the pts value I'm giving it  
starts off around -9000 (this is because there is no rtcp packet yet  
to sync the timebase to, I think), then jumps to 0, and proceeds to  
go up from there.  The A-V delay will end up around 11 seconds at  
times, other times it will be closer to zero.

I suspect there is something obvious that I'm not doing, but I don't  
know where to look.

If I don't set the pts in the AVPacket, then I never get to the point  
where it displays the stream stats (until I hit quit).

What am I doing wrong?

-Ryan Martell

More information about the ffmpeg-devel mailing list