[MPlayer-dev-eng] mplayer/mencoder audio pts support

Corey Hickey bugfood-ml at fatooh.org
Sat Mar 4 00:13:42 CET 2006


John Koleszar wrote:
> Hi all,
> 
> Continuing along the lines of Corey's dwStart support, I think this 
> issue has broader scope on the decode side of things. I've yet to find a 
> way to handle files that have these kind of delayed streams in pts based 
> containers (asf in my case, will probably be an issue with nut too). 
> I've played with the autosync stuff, and I've hacked around with some of 
> the audio delay code similar to the dwStart support, and I can't get the 
> behavior I expect. My guess is that it's not really a sync issue (ie, 
> hypothetical metric audio_samples/frame is correct & constant) just the 
> streams are played offset by a constant amount. Overspeeding the video 
> isn't an acceptable way to make up this large of an offset. The dwStart 
> behavior seemed like the right route to go, but I couldn't make it work. 
> Maybe I just had the semantics wrong, so if that should do what I want, 
> please say so.

Can you upload a sample file somewhere? Also, feel free to post broken
patches so we can see what you tried; as long as you mention they're
broken you shouldn't get flamed. :)

> Specifically, the first video packet in my file has a pts of 5s and the 
> first audio packet has a pts of 9s. The proper behavior for this file 
> would be to start the video immediately, and then start the audio after 
> 4 seconds. Yes, I know this is a contrived example, and it's obviously 
> not common (at least with delays on this order of magnitude) in the 
> wild. Best real world use case I can imagine is short voice-overs with 
> long periods of silence in between.

I'm not sure about how to make mplayer play video without audio during
the delayed period... the other way around works, though. Without
delving into mplayer.c again, I seem to recall that it would require
some changes to (at least) the way mplayer handles A-V sync. This is one
of the things on the back of my mind that I would like to fix
eventually, but I'll let it wait until I've learned more about how
mplayer works. As always, anybody else is welcome to fix it. :)

> However contrived this example is, I want it to play properly, and am 
> willing to put the work in to fix it. I wanted to get some discussion 
> going on this list to make sure I fix it correctly. Can pts be relied 
> upon to be valid from all demuxers? Or is pts not the way to go? 
> Comments/caveats/suggestions accepted...

My knowledge in this area is still rather limited, so you probably won't
get too much help from me. Nevertheless, you have my full support, and I
hope the other developers lend you a hand when they are able. A-V sync
is a persistently annoying issue, and the more people we have improving
the code, the better.

-Corey




More information about the MPlayer-dev-eng mailing list