Subtitle not in sync

Discussion of the HandBrake command line interface (CLI)
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
mohahn
Posts: 10
Joined: Fri Mar 24, 2017 10:12 am

Subtitle not in sync

Post by mohahn »

I'm using HandBrakeCLI 0.10.2 on Ubuntu Xenial in a headless environment.
I'm running the following command:

Code: Select all

HandBrakeCLI -i "/data/source/Zootropolis_t00.mkv" -o "/data/target/Zootropolis_t00.mkv" --preset "High Profile" --native-language ger --native-dub --subtitle scan --subtitle-forced --crop 0:0:0:0 --aencoder copy,aac --audio-copy-mask ac3,dts --audio-fallback ac3
As first video track contains only an english AC3 audio track, the first german subtitle is added and set to default, as expected. But the subtitles are not in sync with video (nearly 30 seconds ahead of time). In source MKV there is no subtitle set to default, but when I enable german subtitle in VLC all is fine. Only after conversion by HandBrakeCLI the subtitle is not in sync. What can I do?

Code: Select all

[11:44:12] hb_init: starting libhb thread
HandBrake 0.10.2 (2016021200) - Linux x86_64 - https://handbrake.fr
4 CPUs detected
Opening /data/source/Zootropolis_t00.mkv...
[11:44:12] CPU: Intel(R) Xeon(R) CPU D-1518 @ 2.20GHz
[11:44:12]  - logical processor count: 4
[11:44:12] OpenCL: library not available
[11:44:12] hb_scan: path=/data/source/Zootropolis_t00.mkv, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:269: failed opening UDF image /data/source/Zootropolis_t00.mkv
disc.c:350: error opening file BDMV/index.bdmv
disc.c:350: error opening file BDMV/BACKUP/index.bdmv
[11:44:12] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.3
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdread: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:44:12] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from '/data/source/Zootropolis_t00.mkv':
  Metadata:
    title           : Zootropolis
    encoder         : libmakemkv v1.10.5 (1.3.3/1.4.4) x86_64-linux-gnu
    creation_time   : 2017-04-12 14:29:16
  Duration: 00:18:23.84, start: 0.000000, bitrate: 18007 kb/s
    Chapter #0:0: start 0.000000, end 347.472125
    Metadata:
      title           : Chapter 01
    Chapter #0:1: start 347.472125, end 691.524167
    Metadata:
      title           : Chapter 02
    Chapter #0:2: start 691.524167, end 1103.840000
    Metadata:
      title           : Chapter 03
    Stream #0:0(eng): Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
    Metadata:
      BPS-eng         : 17608015
      DURATION-eng    : 00:18:23.811041666
      NUMBER_OF_FRAMES-eng: 26465
      NUMBER_OF_BYTES-eng: 2429490157
      SOURCE_ID-eng   : 001011
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.10.5 linux(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-12 14:29:16
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:1(eng): Audio: ac3, 48000 Hz, stereo, fltp, 320 kb/s (default)
    Metadata:
      title           : Stereo
      BPS-eng         : 320000
      DURATION-eng    : 00:18:23.840000000
      NUMBER_OF_FRAMES-eng: 34495
      NUMBER_OF_BYTES-eng: 44153600
      SOURCE_ID-eng   : 001100
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.10.5 linux(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-12 14:29:16
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:2(deu): Subtitle: hdmv_pgs_subtitle, 1920x1080
    Metadata:
      BPS-eng         : 77794
      DURATION-eng    : 00:18:13.321395833
      NUMBER_OF_FRAMES-eng: 756
      NUMBER_OF_BYTES-eng: 10631791
      SOURCE_ID-eng   : 001201
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.10.5 linux(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-12 14:29:16
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
[11:44:12] scan: decoding previews for title 1
[11:44:12] scan: audio 0x1: ac3, rate=48000Hz, bitrate=320000 English (AC3) (2.0 ch)

Scanning title 1 of 1, preview 3, 30.00 %
Scanning title 1 of 1, preview 4, 40.00 %
Scanning title 1 of 1, preview 6, 60.00 %
Scanning title 1 of 1, preview 8, 80.00 %
Scanning title 1 of 1, preview 10, 100.00 %[11:44:13] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[11:44:13] libhb: scan thread found 1 valid title(s)
+ title 1:
  + stream: /data/source/Zootropolis_t00.mkv
  + duration: 00:18:23
  + size: 1920x1080, pixel aspect: 1/1, display aspect: 1.78, 23.976 fps
  + autocrop: 0/0/0/0
  + support opencl: no
  + support hwd: not built-in
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 00:05:47
    + 2: cells 0->0, 0 blocks, duration 00:05:44
    + 3: cells 0->0, 0 blocks, duration 00:06:52
  + audio tracks:
    + 1, English (AC3) (2.0 ch) (iso639-2: eng), 48000Hz, 320000bps
  + subtitle tracks:
    + 1, German (iso639-2: deu) (Bitmap)(PGS)
+ Using preset: High Profile
Invalid codec aac, using default for container.
Warning: no matching audio for native language - using subtitles instead.
Subtitle Scan Enabled - enabling subtitles if found for foreign language segments
[11:44:13] 2 job(s) to process
[11:44:13] starting job
[11:44:13] yadif thread started for segment 0
[11:44:13] yadif thread started for segment 1
[11:44:13] yadif thread started for segment 2
[11:44:13] yadif thread started for segment 3
[11:44:13] decomb filter thread started for segment 0
[11:44:13] decomb filter thread started for segment 1
[11:44:13] decomb filter thread started for segment 2
[11:44:13] decomb filter thread started for segment 3
[11:44:13] decomb check thread started for segment 0
[11:44:13] decomb check thread started for segment 1
[11:44:13] decomb check thread started for segment 2
[11:44:13] decomb check thread started for segment 3
[11:44:13] mask filter thread started for segment 0
[11:44:13] mask filter thread started for segment 1
[11:44:13] mask filter thread started for segment 2
[11:44:13] mask filter thread started for segment 3
[11:44:13] mask erode thread started for segment 0
[11:44:13] mask erode thread started for segment 1
[11:44:13] mask erode thread started for segment 2
[11:44:13] mask erode thread started for segment 3
[11:44:13] mask dilate thread started for segment 0
[11:44:13] mask dilate thread started for segment 1
[11:44:13] mask dilate thread started for segment 2
[11:44:13] mask dilate thread started for segment 3
[11:44:13] sync: expecting 26465 video frames
[11:44:13] job configuration:
[11:44:13]  * source
[11:44:13]    + /data/source/Zootropolis_t00.mkv
[11:44:13]    + title 1, chapter(s) 1 to 3
[11:44:13]    + container: matroska,webm
[11:44:13]    + data rate: 18007 kbps
[11:44:13]  * destination
[11:44:13]    + /data/target/Zootropolis_t00.mkv
[11:44:13]    + container: Matroska (libavformat)
[11:44:13]      + chapter markers
[11:44:13]  * video track
[11:44:13]    + decoder: h264
[11:44:13]    + filters
[11:44:13]      + Decomb (default settings)
[11:44:13]      + Framerate Shaper (0:27000000:1126125)
[11:44:13]        + frame rate: same as source (around 23.976 fps)
[11:44:13]      + Crop and Scale (1920:1080:0:0:0:0)
[11:44:13]        + source: 1920 * 1080, crop (0/0/0/0): 1920 * 1080, scale: 1920 * 1080
[11:44:13]    + loose anamorphic
[11:44:13]      + storage dimensions: 1920 * 1080, mod 2
[11:44:13]      + pixel aspect ratio: 1 / 1
[11:44:13]      + display dimensions: 1920 * 1080
[11:44:13]  * Foreign Audio Search: Passthrough, Forced Only

Encoding: task 1 of 2, 30.77 % (0.00 fps, avg 0.00 fps, ETA 00h00m00s)
Encoding: task 1 of 2, 62.76 % (0.00 fps, avg 0.00 fps, ETA 00h00m00s)
Encoding: task 1 of 2, 94.14 % (0.00 fps, avg 0.00 fps, ETA 00h00m00s)
Encoding: task 1 of 2, 100.00 %
Encoding: task 1 of 2, 100.00 %[11:44:15] reader: done. 1 scr changes
[11:44:15] work: average encoding speed for job is 0.000000 fps
[11:44:15] decomb: deinterlaced 0 | blended 0 | unfiltered 0 | total 0
[11:44:15] render: lost time: 0 (0 frames)
[11:44:15] render: gained time: 0 (0 frames) (0 not accounted for)
[11:44:15] h264-decoder done: 0 frames, 0 decoder errors, 0 drops
[11:44:15] No candidate detected during subtitle scan
[11:44:15] starting job
[11:44:15] yadif thread started for segment 0
[11:44:15] yadif thread started for segment 2
[11:44:15] yadif thread started for segment 1
[11:44:15] yadif thread started for segment 3
[11:44:15] decomb filter thread started for segment 0
[11:44:15] decomb filter thread started for segment 1
[11:44:15] decomb filter thread started for segment 2
[11:44:15] decomb filter thread started for segment 3
[11:44:15] decomb check thread started for segment 0
[11:44:15] decomb check thread started for segment 1
[11:44:15] decomb check thread started for segment 2
[11:44:15] decomb check thread started for segment 3
[11:44:15] mask filter thread started for segment 0
[11:44:15] mask filter thread started for segment 1
[11:44:15] mask filter thread started for segment 2
[11:44:15] mask filter thread started for segment 3
[11:44:15] mask erode thread started for segment 0
[11:44:15] mask erode thread started for segment 1
[11:44:15] mask erode thread started for segment 2
[11:44:15] mask erode thread started for segment 3
[11:44:15] mask dilate thread started for segment 0
[11:44:15] mask dilate thread started for segment 1
[11:44:15] Auto Passthru: allowed codecs are AC3, DTS
[11:44:15] Auto Passthru: fallback is AC3
[11:44:15] Auto Passthru: using AC3 Passthru for track 1
[11:44:15] work: mixdown not specified, track 2 setting mixdown Stereo
[11:44:15] work: compression level not specified, track 2 setting compression level 2.00
[11:44:15] sync: expecting 26465 video frames
[11:44:15] mask dilate thread started for segment 3
[11:44:15] mask dilate thread started for segment 2
[11:44:15] job configuration:
[11:44:15]  * source
[11:44:15]    + /data/source/Zootropolis_t00.mkv
[11:44:15]    + title 1, chapter(s) 1 to 3
[11:44:15]    + container: matroska,webm
[11:44:15]    + data rate: 18007 kbps
[11:44:15]  * destination
[11:44:15]    + /data/target/Zootropolis_t00.mkv
[11:44:15]    + container: Matroska (libavformat)
[11:44:15]      + chapter markers
[11:44:15]  * video track
[11:44:15]    + decoder: h264
[11:44:15]    + filters
[11:44:15]      + Decomb (default settings)
[11:44:15]      + Framerate Shaper (0:27000000:1126125)
[11:44:15]        + frame rate: same as source (around 23.976 fps)
[11:44:15]      + Crop and Scale (1920:1080:0:0:0:0)
[11:44:15]        + source: 1920 * 1080, crop (0/0/0/0): 1920 * 1080, scale: 1920 * 1080
[11:44:15]    + loose anamorphic
[11:44:15]      + storage dimensions: 1920 * 1080, mod 2
[11:44:15]      + pixel aspect ratio: 1 / 1
[11:44:15]      + display dimensions: 1920 * 1080
[11:44:15]    + encoder: H.264 (libx264)
[11:44:15]      + preset:  medium
[11:44:15]      + profile: high
[11:44:15]      + level:   4.1
[11:44:15]      + quality: 20.00 (RF)
[11:44:15]  * subtitle track 1, German (track 2, id 0x2) Picture [PGS] -> Passthrough, Default
[11:44:15]  * audio track 1
[11:44:15]    + decoder: English (AC3) (2.0 ch) (track 1, id 0x1)
[11:44:15]      + bitrate: 320 kbps, samplerate: 48000 Hz
[11:44:15]    + AC3 Passthru
[11:44:15]  * audio track 2
[11:44:15]    + decoder: English (AC3) (2.0 ch) (track 1, id 0x1)
[11:44:15]      + bitrate: 320 kbps, samplerate: 48000 Hz
[11:44:15]    + mixdown: Stereo
[11:44:15]    + encoder: MP3 (libmp3lame)
[11:44:15]      + bitrate: 160 kbps, samplerate: 48000 Hz
[11:44:15]      + compression level: 2.00
[11:44:15] reader: first SCR 0 id 0x0 DTS 0
[11:44:15] encx264: min-keyint: 24, keyint: 240
[11:44:15] encx264: encoding at constant RF 20.000000
[11:44:15] encx264: unparsed options: level=4.1:vbv-bufsize=78125:vbv-maxrate=62500
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
x264 [info]: profile High, level 4.1
[11:44:15] enclame: opening libmp3lame

Encoding: task 2 of 2, 0.00 %
Encoding: task 2 of 2, 0.09 %
Encoding: task 2 of 2, 0.13 %
Encoding: task 2 of 2, 0.16 %
Encoding: task 2 of 2, 0.23 %
Encoding: task 2 of 2, 0.25 %
Encoding: task 2 of 2, 0.30 %
Encoding: task 2 of 2, 0.31 %
Encoding: task 2 of 2, 0.34 %
Encoding: task 2 of 2, 0.36 %
Encoding: task 2 of 2, 0.39 %
Encoding: task 2 of 2, 0.41 %
Encoding: task 2 of 2, 0.42 %
Encoding: task 2 of 2, 0.43 %
Encoding: task 2 of 2, 0.43 %
Encoding: task 2 of 2, 0.43 % (19.27 fps, avg 26.32 fps, ETA 00h16m41s)
Encoding: task 2 of 2, 0.44 % (19.27 fps, avg 26.32 fps, ETA 00h16m41s)
[...]
mohahn
Posts: 10
Joined: Fri Mar 24, 2017 10:12 am

Re: Subtitle not in sync

Post by mohahn »

After installing version 1.0.4 from PPA repo, sync is fine now.

@Mod Please close this thread
Post Reply