Problem with .ass subtitles timing, while encoding Chapters

Archive of historical bug reports.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
fenrir
Posts: 1
Joined: Sun Jul 29, 2012 12:04 pm

Problem with .ass subtitles timing, while encoding Chapters

Post by fenrir » Tue Jul 31, 2012 5:29 pm

Dear HandBrake team!
I didn't find anything similiar report on the forum, so I'll create a new post, about this bug, and I hope that it can be fixed!
I'm using the Nightly build of HandBrake.
-Version: svn4882
-Date of download: 2012.07.30
-Location of Download: HandBrake Site
-Platform: Linux, Windows (both)
-Settings: x264, 1280x720, "Normal profile"
-Operating System version: Windows 7, Debian Linux
-If possible, a crash report: it doesn't crash, only the encoded file has incorrect timing for the subtitles
-DVD title: it isn't a DVD, rather an .mkv file (but the same happens with any .mkv file!)
-What you were doing at the time besides encoding: nothing
-What other applications were running: Google Chrome
-Whether or not the problem is reproducible: yes it happens every time, with every .mkv file with .ass subtitles, when using the Chapters "" through "" function, and you start at anything else besides the first chapter.

When I'm encoding an .mkv file, and select Subtitles, Add, I can select the muxed-in .ass subtitle from the opened .mkv file, and if I'm encoding the whole file, everything works fine!
However, when I want to encode specific chapters, for example I select Chapters "2 through 4" the subtitles have incorrect timings, they're showed up later, than they should! Basically they have their original timecodes, and are not shifted, like they should, that's why their timing is bad!
For example: I'm encoding a file where, at 00:01:40 the line is "Hey!", and this shows up correctly when I encode the whole file. When I only want to encode Chapter 2-4, from the mkv file, and Chapter 1 is 1 minute long, this line will ALSO show up at 00:01:40, when it should be at 00:00:40 now, that chapter 1 isn't encoded in the new file!

Activity/verbose log here:

Code: Select all

HandBrake svn4882 2012073001
OS: Microsoft Windows NT 6.1.7600.0
CPU: Intel(R) Core(TM)2 Duo CPU     E6750  @ 2.66GHz
Ram: 3070 MB, Screen: 1920x1080
Temp Dir: C:\Users\Zero\AppData\Local\Temp\
Install Dir: C:\Program Files\Handbrake
Data Dir: C:\Users\Zero\AppData\Roaming\HandBrake\HandBrake\0.9.8.4877

-------------------------------------------

CLI Query:  -i "E:\Torrent\[WhyNot] Phi Brain - Kami no Puzzle S2 - 14 [D70F7CE8].mkv" -t 1 --angle 1 -c 6 -o "E:\Torrent\Ph_chapter6.mkv"  -f mkv  --strict-anamorphic  --modulus 16 -e x264 -q 20 --vfr -a 1 -E faac -6 dpl2 -R Auto -B 160 -D 0 --gain 0 --audio-copy-mask none --audio-fallback ffac3 --subtitle 1 --subtitle-default=1 --markers="C:\Users\Zero\AppData\Local\Temp\Ph_chapter6-1-chapters.csv" -x rc-lookahead=10:ref=1:subme=0:8x8dct=0:trellis=0 --verbose=1
User Query: False

