Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
3rd February 2012, 16:01 | #1 | Link |
Registered User
Join Date: Oct 2006
Location: Omicron Persei 8
Posts: 180
|
Different timings with different programs
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: Code:
1 00:00:19,519 --> 00:00:22,760 NEON GENESIS - EVANGELlON Code:
1 00:00:19,820 --> 00:00:23,051 NEON GENESIS - EVANGELION Code:
1 00:00:19,520 --> 00:00:22,763 NEON GENESIS - EVANGELION 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! |
3rd February 2012, 17:02 | #2 | Link |
Registered User
Join Date: Mar 2009
Location: Germany
Posts: 5,769
|
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.
__________________
Born in the USB (not USA) |
3rd February 2012, 17:27 | #4 | Link |
Registered User
Join Date: Oct 2006
Location: Omicron Persei 8
Posts: 180
|
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? Last edited by an3k; 3rd February 2012 at 17:29. |
3rd February 2012, 17:31 | #6 | Link |
Guest
Posts: n/a
|
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.
|
3rd February 2012, 19:13 | #7 | Link | ||
Registered User
Join Date: Mar 2009
Location: Germany
Posts: 5,769
|
Quote:
Quote:
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.
__________________
Born in the USB (not USA) |
||
3rd February 2012, 19:32 | #9 | Link |
Guest
Posts: n/a
|
The relevant code for anyone who cares:
Code:
/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; Code:
function TimerToMs(const LTimer: Integer): Integer; begin Result := LTimer div 90; //Clock à 90Khz end; Code:
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; |
3rd February 2012, 19:37 | #10 | Link |
Guest
Posts: n/a
|
Oh and DVDSubEdit uses PTS too. It parses it out this way:
Code:
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; } |
3rd February 2012, 19:58 | #11 | Link | |
Registered User
Join Date: Oct 2006
Location: Omicron Persei 8
Posts: 180
|
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.srt Quote:
Code:
1 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 ... 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.srt Code:
1 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 ... Code:
1 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 ... 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. Last edited by an3k; 3rd February 2012 at 20:10. |
|
3rd February 2012, 20:48 | #13 | Link | |
Registered User
Join Date: Oct 2006
Location: Omicron Persei 8
Posts: 180
|
Quote:
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. |
|
|
|