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

Mailing List Archive: MythTV: Dev

Accuracy of external subtitles

 

 

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


stichnot at gmail

Mar 8, 2010, 11:24 PM

Post #1 of 12 (2130 views)
Permalink
Accuracy of external subtitles

I have noticed that when using external subtitles in MythVideo
(through a .srt file), synchronization starts off fine, but after
jumping forward or backward, synchronization is usually off, and
subtitles display too early, anywhere from about a half second to 5 or
6 seconds early. The offset stays consistent as long as there is no
jumping -- there is no drift and it looks like subtitles are turned on
and off correctly except for the shift. This also happens when
starting playback from the bookmark.

I checked TextSubtitles::GetSubtitles() and it appears that the
subtitle timecodes are correct and that the timecode argument passed
in is being matched to the correct subtitle. It appears that the
timecode argument does not necessarily represent the actual frame
being displayed. I tried running "mythcommflag --rebuild --file ..."
in case it's a seektable issue, but that didn't help. There are
comments in NuppelVideoPlayer::DisplayTextSubtitles() warning about
subtitles being out of sync, but I don't see how those warnings would
explain timecodes changing as a result of jumping around within the
same playback instance.

I've never seen anything like this with EIA-608 closed captions, and I
use them all the time. It seems that EIA-608 captions use
GetLastShownFrame()->timecode whereas text subtitles use
GetLastShownFrame()->frameNumber. Are these fields allowed to be
inconsistent?

Any thoughts/comments on this?

Jim
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


mtdean at thirdcontact

Mar 9, 2010, 1:53 PM

Post #2 of 12 (2062 views)
Permalink
Re: Accuracy of external subtitles [In reply to]

On 03/09/2010 02:24 AM, Jim Stichnoth wrote:
> I have noticed that when using external subtitles in MythVideo
> (through a .srt file), synchronization starts off fine, but after
> jumping forward or backward, synchronization is usually off, and
> subtitles display too early, anywhere from about a half second to 5 or
> 6 seconds early. The offset stays consistent as long as there is no
> jumping -- there is no drift and it looks like subtitles are turned on
> and off correctly except for the shift. This also happens when
> starting playback from the bookmark.
>
> I checked TextSubtitles::GetSubtitles() and it appears that the
> subtitle timecodes are correct and that the timecode argument passed
> in is being matched to the correct subtitle. It appears that the
> timecode argument does not necessarily represent the actual frame
> being displayed. I tried running "mythcommflag --rebuild --file ..."
> in case it's a seektable issue, but that didn't help. There are
> comments in NuppelVideoPlayer::DisplayTextSubtitles() warning about
> subtitles being out of sync, but I don't see how those warnings would
> explain timecodes changing as a result of jumping around within the
> same playback instance.
>
> I've never seen anything like this with EIA-608 closed captions, and I
> use them all the time. It seems that EIA-608 captions use
> GetLastShownFrame()->timecode whereas text subtitles use
> GetLastShownFrame()->frameNumber. Are these fields allowed to be
> inconsistent?
>
> Any thoughts/comments on this?
>

Related/similar to http://svn.mythtv.org/trac/ticket/7515 ?

Mike
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


brooks at whitefordsound

Mar 9, 2010, 2:17 PM

Post #3 of 12 (2067 views)
Permalink
Re: Accuracy of external subtitles [In reply to]

On 3/9/10, Jim Stichnoth <stichnot [at] gmail> wrote:
> I have noticed that when using external subtitles in MythVideo
> (through a .srt file), synchronization starts off fine, but after
> jumping forward or backward, synchronization is usually off, and
> subtitles display too early, anywhere from about a half second to 5 or
> 6 seconds early. The offset stays consistent as long as there is no
> jumping -- there is no drift and it looks like subtitles are turned on
> and off correctly except for the shift. This also happens when
> starting playback from the bookmark.
>
> I checked TextSubtitles::GetSubtitles() and it appears that the
> subtitle timecodes are correct and that the timecode argument passed
> in is being matched to the correct subtitle. It appears that the
> timecode argument does not necessarily represent the actual frame
> being displayed. I tried running "mythcommflag --rebuild --file ..."
> in case it's a seektable issue, but that didn't help. There are
> comments in NuppelVideoPlayer::DisplayTextSubtitles() warning about
> subtitles being out of sync, but I don't see how those warnings would
> explain timecodes changing as a result of jumping around within the
> same playback instance.
>
> I've never seen anything like this with EIA-608 closed captions, and I
> use them all the time. It seems that EIA-608 captions use
> GetLastShownFrame()->timecode whereas text subtitles use
> GetLastShownFrame()->frameNumber. Are these fields allowed to be
> inconsistent?
>
> Any thoughts/comments on this?
>
> Jim
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev [at] mythtv
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


