HandBrakeCLI fails on .MKV input, but GUI succeeds

HandBrake for Mac support
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
taumattatx
Posts: 6
Joined: Mon Mar 25, 2019 2:31 pm

HandBrakeCLI fails on .MKV input, but GUI succeeds

Post by taumattatx » Mon Mar 25, 2019 6:19 pm

Description of problem or question:

I used MakeMKV (command-line) to rip "Mission: Impossible (1993)" to an .mkv file, and then tried to use HandBrakeCLI to reencode the video to an .m4v file. HB failed with a "scan: unrecognized file type" error. However, when I re-tried with the HandBrake GUI, it worked fine. I've verified that the .mkv source file is okay -- at least, VLC can play it directly.

I don't know if I'm doing something different with my command line invocation versus what the GUI is doing -- I don't find it easy to figure out precisely what the GUI is doing, generally. Perhaps the defaults are different? I must be doing something wrong... I'd be grateful for any hints.

Steps to reproduce the problem (If Applicable):

My command line to invoke HandBrakeCLI:

Code: Select all

HandBrakeCLI --two-pass --turbo --optimize --markers --subtitle none --encoder x265_10bit --audio 1,2,3 --aencoder ca_aac,ca_aac,ca_aac --input "Mission: Impossible (1996).mkv" --output "./Mission: Impossible (1996).m4v"

HandBrake version (e.g., 1.0.0):

1.2.2


Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):

Mac OSX Mojave 10.14.3


HandBrake Activity Log ***required*** (see How-to get an activity log)

Here the terminal output from HandBrakeCLI (the failed attempt):

Code: Select all

[10:13:43] hb_init: starting libhb thread
[10:13:43] thread 700000c87000 started ("libhb")
HandBrake 1.2.2 (2019022300) - Darwin x86_64 - https://handbrake.fr
4 CPUs detected
Opening Mission: Impossible (1996).mkv...
[10:13:43] CPU: Intel(R) Core(TM) i5-4308U CPU @ 2.80GHz
[10:13:43]  - Intel microarchitecture Haswell
[10:13:43]  - logical processor count: 4
[10:13:43] hb_scan: path=Mission: Impossible (1996).mkv, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:323: failed opening UDF image Mission: Impossible (1996).mkv
disc.c:424: error opening file BDMV/index.bdmv
disc.c:424: error opening file BDMV/BACKUP/index.bdmv
[10:13:43] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 6.0.0
libdvdread: Encrypted DVD support unavailable.
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
[10:13:43] dvd: not a dvd - trying as a stream/file instead
[10:13:43] hb_stream_open: open Mission: Impossible (1996).mkv failed
[10:13:43] scan: unrecognized file type
[10:13:43] libhb: scan thread found 0 valid title(s)
No title found.
HandBrake has exited.
And here's the activity log for the GUI run that succeeded (for just an 8-minute segment of the title):

Code: Select all

