A/V Sync in IWMWriter::WriteSample issue
WMPTalk.com Forum Index WMPTalk.com
Discuss Windows Media Player
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web wmptalk.com
A/V Sync in IWMWriter::WriteSample issue

 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> SDK
Author Message
hcurreem
Guest





Posted: Thu Sep 23, 2004 12:51 pm    Post subject: A/V Sync in IWMWriter::WriteSample issue Reply with quote

I created an application that can mix audio sample and video frames into an
wmv file. However I found that there might be something wrong when I
calcuate the sampletime when I call the WriteSample method. My application
provides an API for another application to insert audio or video buffer.
Therefore audio and video samples comes randomly. I keep a global variable
that keep track of the current movie time. Whenever there is an audio
sample (8k Sampling rate), I increase this global variable. As for video
samples, I didn't modify this global variable. Is there anything wrong
with my calcuation? The problem is that when I play the movie in Media
Player, it runs smoothly. But when I try to convert it to 3gpp format
(Using the nokia converter). Only part of the video can be coverted. If I
run RiverPast's VideoCleanup application with "regulate timecode" option
on. The output file can be converted correctly. So I suspect my sample
time calculation might be incorrect. Does anyone know what's the common
equation to calcuate the movie sample time? note that the video sample
comes randomly. Therefore I cannot assume any constant framerate.

Back to top
Becky Weiss [MS]
Guest





Posted: Sat Sep 25, 2004 2:27 am    Post subject: RE: A/V Sync in IWMWriter::WriteSample issue Reply with quote

If I understand correctly, although you have no guarantees about how you're
receiving audio and video relative to each other, you're just timestamping
video according to the amount of audio you've received.

While the WMFSDK writer won't have a problem with video frames being
timestamped erratically, it might be that when you're trying to convert it
into some other format, that code is getting flummoxed by the fact that your
samples' timestamps aren't following a nice frame rate. That's my guess as to
why that "regulate timecode" business is helping.

If you did know the frame rate of your incoming video, you could possibly
use that to assign more regular timestamps: just a thought.

One other thing it's worth mentioning is that you should pass samples into
IWMWriter::WriteSample as in-sync as you can. This helps make sure nothing
gets dropped and that memory usage isn't unnecessarily high.

Becky

This posting is provided AS IS with no warranties and confers no rights.

"hcurreem" wrote:

Quote:
I created an application that can mix audio sample and video frames into an
wmv file. However I found that there might be something wrong when I
calcuate the sampletime when I call the WriteSample method. My application
provides an API for another application to insert audio or video buffer.
Therefore audio and video samples comes randomly. I keep a global variable
that keep track of the current movie time. Whenever there is an audio
sample (8k Sampling rate), I increase this global variable. As for video
samples, I didn't modify this global variable. Is there anything wrong
with my calcuation? The problem is that when I play the movie in Media
Player, it runs smoothly. But when I try to convert it to 3gpp format
(Using the nokia converter). Only part of the video can be coverted. If I
run RiverPast's VideoCleanup application with "regulate timecode" option
on. The output file can be converted correctly. So I suspect my sample
time calculation might be incorrect. Does anyone know what's the common
equation to calcuate the movie sample time? note that the video sample
comes randomly. Therefore I cannot assume any constant framerate.

Back to top
 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> SDK All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Microsoft Office Forum New Topics
Powered by phpBB