[mythtv] [PATCH] A/V sync for streaming transcoder
ou401cru02 at sneakemail.com
Tue Aug 19 12:05:08 EDT 2003
Here is a patch which implements audio-video sync while using the streaming output of the transcoder. I have tested it a bit, and it seems to do something, but I haven't found any shows which exhibit significant enough A/V seperation to notice if it works.
There is no elegant way of doing A/V sync when streaming output (unlike watching video, you can't modify the rate that you display frames). The only solution is to either add/remove audio, or add/remove video frames. I chose the latter approach, since I find stuttering audio to be much more noticable than slightly choppy video. The code tries to gradually catch up over several frames so as not to be as noticable. In general, I am seeing that audio is more likely to lag the video than lead it, which means that we will drop video frames (somewhat less obtrusive than adding duplicates). All I can say is, try it and see if it works for you.
If you see lots of messages about adjusting sync, something is probably very wrong. I get perhaps 10 or so messages on a half-hour program.
The code will try to keep the audio synced to within 0.1sec of the video, which is about what myth tries to do as well.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1824 bytes
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20030819/a750778b/transcode13.bin
More information about the mythtv-dev