HandBrake Activity Log for Session: 2019-03-25T15:50:34Z
Handbrake Version: 1.2.2 (2019022300)
Mission: Impossible (1996).m4v
Preset: CMH: HQ 1080p30 Surround DTS if avail (Modified)
[10:50:34] macgui: QueueCore prevented sleep
[10:50:34] macgui: QueueCore scanning specifically for title: 1
[10:50:34] CPU: Intel(R) Core(TM) i5-4308U CPU @ 2.80GHz
[10:50:34]  - Intel microarchitecture Haswell
[10:50:34]  - logical processor count: 4
[10:50:34] hb_scan: path=/Users/wasserham/Movies/Rips/Mission: Impossible (1996).mkv, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:323: failed opening UDF image /Users/wasserham/Movies/Rips/Mission: Impossible (1996).mkv
disc.c:424: error opening file BDMV/index.bdmv
disc.c:424: error opening file BDMV/BACKUP/index.bdmv
[10:50:34] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 6.0.0
libdvdread: Encrypted DVD support unavailable.
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
[10:50:34] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from '/Users/wasserham/Movies/Rips/Mission: Impossible (1996).mkv':
  Metadata:
    encoder         : libmakemkv v1.14.3 (1.3.5/1.4.7) darwin(x64-release)
    creation_time   : 2019-03-25T15:05:36.000000Z
  Duration: 01:50:12.61, start: 0.000000, bitrate: 22660 kb/s
    Chapter #0:0: start 0.000000, end 180.805625
    Metadata:
      title           : Chapter 01
    Chapter #0:1: start 180.805625, end 644.518875
    Metadata:
      title           : Chapter 02
    Chapter #0:2: start 644.518875, end 1603.810542
    Metadata:
      title           : Chapter 03
    Chapter #0:3: start 1603.810542, end 1941.397792
    Metadata:
      title           : Chapter 04
    Chapter #0:4: start 1941.397792, end 2390.346292
    Metadata:
      title           : Chapter 05
    Chapter #0:5: start 2390.346292, end 2979.142833
    Metadata:
      title           : Chapter 06
    Chapter #0:6: start 2979.142833, end 3345.550542
    Metadata:
      title           : Chapter 07
    Chapter #0:7: start 3345.550542, end 4345.674667
    Metadata:
      title           : Chapter 08
    Chapter #0:8: start 4345.674667, end 4714.459750
    Metadata:
      title           : Chapter 09
    Chapter #0:9: start 4714.459750, end 5294.539250
    Metadata:
      title           : Chapter 10
    Chapter #0:10: start 5294.539250, end 5886.505625
    Metadata:
      title           : Chapter 11
    Chapter #0:11: start 5886.505625, end 6242.611375
    Metadata:
      title           : Chapter 12
    Chapter #0:12: start 6242.611375, end 6612.608000
    Metadata:
      title           : Chapter 13
    Stream #0:0(eng): Video: mpeg2video (Main), yuv420p(tv, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
    Metadata:
      BPS-eng         : 20631382
      DURATION-eng    : 01:50:12.606000000
      NUMBER_OF_FRAMES-eng: 158544
      NUMBER_OF_BYTES-eng: 17053400276
      SOURCE_ID-eng   : 001011
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.3 darwin(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-03-25 15:05:36
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
    Metadata:
      title           : Surround 5.1
      BPS-eng         : 640000
      DURATION-eng    : 01:50:12.608000000
      NUMBER_OF_FRAMES-eng: 206644
      NUMBER_OF_BYTES-eng: 529008640
      SOURCE_ID-eng   : 001100
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.3 darwin(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-03-25 15:05:36
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:2(fra): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s
    Metadata:
      title           : Surround 5.1
      BPS-eng         : 640000
      DURATION-eng    : 01:50:12.608000000
      NUMBER_OF_FRAMES-eng: 206644
      NUMBER_OF_BYTES-eng: 529008640
      SOURCE_ID-eng   : 001101
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.3 darwin(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-03-25 15:05:36
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:3(spa): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s
    Metadata:
      title           : Surround 5.1
      BPS-eng         : 640000
      DURATION-eng    : 01:50:12.608000000
      NUMBER_OF_FRAMES-eng: 206644
      NUMBER_OF_BYTES-eng: 529008640
      SOURCE_ID-eng   : 001102
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.3 darwin(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-03-25 15:05:36
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:4(eng): Subtitle: hdmv_pgs_subtitle
    Metadata:
      BPS-eng         : 26032
      DURATION-eng    : 01:44:58.896770833
      NUMBER_OF_FRAMES-eng: 1869
      NUMBER_OF_BYTES-eng: 20497170
      SOURCE_ID-eng   : 001200
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.3 darwin(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-03-25 15:05:36
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:5(eng): Subtitle: hdmv_pgs_subtitle
    Metadata:
      BPS-eng         : 28641
      DURATION-eng    : 01:45:28.718229166
      NUMBER_OF_FRAMES-eng: 2127
      NUMBER_OF_BYTES-eng: 22657880
      SOURCE_ID-eng   : 001201
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.3 darwin(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-03-25 15:05:36
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:6(fra): Subtitle: hdmv_pgs_subtitle
    Metadata:
      BPS-eng         : 27382
      DURATION-eng    : 01:45:27.592104166
      NUMBER_OF_FRAMES-eng: 2003
      NUMBER_OF_BYTES-eng: 21658021
      SOURCE_ID-eng   : 001202
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.3 darwin(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-03-25 15:05:36
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:7(fra): Subtitle: hdmv_pgs_subtitle
    Metadata:
      BPS-eng         : 1334
      DURATION-eng    : 01:40:01.224395833
      NUMBER_OF_FRAMES-eng: 104
      NUMBER_OF_BYTES-eng: 1001359
      SOURCE_ID-eng   : 001202
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.3 darwin(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-03-25 15:05:36
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:8(spa): Subtitle: hdmv_pgs_subtitle
    Metadata:
      BPS-eng         : 23190
      DURATION-eng    : 01:45:27.633812500
      NUMBER_OF_FRAMES-eng: 1827
      NUMBER_OF_BYTES-eng: 18342713
      SOURCE_ID-eng   : 001203
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.3 darwin(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-03-25 15:05:36
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
    Stream #0:9(spa): Subtitle: hdmv_pgs_subtitle
    Metadata:
      BPS-eng         : 795
      DURATION-eng    : 01:40:01.224395833
      NUMBER_OF_FRAMES-eng: 70
      NUMBER_OF_BYTES-eng: 596499
      SOURCE_ID-eng   : 001203
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.14.3 darwin(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-03-25 15:05:36
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
[10:50:34] scan: decoding previews for title 1
[10:50:34] scan: audio 0x1: ac3, rate=48000Hz, bitrate=640000 English (AC3) (5.1 ch)
[10:50:34] scan: audio 0x2: ac3, rate=48000Hz, bitrate=640000 Francais (AC3) (5.1 ch)
[10:50:34] scan: audio 0x3: ac3, rate=48000Hz, bitrate=640000 español (AC3) (5.1 ch)
[10:50:34] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 142/142/0/4, aspect 16:9, PAR 1:1
[10:50:34] libhb: scan thread found 1 valid title(s)
[10:50:34] macgui: QueueCore scan done
[10:50:34] 1 job(s) to process
[10:50:34] starting job
[10:50:34] macgui: QueueCore started encoding Mission: Impossible (1996).m4v
[10:50:34] macgui: QueueCore with preset CMH: HQ 1080p30 Surround DTS if avail (Modified)
[10:50:34] decomb filter thread started for segment 0
[10:50:34] decomb filter thread started for segment 1
[10:50:34] decomb filter thread started for segment 2
[10:50:34] decomb filter thread started for segment 3
[10:50:34] decomb check thread started for segment 0
[10:50:34] decomb check thread started for segment 1
[10:50:34] decomb check thread started for segment 2
[10:50:34] decomb check thread started for segment 3
[10:50:34] mask filter thread started for segment 0
[10:50:34] mask filter thread started for segment 1
[10:50:34] mask filter thread started for segment 2
[10:50:34] mask filter thread started for segment 3
[10:50:34] mask erode thread started for segment 0
[10:50:34] mask erode thread started for segment 1
[10:50:34] mask erode thread started for segment 2
[10:50:34] mask erode thread started for segment 3
[10:50:34] mask dilate thread started for segment 0
[10:50:34] mask dilate thread started for segment 1
[10:50:34] mask dilate thread started for segment 2
[10:50:34] mask dilate thread started for segment 3
[10:50:34] yadif thread started for segment 0
[10:50:34] yadif thread started for segment 1
[10:50:34] yadif thread started for segment 2
[10:50:34] yadif thread started for segment 3
[10:50:34] job configuration:
[10:50:34]  * source
[10:50:34]    + /Users/wasserham/Movies/Rips/Mission: Impossible (1996).mkv
[10:50:34]    + title 1, start 00:08:20.00 stop 00:16:40.00
[10:50:34]    + container: matroska,webm
[10:50:34]    + data rate: 22660 kbps
[10:50:34]  * destination
[10:50:34]    + /Users/wasserham/Movies/Rips/Mission: Impossible (1996).m4v
[10:50:34]    + container: MPEG-4 (libavformat)
[10:50:34]      + optimized for HTTP streaming (fast start)
[10:50:34]      + align initial A/V stream timestamps
[10:50:34]      + chapter markers
[10:50:34]  * video track
[10:50:34]    + decoder: mpeg2video
[10:50:34]    + filters
[10:50:34]      + Comb Detect (mode=3:spatial-metric=2:motion-thresh=1:spatial-thresh=1:filter-mode=2:block-thresh=40:block-width=16:block-height=16)
[10:50:34]      + Decomb (mode=39)
[10:50:34]      + Framerate Shaper (mode=2:rate=27000000/900000)
[10:50:34]        + frame rate: 23.976 fps -> peak rate limited to 30.000 fps
[10:50:34]      + Crop and Scale (width=1916:height=796:crop-top=142:crop-bottom=142:crop-left=0:crop-right=4)
[10:50:34]        + source: 1920 * 1080, crop (142/142/0/4): 1916 * 796, scale: 1916 * 796
[10:50:34]    + Output geometry
[10:50:34]      + storage dimensions: 1916 x 796
[10:50:34]      + pixel aspect ratio: 1 : 1
[10:50:34]      + display dimensions: 1916 x 796
[10:50:34]  * Foreign Audio Search: Render/Burn-in, Forced Only
[10:50:34]    + subtitle, English [PGS] (track 0, id 0x4, Picture)
[10:50:34]    + subtitle, English [PGS] (track 1, id 0x5, Picture)
[10:50:34] sync: expecting 12011 video frames
[10:53:45] reader: done. 1 scr changes
[10:53:45] work: average encoding speed for job is 0.000000 fps
[10:53:45] comb detect: heavy 0 | light 0 | uncombed 0 | total 0
[10:53:45] decomb: deinterlaced 0 | blended 0 | unfiltered 0 | total 0
[10:53:45] vfr: 0 frames output, 0 dropped and 0 duped for CFR/PFR
[10:53:45] vfr: lost time: 0 (0 frames)
[10:53:45] vfr: gained time: 0 (0 frames) (0 not accounted for)
[10:53:46] mpeg2video-decoder done: 1 frames, 0 decoder errors
[10:53:46] sync: got 0 frames, 12011 expected
[10:53:46] Subtitle track 0 (id 0x4) 'English [PGS]': 852 hits (0 forced)
[10:53:46] Subtitle track 1 (id 0x5) 'English [PGS]': 976 hits (0 forced)
[10:53:46] No candidate detected during subtitle scan
[10:53:46] starting job
[10:53:46] decomb filter thread started for segment 0
[10:53:46] decomb filter thread started for segment 1
[10:53:46] decomb check thread started for segment 2
[10:53:46] decomb filter thread started for segment 3
[10:53:46] decomb check thread started for segment 0
[10:53:46] decomb check thread started for segment 1
[10:53:46] decomb filter thread started for segment 2
[10:53:46] mask filter thread started for segment 1
[10:53:46] mask filter thread started for segment 0
[10:53:46] mask filter thread started for segment 2
[10:53:46] decomb check thread started for segment 3
[10:53:46] mask filter thread started for segment 3
[10:53:46] mask erode thread started for segment 0
[10:53:46] mask erode thread started for segment 1
[10:53:46] mask erode thread started for segment 2
[10:53:46] mask erode thread started for segment 3
[10:53:46] mask dilate thread started for segment 0
[10:53:46] mask dilate thread started for segment 1
[10:53:46] mask dilate thread started for segment 2
[10:53:46] mask dilate thread started for segment 3
[10:53:46] yadif thread started for segment 0
[10:53:46] yadif thread started for segment 1
[10:53:46] yadif thread started for segment 2
[10:53:46] yadif thread started for segment 3
[10:53:46] job configuration:
[10:53:46]  * source
[10:53:46]    + /Users/wasserham/Movies/Rips/Mission: Impossible (1996).mkv
[10:53:46]    + title 1, start 00:08:20.00 stop 00:16:40.00
[10:53:46]    + container: matroska,webm
[10:53:46]    + data rate: 22660 kbps
[10:53:46]  * destination
[10:53:46]    + /Users/wasserham/Movies/Rips/Mission: Impossible (1996).m4v
[10:53:46]    + container: MPEG-4 (libavformat)
[10:53:46]      + optimized for HTTP streaming (fast start)
[10:53:46]      + align initial A/V stream timestamps
[10:53:46]      + chapter markers
[10:53:46]  * video track
[10:53:46]    + decoder: mpeg2video
[10:53:46]    + filters
[10:53:46]      + Comb Detect (mode=3:spatial-metric=2:motion-thresh=1:spatial-thresh=1:filter-mode=2:block-thresh=40:block-width=16:block-height=16)
[10:53:46]      + Decomb (mode=39)
[10:53:46]      + Framerate Shaper (mode=2:rate=27000000/900000)
[10:53:46]        + frame rate: 23.976 fps -> peak rate limited to 30.000 fps
[10:53:46]      + Crop and Scale (width=1916:height=796:crop-top=142:crop-bottom=142:crop-left=0:crop-right=4)
[10:53:46]        + source: 1920 * 1080, crop (142/142/0/4): 1916 * 796, scale: 1916 * 796
[10:53:46]    + Output geometry
[10:53:46]      + storage dimensions: 1916 x 796
[10:53:46]      + pixel aspect ratio: 1 : 1
[10:53:46]      + display dimensions: 1916 x 796
[10:53:46]    + encoder: H.265 10-bit (libx265)
[10:53:46]      + preset:  slow
[10:53:46]      + profile: auto
[10:53:46]      + quality: 20.00 (RF)
[10:53:46]      + color profile: 1-1-1
[10:53:46]  * audio track 1
[10:53:46]    + decoder: English (AC3) (5.1 ch) (track 1, id 0x1)
[10:53:46]      + bitrate: 640 kbps, samplerate: 48000 Hz
[10:53:46]    + mixdown: Stereo
[10:53:46]    + dither: triangular
[10:53:46]    + encoder: AAC (Apple AudioToolbox)
[10:53:46]      + bitrate: 160 kbps, samplerate: 48000 Hz
[10:53:46]  * audio track 2
[10:53:46]    + decoder: English (AC3) (5.1 ch) (track 1, id 0x1)
[10:53:46]      + bitrate: 640 kbps, samplerate: 48000 Hz
[10:53:46]    + AC3 Passthru
[10:53:46] sync: expecting 12011 video frames
x265 [info]: HEVC encoder version 2.9
x265 [info]: build info [Mac OS X][clang 10.0.0][64 bit] 10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main 10 profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 4 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 2 / wpp(13 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : star / 57 / 3 / 3
x265 [info]: Keyframe min / max / scenecut / bias: 24 / 240 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 25 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 4 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-20.0 / 0.60
x265 [info]: tools: rect limit-modes rd=4 psy-rd=2.00 rdoq=2 psy-rdoq=1.00
x265 [info]: tools: rskip signhide tmvp strong-intra-smoothing lslices=4
x265 [info]: tools: deblock sao
[10:53:46] sync: first pts audio 0x1 is 0
[10:53:46] sync: first pts video is 0
[10:53:46] sync: first pts audio 0x1 is 0
[11:23:54] sync: "Chapter 3" (3) at frame 3465 time 13006690
[12:34:34] sync: reached audio 0x1 pts 45000000, exiting early
[12:34:34] sync: reached audio 0x1 pts 45000000, exiting early
[12:34:35] sync: reached video pts 45003655, exiting early
[12:35:18] work: average encoding speed for job is 1.982074 fps
[12:35:18] comb detect: heavy 36 | light 231 | uncombed 11721 | total 11988
[12:35:18] decomb: deinterlaced 36 | blended 231 | unfiltered 11721 | total 11988
[12:35:18] vfr: 11988 frames output, 0 dropped and 0 duped for CFR/PFR
[12:35:18] vfr: lost time: 0 (0 frames)
[12:35:18] vfr: gained time: 0 (0 frames) (0 not accounted for)
[12:35:18] ac3-decoder done: 18104 frames, 0 decoder errors
[12:35:18] ac3-decoder done: 18104 frames, 0 decoder errors
[12:35:18] mpeg2video-decoder done: 13878 frames, 0 decoder errors
[12:35:18] sync: got 11988 frames, 12011 expected
[12:35:18] sync: framerate min 12.076 fps, max 23.981 fps, avg 23.974 fps
x265 [info]: frame I:    117, Avg QP:18.61  kb/s: 16777.71
x265 [info]: frame P:   2538, Avg QP:19.91  kb/s: 9956.40 
x265 [info]: frame B:   9333, Avg QP:24.13  kb/s: 2690.01 
x265 [info]: Weighted P-Frames: Y:2.4% UV:2.2%
x265 [info]: consecutive B-frames: 4.6% 1.1% 4.6% 17.6% 72.1% 

encoded 11988 frames in 6092.39s (1.97 fps), 4365.88 kb/s, Avg QP:23.18
[12:35:27] mux: track 0, 11988 frames, 272915267 bytes, 4366.28 kbps, fifo 1024
[12:35:27] mux: track 1, 23440 frames, 10323810 bytes, 165.17 kbps, fifo 2048
[12:35:27] mux: track 2, 15625 frames, 40000000 bytes, 639.95 kbps, fifo 1024
[12:35:27] libhb: work result = 0

Woodstock
Veteran User
Posts: 3266
Joined: Tue Aug 27, 2013 6:39 am

Re: HandBrakeCLI fails on .MKV input, but GUI succeeds

Post by Woodstock » Mon Mar 25, 2019 7:22 pm

The GUI was given the full path to the MKV file, but the CLI was not. What happens if you give the CLI the input file name as "/Users/wasserham/Movies/Rips/Mission: Impossible (1996).mkv" instead of just "Mission: Impossible (1996).mkv"?

taumattatx
Posts: 6
Joined: Mon Mar 25, 2019 2:31 pm

Re: HandBrakeCLI fails on .MKV input, but GUI succeeds

Post by taumattatx » Mon Mar 25, 2019 7:40 pm

I'm running a script that I've used to rip+encode over 100 movies from my library -- most are DVDs, but there are about 2 dozen BluRays in the library that I've ripped so far. This is the first failure of this nature, so I'm pretty sure it doesn't have anything to do with the missing path -- the file being encoded in is the current working directory when I launch HandBrakeCLI, so no path should be necessary. I can certainly re-try to eliminate any doubt...

taumattatx
Posts: 6
Joined: Mon Mar 25, 2019 2:31 pm

Re: HandBrakeCLI fails on .MKV input, but GUI succeeds

Post by taumattatx » Mon Mar 25, 2019 7:52 pm

I have a theory -- I think it might be the COLON in the filename! I just had the same failure encoding "Mission: Impossible II (2000).mkv". On a hunch, for MI 3, I tried changing the colon, so I used "Mission - Impossible III (2006).mkv" for the rip name. And THAT seems to be working! I know -- different disc, not proof yet. But all three BluRays came from the same boxed set...

Anyway, once this reencode is done, I'll rename one of the other rips to get rid of the colon in the filename and try HandBrakeCLI again. If it works, I'll have proof positive.

This does seem like a bug in HandBrakeCLI (a minor one, but still a bug)...

taumattatx
Posts: 6
Joined: Mon Mar 25, 2019 2:31 pm

Re: HandBrakeCLI fails on .MKV input, but GUI succeeds

Post by taumattatx » Mon Mar 25, 2019 10:22 pm

CONFIRMED. The COLON in the filename is the entire source of the problem with HandBrakeCLI. How does one submit a bug report? Or perhaps I should just take a peek at the code and submit a patch for this one-- seems like a very trivial bug... :)

Woodstock
Veteran User
Posts: 3266
Joined: Tue Aug 27, 2013 6:39 am

Re: HandBrakeCLI fails on .MKV input, but GUI succeeds

Post by Woodstock » Mon Mar 25, 2019 10:31 pm

The colon would certainly be a problem in a Windows file name (drive letters include that character), but it should be legal in MacOS... Except there may be an issue with how bash handles it.

Did your original command line include all of the path? What handbrake saw didn't include it. The theory being that the full path was truncated down to an invalid one, as the command line was being pushed to the CLI. The path is pushed to hb.dll from the GUI without interference from the shell...

Woodstock
Veteran User
Posts: 3266
Joined: Tue Aug 27, 2013 6:39 am

Re: HandBrakeCLI fails on .MKV input, but GUI succeeds

Post by Woodstock » Mon Mar 25, 2019 10:33 pm

https://github.com/HandBrake/HandBrake/issues

This probably isn't a bug in handbrake, since I've seen similar things in bash on Linux.

Make sure you include your command line used when you make your report.

User avatar
BradleyS
Moderator
Posts: 1689
Joined: Thu Aug 09, 2007 12:16 pm

Re: HandBrakeCLI fails on .MKV input, but GUI succeeds

Post by BradleyS » Mon Mar 25, 2019 10:52 pm

Colons need to be escaped in bash. I see you've quoted the file name, but \: may still be required.

taumattatx
Posts: 6
Joined: Mon Mar 25, 2019 2:31 pm

Re: HandBrakeCLI fails on .MKV input, but GUI succeeds

Post by taumattatx » Tue Mar 26, 2019 2:30 pm

Quoting is sufficient to remove any special meaning of ":" in bash. No additional escaping is necessary. Bash man page makes this fairly clear (citation readily available); however, the more conclusive proof (to my thinking) is that the message from HandBrake itself shows the entire filename, with the colon, and no evidence of any mangling or other substitution. This implies that HandBrake is clearly getting the full and correct file name from bash. If I've missed an important detail or made an unsupported logical leap in this line of thinking, I'd be grateful to have someone set me straight. :)

Wait -- how did you know I was using bash, and not ksh or tcsh?

Woodstock
Veteran User
Posts: 3266
Joined: Tue Aug 27, 2013 6:39 am

Re: HandBrakeCLI fails on .MKV input, but GUI succeeds

Post by Woodstock » Tue Mar 26, 2019 3:13 pm

taumattatx wrote:
Tue Mar 26, 2019 2:30 pm
Wait -- how did you know I was using bash, and not ksh or tcsh?
Omniscience? :)

Actually, just an assumption, based on bash being the default for "everything" over the years. The few Mac users I know haven't bothered to switch away from bash, simply because they don't use the shell except for simple things. More advanced shells are great for more advanced tasks. Simply running programs at the command line doesn't favor any particular shell.

taumattatx
Posts: 6
Joined: Mon Mar 25, 2019 2:31 pm

Re: HandBrakeCLI fails on .MKV input, but GUI succeeds

Post by taumattatx » Tue Mar 26, 2019 3:32 pm

Ha! That's funny. I've been a software engineer for 30 years, and even today, wherever I work, the only shells I can reliably assume will be available are bash and tcsh. And I loathe tcsh for productivity and stability (not to start a holy war, but the list of problems with tcsh that compromise productivity is just ridiculous, IMHO). So bash it is! But we are way off topic now....

User avatar
Rodeo
HandBrake Team
Posts: 12248
Joined: Tue Mar 03, 2009 8:55 pm

Re: HandBrakeCLI fails on .MKV input, but GUI succeeds

Post by Rodeo » Tue Mar 26, 2019 10:23 pm

Enough with the shell bashing please :lol:

Post Reply