[11:56:45] hb_init: starting libhb thread
HandBrake svn4882 (2012073001) - MinGW i686 - http://handbrake.fr
2 CPUs detected
Opening E:\Torrent\[WhyNot] Phi Brain - Kami no Puzzle S2 - 14 [D70F7CE8].mkv...
[11:56:45] hb_scan: path=E:\Torrent\[WhyNot] Phi Brain - Kami no Puzzle S2 - 14 [D70F7CE8].mkv, title_index=1
libbluray/bdnav/index_parse.c:157: indx_parse(): error opening E:\Torrent\[WhyNot] Phi Brain - Kami no Puzzle S2 - 14 [D70F7CE8].mkv/BDMV/index.bdmv
libbluray/bluray.c:1471: nav_get_title_list(E:\Torrent\[WhyNot] Phi Brain - Kami no Puzzle S2 - 14 [D70F7CE8].mkv) failed (02C73A40)
[11:56:45] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 4.1.3
libdvdread: Encrypted DVD support unavailable.
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[11:56:45] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from 'E:\Torrent\[WhyNot] Phi Brain - Kami no Puzzle S2 - 14 [D70F7CE8].mkv':
  Duration: 00:24:29.88, start: 0.000000, bitrate: 1528 kb/s
    Chapter #0.0: start 0.000000, end 28.920000
    Metadata:
      title           : Intro
    Chapter #0.1: start 28.920000, end 118.930000
    Metadata:
      title           : OP
    Chapter #0.2: start 118.930000, end 634.940000
    Metadata:
      title           : Part A
    Chapter #0.3: start 634.940000, end 1349.730000
    Metadata:
      title           : Part B
    Chapter #0.4: start 1349.730000, end 1439.910000
    Metadata:
      title           : ED
    Chapter #0.5: start 1439.910000, end 1469.885000
    Metadata:
      title           : Preview
    Stream #0.0(jpn): Video: h264 (High 10), yuv420p10le, 1280x720, PAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0.1(jpn): Audio: aac, 48000 Hz, stereo, s16 (default)
    Stream #0.2(eng): Subtitle: ass (default)
    Stream #0.3: Attachment: [0][0][0][0] / 0x0000
    Metadata:
      filename        : bluehigh.ttf
      mimetype        : application/x-truetype-font
    Stream #0.4: Attachment: [0][0][0][0] / 0x0000
    Metadata:
      filename        : Gabriola.ttf
      mimetype        : application/x-truetype-font
    Stream #0.5: Attachment: [0][0][0][0] / 0x0000
    Metadata:
      filename        : TT0841M.TTF
      mimetype        : application/x-truetype-font
    Stream #0.6: Attachment: [0][0][0][0] / 0x0000
    Metadata:
      filename        : 50416_.TTF
      mimetype        : application/x-truetype-font
    Stream #0.7: Attachment: [0][0][0][0] / 0x0000
    Metadata:
      filename        : ANNA_.otf
      mimetype        : application/x-truetype-font
    Stream #0.8: Attachment: [0][0][0][0] / 0x0000
    Metadata:
      filename        : blue highway rg.otf
      mimetype        : application/x-truetype-font
[11:56:45] scan: decoding previews for title 1
Scanning title 1...
Scanning title 1...
[11:56:46] scan: 10 previews, 1280x720, 23.976 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[11:56:46] scan: title (0) job->width:1280, job->height:720
[11:56:46] libhb: scan thread found 1 valid title(s)
+ title 1:
  + stream: E:\Torrent\[WhyNot] Phi Brain - Kami no Puzzle S2 - 14 [D70F7CE8].mkv
  + duration: 00:24:29
  + size: 1280x720, pixel aspect: 1/1, display aspect: 1.78, 23.976 fps
  + autocrop: 0/0/0/0
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 00:00:29
    + 2: cells 0->0, 0 blocks, duration 00:01:30
    + 3: cells 0->0, 0 blocks, duration 00:08:36
    + 4: cells 0->0, 0 blocks, duration 00:11:55
    + 5: cells 0->0, 0 blocks, duration 00:01:30
    + 6: cells 0->0, 0 blocks, duration 00:00:30
  + audio tracks:
    + 1, Japanese (aac) (2.0 ch) (iso639-2: jpn)
  + subtitle tracks:
    + 1, English (iso639-2: eng) (Text)(SSA)
