Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Users

Fun with subtitles and video timing (myth's clock seems fast)

 

 

MythTV users RSS feed   Index | Next | Previous | View Threaded


tim at electronghost

Nov 6, 2009, 4:42 PM

Post #1 of 2 (393 views)
Permalink
Fun with subtitles and video timing (myth's clock seems fast)

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
screen[1].

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>
"Dude." "Dude." "Dentist." "Dude."
-- Conversation overheard between two eCos hackers
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


tim at electronghost

Nov 7, 2009, 7:51 AM

Post #2 of 2 (341 views)
Permalink
Re: Fun with subtitles and video timing (myth's clock seems fast) [In reply to]

On Saturday 07 November 2009 00:42:55 Tim Smith wrote:
> 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 screen[1].
>
> 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?

Ah. Got it. The playPos calculation is wandering all over the place as actual
frame rate does not match alleged frame rate very often.

The tentative fix is simply to replace the computation with a direct use of
currentFrame->timecode. I'll raise a bug for people to shoot down in flames by
pointing out unintended side effects.


--
Tim Smith <tim [at] electronghost>
Palpatine's left leg sues for divorce on grounds of incompatibility.
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

MythTV users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.