[mythtv-users] Fun with subtitles and video timing (myth's clock seems fast)

Tim Smith tim at electronghost.co.uk
Sat Nov 7 00:42:55 UTC 2009

Now here I am playing about with a .mkv and associated .srt file for subtitles 
in current trunk (revision 22750), mostly because I was having trouble working 
out how to get the font size bigger to make it wife-readable on a big 

Anyway, the subtitles seemed to be *way* in advance of where the dialogue had 
gotten to; my Cantonese is good enough to work that out at least.

So I tried it in mplayer. Works fine.

So, wondering WTH is going on, I open up the .srt and look at the timings. I 
check the timing in mplayer when the subtitle appears. Perfect.

I press pause in Myth's internal player and look at the elapsed time and 
compare it to the .srt's timing for when the visible subtitle should appear. 
Also perfect.

But wait a minute; the video is at a different place at 4:02 in mythtv's 
internal player.

So I try a wallclock test. I pause myth's internal player. It says 4:02 into 
the file. I unpause it and watch 60 seconds go by on my system clock[2]. I 
pause it again after 60 seconds. It says 5:14. Woah! Myth has invented 12 
seconds that my system clock didn't notice!

So I try some video wallclock timing on the same file. Using myth's internal 
player and mplayer I pause it at the same place (near as dammit), unpause, 
pause again after 60 seconds of wallclock time. Both are in the same place in 
the video (allowing for small errors in my initial pause). However, mythtv's 
elapsed time display has gained 10 seconds this time.

So the video timing (and audio too) is working great, but mythtv's internal 
wallclock is running fast, causing subtitles to appear early.

Anyone know where the wallclock lives?

[1] I discover in osd.cpp that it's hardcoded, which explains all the pages 
all over the 'net suggesting I lie about my display dimensions to fake an 
incorrect DPI. I thought "no thanks" and locally changed the font size and 
line spacing multiplier in my osd.cpp. There's gotta be something more elegant 
so maybe I'll work on that some time.
[2] And for the avoidance of doubt I also checked my system clock against some 
other timepieces.

Tim Smith <tim at electronghost.co.uk>
"Dude." "Dude." "Dentist." "Dude."
    -- Conversation overheard between two eCos hackers

More information about the mythtv-users mailing list