Reading chapter markers from file C:\Users\Zero\AppData\Local\Temp\Ph_chapter6-1-chapters.csv
[11:56:46] 1 job(s) to process
[11:56:46] starting job
[11:56:46] work: sanitizing track 1 mixdown Dolby Pro Logic II to Stereo
[11:56:46] sync: expecting 718 video frames
[11:56:46] work: only 1 chapter, disabling chapter markers
[11:56:46] job configuration:
[11:56:46]  * source
[11:56:46]    + E:\Torrent\[WhyNot] Phi Brain - Kami no Puzzle S2 - 14 [D70F7CE8].mkv
[11:56:46]    + title 1, chapter(s) 6 to 6
[11:56:46]    + container: matroska,webm
[11:56:46]    + data rate: 1528 kbps
[11:56:46]  * destination
[11:56:46]    + E:\Torrent\Ph_chapter6.mkv
[11:56:46]    + container: Matroska (.mkv)
[11:56:46]  * video track
[11:56:46]    + decoder: h264
[11:56:46]    + frame rate: same as source (around 23.976 fps)
[11:56:46]    + filters
[11:56:46]      + Framerate Shaper (0:27000000:1126125)
[11:56:46]        + frame rate: same as source (around 23.976 fps)
[11:56:46]      + Crop and Scale (1280:720:0:0:0:0)
[11:56:46]        + source: 1280 * 720, crop (0/0/0/0): 1280 * 720, scale: 1280 * 720
[11:56:46]    + strict anamorphic
[11:56:46]      + storage dimensions: 1280 * 720, mod 0
[11:56:46]      + pixel aspect ratio: 1 / 1
[11:56:46]      + display dimensions: 1280 * 720
[11:56:46]    + encoder: H.264 (x264)
[11:56:46]      + options: rc-lookahead=10:ref=1:subme=0:8x8dct=0:trellis=0
[11:56:46]      + quality: 20.00 (RF)
[11:56:46]  * subtitle track 1, English (track 2, id 0x2) Text [SSA] -> Passthrough, Default
[11:56:46]  * audio track 1
[11:56:46]    + decoder: Japanese (aac) (2.0 ch) (track 1, id 0x1)
[11:56:46]      + samplerate: 48000 Hz
[11:56:46]    + mixdown: Stereo
[11:56:46]    + encoder: AAC (faac)
[11:56:46]      + bitrate: 160 kbps, samplerate: 48000 Hz
[11:56:46] encx264: min-keyint: 24, keyint: 240
[11:56:46] encx264: encoding with stored aspect 1/1
[11:56:46] encx264: Encoding at constant RF 20.000000
x264 [warning]: --psnr used with psy on: results will be invalid!
x264 [warning]: --tune psnr should be used if attempting to benchmark psnr!
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
x264 [info]: profile Main, level 3.1
[11:56:46] reader: first SCR 128727360 id 0x0 DTS 128727360
[11:57:09] reader: done. 1 scr changes
[11:57:12] work: average encoding speed for job is 37.800121 fps
[11:57:12] sync: got 949 frames, 718 expected
[11:57:12] render: lost time: 0 (0 frames)
[11:57:12] render: gained time: 0 (0 frames) (0 not accounted for)
[11:57:12] h264-decoder done: 949 frames, 0 decoder errors, 0 drops
x264 [info]: frame I:11    Avg QP:16.15  size: 97807  PSNR Mean Y:47.65 U:49.62 V:50.07 Avg:48.25 Global:47.94
x264 [info]: frame P:305   Avg QP:19.64  size: 26847  PSNR Mean Y:43.13 U:47.05 V:47.46 Avg:44.08 Global:43.77
x264 [info]: frame B:633   Avg QP:21.16  size:  3000  PSNR Mean Y:43.33 U:47.28 V:47.65 Avg:44.29 Global:43.98
x264 [info]: consecutive B-frames:  8.1%  7.8%  3.2% 80.9%
x264 [info]: mb I  I16..4: 23.2%  0.0% 76.8%
x264 [info]: mb P  I16..4:  7.7%  0.0%  3.3%  P16..4: 34.2% 16.4% 10.1%  0.0%  0.0%    skip:28.4%
x264 [info]: mb B  I16..4:  0.5%  0.0%  0.0%  B16..8: 11.6%  2.6%  0.3%  direct:10.3%  skip:74.8%  L0:36.4% L1:47.3% BI:16.4%
x264 [info]: coded y,uvDC,uvAC intra: 44.9% 64.4% 40.8% inter: 10.1% 18.7% 1.6%
x264 [info]: i16 v,h,dc,p: 41% 34% 17%  8%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 23% 16%  7%  7%  6%  7%  5%  7%
x264 [info]: i8c dc,h,v,p: 42% 27% 21%  9%
x264 [info]: Weighted P-Frames: Y:2.3% UV:2.3%
x264 [info]: SSIM Mean Y:0.9869691 (18.850db)
x264 [info]: PSNR Mean Y:43.316 U:47.230 V:47.614 Avg:44.266 Global:43.942 kb/s:2256.41
[11:57:12] aac-decoder done: 0 frames, 0 decoder errors, 0 drops
[11:57:12] mux: track 0, 949 frames, 11163124 bytes, 61.05 kbps, fifo 1024
[11:57:12] mux: track 1, 1851 frames, 789442 bytes, 4.32 kbps, fifo 2048
[11:57:12] mux: track 2, 11 frames, 662 bytes, 0.00 kbps, fifo 16
[11:57:12] libhb: work result = 0
Encode done!
HandBrake has exited.
Also, I've uploaded the contents of the original - "[WhyNot] Phi Brain - Kami no Puzzle S2 - 14 [D70F7CE8]_track3_eng.ass" file http://pastebin.com/K8QueqAi, and the reencoded subtitle file, while encoding only Chapter 6: "Ph_chapter6_track3_eng.ssa" http://pastebin.com/miH1H0EL , as maybe this helps to understand the problem. In fact, Handbrake cuts out the correct part from the subtitle file, when encoding only a specific chapter (like 6th chapter from an mkv file), but the timing still remains the original, it isn't adjusted so the subs won't show up, or if the video is long enough, they will show up minutes later, than they should!

Tell me if there is anything else I can help with to resolve this problem, I think it is very easy to reproduce, with any .mkv files, that has chapters in it, and .ass soft subtitle files! Also, it may be important that only the softsubbed re-encode has problem, when the subtitles are added as hardsub, while reencoding, the problem doesn't occurs!

Thanks,
Bryan

Post Reply