On Mon, Jun 22, 2009 at 2:32 PM, Arthur <[email protected]> wrote:

> Hello,
>
> Based on audio output I synchronize my video output. I noticed that some
> files do not exactly start with audio/video at the same time.
> I have a WMV file that has pAudioStream->start_time = 8000. I assume I can
> sync audio and video with the right use of this number, but I don't know
> what to do with this value.
> Does anyone know how to calculate the delay in for instance milliseconds
> (so
> I can calculate the correct video frame pts out of this value for instance)
> from this value?
>
> Best regards,
> Arthur
> _______________________________________________
> libav-user mailing list
> [email protected]
> https://lists.mplayerhq.hu/mailman/listinfo/libav-user
>

Ya I'm having the same problem. I'll repost a question I asked on a forum
here since I got no answer there.

For example:
The Video stream has a start_time of 64194, with a timebase of 1/90000
The Audio stream has a start_time of 56994, with a timebase of 1/90000.

The format context has a start_time of 633267.

So should I start playing the audio 64194 - 56994 = 7200 timebase units
(0.08 seconds) before the video? Where does the format context's start_time
come into play here?

What do I do if the first audio packet has a pts thats bigger than the audio
stream's start_time? Do I just play silence for the first little bit?

Or should the first decoded audio packet match up with the first decoded
video packet?

Thanks for any help.
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to