gnoling / UnlinkMKV

Merges ordered chapters / segmented MKVs back into a single file.
MIT License
156 stars 8 forks source link

Fixes versions of mkvinfo built with GUI support enabled by default #15

Closed hilts-vaughan closed 8 years ago

hilts-vaughan commented 8 years ago

Some versions of mkvinfo are shipped like this, especially some of the pre-built binaries on Windows. To get them to report their contents in console mode, this flag is required.

The bottom is just a clean up that was made to fix a bug in Strawberry Perl on Windows that I was used... it wasn't processing the inline-arguments properly. (Weird, huh?). Take it or leave it.

The other commits are remnants of my old fork. We can clean this up if you're OK merging this in.

Thanks for your time.

gnoling commented 8 years ago

Hmm. When I try this with mkvinfo v9.1.0 on Mint it actually makes it fail rather then ignoring it.

$ mkvinfo a.mkv --no-gui Error: Only one input file is allowed.

hilts-vaughan commented 8 years ago

Hm. Working on Windows;

mkvinfo.exe --version mkvinfo v9.1.0 ('Little Eathquakes') 64bit

lemme try my NIX* machine.

hilts-vaughan commented 8 years ago

You're right; doesn't work on Arch Linux when running JUST the above command.. However, it runs with the script. Must be a # of parameters / ordering thing. Run it with the script instead of invoking manually mkvinfo. Seems to work fine over here.

hilts-vaughan commented 8 years ago

The relevant commit is here:

2016-03-18 Moritz Bunkus moritz@bunkus.org mkvinfo: change: on Windows and Mac OS mkvinfo will now launch the GUI by default unless the option »–no-gui« (or »-G«) has been given. This is due to the fact that on both OS users often use portable versions respectively disk images and launch the executable directly and not via start menu entries. In those situations adding command line options for launching the GUI is unnecessarily difficult.

https://www.bunkus.org/blog/2016/03/mkvtoolnix-v9-0-1-released/

This will affect OS X as well.

