Audio/Video synchronization
Audio/Video synchronization
- Subject: Audio/Video synchronization
- From: Rahul <email@hidden>
- Date: Wed, 07 Jun 2006 17:45:42 +0530
Hi Group,
We have the typical problem of audio and video synchronization. The
synchronization logic is completely handled by us. We are using CoreGraphics
to display the video frames. The audio is played through CoreAudio. We are
using the default output device for audio playback.
The following is the input stream description.
Sample Rate:32000.000000
Format ID:lpcm
Format Flags:C
Bytes per Packet:4
Frames per Packet:1
Bytes per Frame:4
Channels per Frame:2
Bits per Channel:16
The duration of each packet in the input stream is a multiple of 64 msec.
Output stream description:
Sample Rate:44100.000000/32000.000000
Format ID:lpcm
Format Flags:B
Bytes per Packet:8
Frames per Packet:1
Bytes per Frame:8
Channels per Frame:2
Bits per Channel:32
We are using audio converter (standard) to map the input and output stream
formats.
The master clock is set with the time stamp on the audio packet. This is
done through regular notifications from the input procedure that supplies
data to the Audio Converter (ACComplexInputProc in the PlayAudioFileLite
example). We get the time difference ( in AbsoluteTime) between two calls to
this input procedure. We consider this time difference as the duration of
the sample already played. When this difference adds up to the duration of
the input audio packet we set the master clock to the new audio packet
timestamp.
But the same logic ,
1.for a default output device of 44100 sample rate finds the video running
behind audio
2. default output device of 32000 sample rate finds the audio running behind
video
We have also observed that CoreAudio plays an audio packet for a time more
than its calculated duration . It looks like it is extrapolating the packet.
Any inputs on this? Or is there any other method in CoreAudio ( truly
indicating the playing status) which we could use to update our master
clock.
Thank you.
Regards,
Rahul.
-----------------------------------------------
Robosoft Technologies - Come home to Technology
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden