View Full Version : Different timings with different programs
an3k
3rd February 2012, 16:01
Hi,
I'm currently working on converting a show from bought DVD to iPad and because I want to keep the original audio language i need subtitles.
The conversion itself is not a problem but getting the correct timings of the subtitles.
When i use DVDSubEdit I (think I) get the correct timings:
1
00:00:19,519 --> 00:00:22,760
NEON GENESIS - EVANGELlON
But when i use SubRip i get completely different timings:
1
00:00:19,820 --> 00:00:23,051
NEON GENESIS - EVANGELION
And finally Subtitle Edit with only minor differences:
1
00:00:19,520 --> 00:00:22,763
NEON GENESIS - EVANGELION
I don't use SubRip anymore but did so before because DVDSubEdit has a bad OCR. Currently i use DVDSubEdit to get the (correct?) timings, Subtitle Edit to get the content (good OCR + Spell check + AutoFix (REGEX, etc.)) and SubtitleWorkshop to merge content srt and timings srt.
Why do i get different results with each program? Aren't the timings saved in the IFO? What program reads the correct timings as saved on the DVD? DVDSubEdit or Subtitle Edit? Is there a better program? Suggestions?
Thank you very much!
Ghitulescu
3rd February 2012, 17:02
It's a good thing that you sense 300ms of delay for an item that is not really important :)
The timing is not given in seconds, but in "ticks", and each SW converts the ticks into h:m:s. I assume it's an NTSC DVD and thus it may have problems with 30fps vs. 30/1001.
amtm
3rd February 2012, 17:23
Edit: Actually looking at it, I can't see that the 30 and 30000/1001 difference actually could make such a huge difference even if that were the case.
an3k
3rd February 2012, 17:27
Thanks for your replies. The DVD is a PAL 25fps 720x576 4:3 interlaced.
I don't know how each program exactly works but is it possible that some are reading the IFO and some aren't, thus causing the differences?
amtm
3rd February 2012, 17:28
Okay, so then that's definitely not the issue, then.
amtm
3rd February 2012, 17:31
Also, is that the only subtitle that there were issues with, or were there more? Would it be possibly for you to post an extracted idx/sub pair that can be grabbed? I'm curious to see what could be causing such a huge difference especially since I can't remember seeing any major sync issues with SubRip before.
Ghitulescu
3rd February 2012, 19:13
Edit: Actually looking at it, I can't see that the 30 and 30000/1001 difference actually could make such a huge difference even if that were the case.
step by step you're starting giving more details ;) keep going :)
I don't know how each program exactly works but is it possible that some are reading the IFO and some aren't, thus causing the differences?
The timing is not in the IFOs, it's in the VOBs.
If the difference between the timings is kept more or less constant, like always those ~300ms, it may be that one uses the DTS one the PTS ticks. I tend to think that DVDsubedit reads correctly the timing.
amtm
3rd February 2012, 19:27
Yeah, SubRip uses PTS and converts that into its internally used timecode record.
amtm
3rd February 2012, 19:32
The relevant code for anyone who cares:
/PTS = Presentation Time Stamp (Compteur basé sur une horloge à 90KHz qui gere le moment precis auquel on doit afficher un élément)
function PTSToTCMs{(W1, W2, W3: Word)}: TTimeCodeMs;
var
L1, LMSec: Int64;
begin
//Ancienne methode, Calcule bizard !!
//(Reverse engeenering avec les valeurs affichées dans VobSnoopy)
{W1 := B4 + (B3 * $100); L1 := W1 Div 2;
L1 := L1 + ((B2 div 2) * ($10000 div 2));
L1 := L1 + (B1 * ($1000000 div 4));}
//Nouvelle methode basée sur une source linux en C
{L1 := (W1 shr 1) and $7; L1 := L1 shl 15; L1 := L1 + (W2 shr 1);
L1 := L1 shl 15; L1 := L1 + (W3 shr 1);}
L1 := //mpucoder's def (it's strange but it is equal to previous)
(PackBuf[27] and $FE) shr 1 +
PackBuf[26] shl 7 +
(PackBuf[25] and $FE) shl 14 +
PackBuf[24] shl 22 +
(PackBuf[23] and $0E) shl 29;
LMSec := TimerToMs(L1);
Result := MSecToTCMs(LMSec);
end;
function TimerToMs(const LTimer: Integer): Integer;
begin
Result := LTimer div 90; //Clock à 90Khz
end;
function MSecToTCMs(const LNbMSec: Integer): TTimeCodeMs; //Transforme un nombre de ms en time code
var
LSec: Integer;
begin
LSec := LNbMSec div 1000;
with Result do
begin
Hour := LSec div 3600;
Min := (LSec mod 3600) div 60;
Sec := LSec - (Hour * 3600) - (Min * 60);
Ms := LNbMSec mod 1000;
end;
end;
Since there is no syntax highlighting anything inbetween { } is commented out for anyone who doesn't know Delphi.
amtm
3rd February 2012, 19:37
Oh and DVDSubEdit uses PTS too. It parses it out this way:
uint ParsePTS(uchar* PTSIn)
{
// Parses the 5 bytes PTS and returns it as a 4 byte value.
uint PTSOut = 0;
PTSOut |= ((uint)PTSIn[4] >> 1); // bits 0-6
PTSOut |= ((uint)PTSIn[3] << 7); // bits 7-14
PTSOut |= ((uint)(PTSIn[2] & 0xFE) << 14); // bits 15-21
PTSOut |= ((uint)(PTSIn[1]) << 22); // bits 22-29
PTSOut |= ((uint)(PTSIn[0] & 0x0E) << 29); // bits 30-31
return PTSOut;
}
an3k
3rd February 2012, 19:58
I have issues with all subs from the DVD. I used SmartRipper but didn't made a 1:1 copy of the vobs but of every single program chain. I thought this could cause the problems and did a 1:1 copy of the vobs too.
With every program mentioned i created OCR -> srt files and (with those programs able to handle) idx/sub files of both, the single program chain ifo/vob and the whole dvd ifo/vob.
Attached are the results. Couldn't add the sub of the whole dvd - its too large but the idx is there.
Program Chain:
vts_01_1_VobSub_SubtitleEdit.srt1
00:00:19,820 --> 00:00:23,063
NEON GENESIS - EVANGELION
2
00:01:22,900 --> 00:01:23,822
Regie: Hideaki Anno
3
00:01:30,980 --> 00:01:33,267
Anno Domini 2015
215
00:21:22,060 --> 00:21:23,391
Start!
216
00:21:56,860 --> 00:21:58,988
Bleib am Leben, Shinji!
217
00:21:59,380 --> 00:22:00,745
FORTSETZUNG FOLGT ...
vts_01_1_SubRip.srt1
00:00:19,820 --> 00:00:23,051
NEON GENESIS - EVANGELION
2
00:01:22,900 --> 00:01:23,810
Regie: Hideaki Anno
3
00:01:30,980 --> 00:01:33,255
Anno Domini 2015
215
00:21:22,060 --> 00:21:23,379
Start!
216
00:21:56,860 --> 00:21:58,976
BIeib am Leben, Shinji!
217
00:21:59,380 --> 00:22:00,733
FORTSETZUNG FOLGT ...
The starting times are equal and the ending times only have a difference of ~12 ms. Both vts_01_1_DVDSubEdit.srt and vts_01_1_SubtitleEdit.srt need an adjustment of +300 ms for both, starting and ending time.
I think that you don't count ~11 ms difference as a huge one, right? If not, so far so good!
Whole DVD:
vts_01_1_VobSub_SubtitleEdit.srt1
00:00:19,820 --> 00:00:23,063
NEON GENESIS - EVANGELION
2
00:01:22,900 --> 00:01:23,822
Regie: Hideaki Anno
3
00:01:30,980 --> 00:01:33,267
Anno Domini 2015
1701
02:55:24,320 --> 02:55:29,167
Aber Du musst sie wegen des Jobs
treffen. Ich beneide Dich nicht darum.
1702
02:55:42,400 --> 02:55:45,563
Ich bin Soryu Asuka Langley.
Hallo!
1703
02:55:45,960 --> 02:55:47,530
FORTSETZUNG FOLGT ...
vts_01_1_SubRip.srt1
00:00:19,847 --> 00:00:23,078
NEON GENESIS - EVANGELION
2
00:01:22,927 --> 00:01:23,837
Regie: Hideaki Anno
3
00:01:31,007 --> 00:01:33,282
Anno Domini 2015
1701
03:03:20,513 --> 03:03:25,348
Aber du mußt sie wegen des Jobs
treffen. Ich beneide dich nicht darum.
1702
03:03:38,593 --> 03:03:41,744
Ich bin Soryu Asuka LangIey.
HaIIo!
1703
03:03:42,153 --> 03:03:43,711
FORTSETZUNG FOLGT ...
The starting times have difference of exactly 27 ms and the ending times of 15 ms - 16 ms at the beginning of the dvd. At the end the difference for the starting times is 7 minutes 57 seconds and for the ending times is 7 minutes 56 seconds. I think this IS a huge difference, isn't it? :) However, the other two programs have the same problem (~7 minutes difference) but their timings also differ 3 seconds to 5 seconds from SubRip timings.
EDIT: I tested the last program chain (end of DVD) with both "VobSub -> Subtitle Edit OCR -> srt" and "SubRip OCR -> srt" and the differences are 12 ms for the ending times (starting times are equal).
EDIT 2: I would love to use VobSub but the timings are not correct. If i compare to DVD the subtitles are shown a bit too long (there are some good scenes to compare). The DVDSubEdit timings look more correctly but there's the problem with the huge difference of ~8 minutes if i use the whole dvd and not only a program chain.
amtm
3rd February 2012, 20:03
Can you use directvobsub to extract from the ifo an idx/sub pair? I'd love to see what the idx has for timestamps to compare with.
an3k
3rd February 2012, 20:48
Can you use directvobsub to extract from the ifo an idx/sub pair? I'd love to see what the idx has for timestamps to compare with.Had to get it running on my Windows 7 x64 first. Took some time :/
VobSub -> vts_01_0.idx + vts_01_0.sub
Avidemux -> vts_01_0_Avidemux.idx + vts_01_0_Avidemux.sub
SubRip -> vts_01_1_SubRip.srt
VobSub -> Subtitle Edit OCR -> vts_01_1_VobSub_SubtitleEdit.srt
Avidemux -> Subtitle Edit OCR -> vts_01_1_Avidemux_SubtitleEdit.srt
The idx/sub pair created with VobSub has different timings than the idx/sub pair created with Avidemux. SubRip has exactly the same timings as Avidemux.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.