gnoling commented 8 years ago
  looking for segment parts
        sys > /usr/bin/mkvinfo-gui /mnt/chao/downloads/[Coalgirls]_Nisekoi_Second_Season_(1920x1080_Blu-ray_FLAC)/[Coalgirls]_Nisekoi_Second_Season_11_(1920x1080_Blu-ray_FLAC)_[374C9283] 2.mkv --no-gui
        sys < Error: Only one input file is allowed.
        sys > /usr/bin/mkvinfo-gui /mnt/chao/downloads/[Coalgirls]_Nisekoi_Second_Season_(1920x1080_Blu-ray_FLAC)/[Coalgirls]_Nisekoi_Second_Season_11_(1920x1080_Blu-ray_FLAC)_[374C9283].mkv --no-gui
        sys < Error: Only one input file is allowed.
        sys > /usr/bin/mkvinfo-gui /mnt/chao/downloads/[Coalgirls]_Nisekoi_Second_Season_(1920x1080_Blu-ray_FLAC)/[Coalgirls]_Nisekoi_Second_Season_ED1_(1920x1080_Blu-ray_FLAC)_[589F38B4].mkv --no-gui
        sys < Error: Only one input file is allowed.
        sys > /usr/bin/mkvinfo-gui /mnt/chao/downloads/[Coalgirls]_Nisekoi_Second_Season_(1920x1080_Blu-ray_FLAC)/[Coalgirls]_Nisekoi_Second_Season_ED2_(1920x1080_Blu-ray_FLAC)_[55C33932].mkv --no-gui
        sys < Error: Only one input file is allowed.
        sys > /usr/bin/mkvinfo-gui /mnt/chao/downloads/[Coalgirls]_Nisekoi_Second_Season_(1920x1080_Blu-ray_FLAC)/[Coalgirls]_Nisekoi_Second_Season_ED3_(1920x1080_Blu-ray_FLAC)_[E924CF84].mkv --no-gui
        sys < Error: Only one input file is allowed.
        sys > /usr/bin/mkvinfo-gui /mnt/chao/downloads/[Coalgirls]_Nisekoi_Second_Season_(1920x1080_Blu-ray_FLAC)/[Coalgirls]_Nisekoi_Second_Season_ED4_(1920x1080_Blu-ray_FLAC)_[2790688C].mkv --no-gui
        sys < Error: Only one input file is allowed.
        sys > /usr/bin/mkvinfo-gui /mnt/chao/downloads/[Coalgirls]_Nisekoi_Second_Season_(1920x1080_Blu-ray_FLAC)/[Coalgirls]_Nisekoi_Second_Season_ED5_(1920x1080_Blu-ray_FLAC)_[3041B1CE].mkv --no-gui
        sys < Error: Only one input file is allowed.
        sys > /usr/bin/mkvinfo-gui /mnt/chao/downloads/[Coalgirls]_Nisekoi_Second_Season_(1920x1080_Blu-ray_FLAC)/[Coalgirls]_Nisekoi_Second_Season_ED6_(1920x1080_Blu-ray_FLAC)_[184D3453].mkv --no-gui
        sys < Error: Only one input file is allowed.
        sys > /usr/bin/mkvinfo-gui /mnt/chao/downloads/[Coalgirls]_Nisekoi_Second_Season_(1920x1080_Blu-ray_FLAC)/[Coalgirls]_Nisekoi_Second_Season_ED7_(1920x1080_Blu-ray_FLAC)_[1AA900BB].mkv --no-gui
        sys < Error: Only one input file is allowed.
        sys > /usr/bin/mkvinfo-gui /mnt/chao/downloads/[Coalgirls]_Nisekoi_Second_Season_(1920x1080_Blu-ray_FLAC)/[Coalgirls]_Nisekoi_Second_Season_OP1_(1920x1080_Blu-ray_FLAC)_[D9FA2DA2].mkv --no-gui
        sys < Error: Only one input file is allowed.
        sys > /usr/bin/mkvinfo-gui /mnt/chao/downloads/[Coalgirls]_Nisekoi_Second_Season_(1920x1080_Blu-ray_FLAC)/[Coalgirls]_Nisekoi_Second_Season_OP2_(1920x1080_Blu-ray_FLAC)_[921DB6B3].mkv --no-gui
        sys < Error: Only one input file is allowed.
        sys > /usr/bin/mkvinfo-gui /mnt/chao/downloads/[Coalgirls]_Nisekoi_Second_Season_(1920x1080_Blu-ray_FLAC)/a.mkv --no-gui
        sys < Error: Only one input file is allowed.
  checking that all required segments were found
  missing segment: 0xbe 0xdd 0xf0 0x29 0xba 0x2e 0x6d 0x18 0xa0 0x19 0xb5 0x57 0x14 0xfd 0xbc 0xe6
  missing segment: 0xa9 0xeb 0xc8 0xf6 0x5f 0xc0 0x00 0xf0 0xa9 0x85 0x5e 0x39 0x0c 0x60 0xa5 0x6a
  missing segments!

Doesn't work via script either for me. What does just "mkvinfo --no-gui" output on a platform that supports it? Since it thinks that's a file where it doesn't I suppose we could just detect the behaviour early in the script.

As an aside I'll put in an issue to mkvtoolnix/bunkuz later today to see if he can't just add that option to all platforms, seems kind of silly not to.

hilts-vaughan commented 8 years ago

Working on Arch Linux; maybe something else unique.

For a platform that supports it, the output is the same as if it continued on normally on Linux without a GUI, or if you provide an invalid file:

(MKVInfo) Error: couldn't open input file a.mkv (open file error).

hilts-vaughan commented 8 years ago

This is no longer required, they reverted the commit that made this the default on MKVToolnix 9.5+