brooks at whitefordsound

Mar 9, 2010, 2:21 PM

Post #4 of 12 (2058 views)
Permalink
Re: Accuracy of external subtitles [In reply to]

On 3/9/10, Jim Stichnoth <stichnot [at] gmail> wrote:
> I have noticed that when using external subtitles in MythVideo
> (through a .srt file), synchronization starts off fine, but after
> jumping forward or backward, synchronization is usually off, and
> subtitles display too early, anywhere from about a half second to 5 or
> 6 seconds early. The offset stays consistent as long as there is no
> jumping -- there is no drift and it looks like subtitles are turned on
> and off correctly except for the shift. This also happens when
> starting playback from the bookmark.
>
> I checked TextSubtitles::GetSubtitles() and it appears that the
> subtitle timecodes are correct and that the timecode argument passed
> in is being matched to the correct subtitle. It appears that the
> timecode argument does not necessarily represent the actual frame
> being displayed. I tried running "mythcommflag --rebuild --file ..."
> in case it's a seektable issue, but that didn't help. There are
> comments in NuppelVideoPlayer::DisplayTextSubtitles() warning about
> subtitles being out of sync, but I don't see how those warnings would
> explain timecodes changing as a result of jumping around within the
> same playback instance.
>
> I've never seen anything like this with EIA-608 closed captions, and I
> use them all the time. It seems that EIA-608 captions use
> GetLastShownFrame()->timecode whereas text subtitles use
> GetLastShownFrame()->frameNumber. Are these fields allowed to be
> inconsistent?
>
> Any thoughts/comments on this?
>
> Jim
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev [at] mythtv
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


stichnot at gmail

Mar 9, 2010, 3:21 PM

Post #5 of 12 (2052 views)
Permalink
Re: Accuracy of external subtitles [In reply to]

On Tue, Mar 9, 2010 at 1:53 PM, Michael T. Dean <mtdean [at] thirdcontact> wrote:
> On 03/09/2010 02:24 AM, Jim Stichnoth wrote:
>> Any thoughts/comments on this?
>>
>
> Related/similar to http://svn.mythtv.org/trac/ticket/7515 ?

I was wondering the same after seeing Taylor Ralph's update of #7515
this morning. I just got a chance to try out the essence of the patch
(i.e., using timecode instead of frameNumber), and so far it's working
perfectly, the subtitles are completely in sync.

Jim
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


support at drdos

Mar 9, 2010, 5:36 PM

Post #6 of 12 (2049 views)
Permalink
Re: Accuracy of external subtitles [In reply to]

Jim Stichnoth wrote:
> (i.e., using timecode instead of frameNumber), and so far it's working
> perfectly, the subtitles are completely in sync.
>

And I'm compiling mine now!

Doug

--
Ben Franklin quote:

"Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."

_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


support at drdos

Mar 9, 2010, 5:49 PM

Post #7 of 12 (2050 views)
Permalink
Re: Accuracy of external subtitles [In reply to]

Doug Lytle wrote:
>
> And I'm compiling mine now!
>

This fixed it for me as well.

Doug

--
Ben Franklin quote:

"Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."

_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


taylor.ralph at gmail

Mar 9, 2010, 8:22 PM

Post #8 of 12 (2047 views)
Permalink
Re: Accuracy of external subtitles [In reply to]

On Tue, Mar 9, 2010 at 6:21 PM, Jim Stichnoth <stichnot [at] gmail> wrote:
> On Tue, Mar 9, 2010 at 1:53 PM, Michael T. Dean <mtdean [at] thirdcontact> wrote:
>> On 03/09/2010 02:24 AM, Jim Stichnoth wrote:
>>> Any thoughts/comments on this?
>>>
>>
>> Related/similar to http://svn.mythtv.org/trac/ticket/7515 ?
>
> I was wondering the same after seeing Taylor Ralph's update of #7515
> this morning.  I just got a chance to try out the essence of the patch
> (i.e., using timecode instead of frameNumber), and so far it's working
> perfectly, the subtitles are completely in sync.
>
> Jim

