[mythtv-users] AV-Sync problem

David Wong david.wong at marvel.com.hk
Sat Apr 18 15:24:49 UTC 2009


----- "Jean-Yves Avenard" <jyavenard at gmail.com> wrote:
> Hi
> 
> 2009/4/18 David Wong <david.wong at marvel.com.hk>:
> > Konichiwa~ ( but that clip is indeed a Taiwan channel :) )
> >
> > I just found with Mythtv 0.21 branch r20300 with vdpau patch,
> standard decoder and xv-blit,
> > that 2 minutes clip is not long enough to show audio buffer underrun
> on my Nvidia 9400 IGP
> >
> > With "svn trunk", you mean 0.22 working trunk?
> > I will have a try on it later.
> 
> This is more likely a ffmpeg issue than a VDPAU issue.
> ffmpeg in 0.21 is rather outdated .. For examples, I've seen a few
> h264 videos with AAC audio completely out of sync and lots of error
> like you mentioned..
> 
> Mind you, the ffmpeg in 0.22 isn't that much better. The video with
> AAC audio that I couldn't play with 0.21 still fail in 0.22 ; except
> this time the issue is different. It either plays the sound at an
> extremely low speed ; or it simply crashes.
> 
> Can't wait for the next ffmpeg sync ; this is what will make me move
> to trunk.
> 
> Jean-Yves
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

Hi

I don't know if you guys can read my message in mythtv-dev list,
'cos no one response to my message there.
So I resend my more technical findings here.

I tried MythTV standard decoder and xv-blit renderer.
It hits a longer time before audio buffer starting to underrun.

I further look into the stream using my home-brew TS demuxer.
Video and Audio PES packets are almost 2 seconds apart

See attached log.
PID 141 is video, PID 142 is audio
PTS rate should be 90000 per second.

I checked the 0.21 libmythtv code. It seems directly sending audio data to buffer via AddAudioData(),
whenever avformatdecoder hit an audio frame. But video has it own output thread and queue.
I have perception that with this architecture, the AV-Sync is very rely on the tight distance
between video and audio packet.

It is better that both Video and Audio have their own output buffer,
each data chunk entry in each buffer should associated with time stamp.
Video and audio are then sent out when time reached.
At start of clip, there may be video without corresponding audio.
Then just send out video first and then start to send out audio when at
appropriate time.

David 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ch14_output.txt
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20090418/25756400/attachment.txt>


More information about the mythtv-users mailing list