Using the timecode is definitely the right solution. The code
currently using frame numbers and rates is essentially flawed since
not only can the rate change but you can also have repeated frames
which aren't accounted for in the calculations. The only modification
needed to the timecode patch is to account for the start time and wrap
bits which are both available via AVContext and AVStream. A simple
function can be added to avformatdecoder.cpp to handle this. Once
that's completed and tested it can be committed.

Regards.

--
Taylor
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


taylor.ralph at gmail

Mar 9, 2010, 8:23 PM

Post #9 of 12 (2046 views)
Permalink
Re: Accuracy of external subtitles [In reply to]

On Tue, Mar 9, 2010 at 11:22 PM, Taylor Ralph <taylor.ralph [at] gmail> wrote:
> On Tue, Mar 9, 2010 at 6:21 PM, Jim Stichnoth <stichnot [at] gmail> wrote:
>> On Tue, Mar 9, 2010 at 1:53 PM, Michael T. Dean <mtdean [at] thirdcontact> wrote:
>>> On 03/09/2010 02:24 AM, Jim Stichnoth wrote:
>>>> Any thoughts/comments on this?
>>>>
>>>
>>> Related/similar to http://svn.mythtv.org/trac/ticket/7515 ?
>>
>> I was wondering the same after seeing Taylor Ralph's update of #7515
>> this morning.  I just got a chance to try out the essence of the patch
>> (i.e., using timecode instead of frameNumber), and so far it's working
>> perfectly, the subtitles are completely in sync.
>>
>> Jim
>
> Using the timecode is definitely the right solution. The code
> currently using frame numbers and rates is essentially flawed since
> not only can the rate change but you can also have repeated frames
> which aren't accounted for in the calculations. The only modification
> needed to the timecode patch is to account for the start time and wrap
> bits which are both available via AVContext and AVStream. A simple
> function can be added to avformatdecoder.cpp to handle this. Once
> that's completed and tested it can be committed.
>

FYI, the sooner I get a sample with a corresponding .srt the sooner
this will get fixed. ;)

--
Taylor
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


robert.mcnamara at gmail

Mar 15, 2010, 9:16 AM

Post #10 of 12 (1746 views)
Permalink
Re: Accuracy of external subtitles [In reply to]

Jim et al--

Taylor has attached a patch to #7515... the sooner one of you guys can
test and confirm that all is well, the sooner we can finish this one
up (and get .23 out). Thanks.

Robert
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


stichnot at gmail

Mar 15, 2010, 9:47 AM

Post #11 of 12 (1755 views)
Permalink
Re: Accuracy of external subtitles [In reply to]

On Mon, Mar 15, 2010 at 8:16 AM, Robert McNamara
<robert.mcnamara [at] gmail> wrote:
> Jim et al--
>
> Taylor has attached a patch to #7515... the sooner one of you guys can
> test and confirm that all is well, the sooner we can finish this one
> up (and get .23 out).  Thanks.

I will try it out tonight.

However, I only have simple test cases where the start time is 0,
there is no wrapping, and there are no repeated frames or changes in
the frame rate. Hopefully the person who created #7515 can also test
the patch.

Jim
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


stichnot at gmail

Mar 15, 2010, 9:49 PM

Post #12 of 12 (1721 views)
Permalink
Re: Accuracy of external subtitles [In reply to]

On Mon, Mar 15, 2010 at 8:47 AM, Jim Stichnoth <stichnot [at] gmail> wrote:
> On Mon, Mar 15, 2010 at 8:16 AM, Robert McNamara
> <robert.mcnamara [at] gmail> wrote:
>> Jim et al--
>>
>> Taylor has attached a patch to #7515... the sooner one of you guys can
>> test and confirm that all is well, the sooner we can finish this one
>> up (and get .23 out).  Thanks.
>
> I will try it out tonight.

Looks like Taylor checked it in before I got a chance to report that
it works perfectly for me. Thanks!

Jim
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

MythTV dev 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.