GithubHelp home page GithubHelp logo

dfaust / mkv-bash-tools Goto Github PK

View Code? Open in Web Editor NEW
26.0 2.0 11.0 55 KB

A collection of BASH scripts for processing mkv files

License: GNU General Public License v3.0

Shell 100.00%
mkv matroska tools transcoder subtitles shell-script extractor command-line-app dts

mkv-bash-tools's Introduction

mkv-bash-tools

Issue Count

Warning: These scripts are outdated and won't work with current versions of mkvmerge

I'm keeping them here because I might update them at some point - but no promises.

mkv-transcode-flac

A BASH script that transcodes all FLAC tracks of a matroska file to Ogg Vorbis while preserving the track's name and language and it's default and forced flags as well as its delay.

Screen shot of mkv-transcode-flac

Depends on

mktemp
mkvmerge
mkvextract
oggenc (with FLAC decoder enabled)

Usage

chmod +x mkv-transcode-flac
./mkv-transcode-flac "My File.mkv"
This will create a new file called "My File [Ogg Vorbis].mkv".

For batch converting all .mkv files in the current directoy copy mkv-transcode-flac to a directory in your PATH and execute:
find -iname "*.mkv" -exec mkv-transcode-flac '{}' \;

mkv-transcode-dts

A BASH script that transcodes all DTS-HD Master Audio tracks of a matroska file to DTS Core while preserving the track's name and language and it's default and forced flags as well as its delay.

Depends on

mktemp
mkvmerge
mkvextract
ffmpeg (version 3.1 or higher)

Usage

chmod +x mkv-transcode-dts
./mkv-transcode-dts "My File.mkv"
This will create a new file called "My File [DTS Core].mkv".

For batch converting all .mkv files in the current directoy copy mkv-transcode-dts to a directory in your PATH and execute:
find -iname "*.mkv" -exec mkv-transcode-dts '{}' \;

mkv-remove-language

A BASH script that removes the audio track with the specified language from a matroska file.

Depends on

mkvmerge

Screen shot of mkv-remove-language

Usage

chmod +x mkv-remove-language
./mkv-remove-language "My File.mkv" "eng"
This will create a new file called "My File [without eng].mkv".

For batch processing all .mkv files in the current directoy copy mkv-remove-language to a directory in your PATH and execute:
find -iname "*.mkv" -exec mkv-remove-language '{}' "lang" \;

mkv-extract-subtitles

A BASH script that extracts subtitles from a matroska file.

Depends on

mkvmerge
mkvextract

Screen shot of mkv-extract-subtitles

Usage

chmod +x mkv-extract-subtitles
./mkv-extract-subtitles "My File.mkv"
This will create a new file for each subtitle in the current directory.

For batch processing all .mkv files in the current directoy copy mkv-extract-subtitles to a directory in your PATH and execute:
find -iname "*.mkv" -exec mkv-extract-subtitles '{}'\;

mkv-bash-tools's People

Contributors

dfaust avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mkv-bash-tools's Issues

No such file or directory

Hello, I have a small problem with your mkv-remove-language script.
If I try the batch command, I get the message: find: mkv-remove-language No such file or directory. The single command works perfectly.
hope you can help me

No dts-hd stream found, doing nothing

Hi.

I have just discovered these tools. I am trying to convert DTS-HD to DTS.

But I'm only getting this No DTS-HD stream found, doing nothing

./mkv-transcode-dts The\ Expanse\ S01E01\ Dulcinea.mkv
No dts-hd stream found, doing nothing

But inside of this mkv there is a DTS-HD file, as seen below:

mkvmerge -i The\ Expanse\ S01E01\ Dulcinea.mkv
File 'The Expanse S01E01 Dulcinea.mkv': container: Matroska
Track ID 0: video (MPEG-H/HEVC/H.265)
Track ID 1: audio (DTS-HD Master Audio)
Track ID 2: subtitles (HDMV PGS)
Chapters: 5 entries

What am I doing wrong?

Please let me know.

Is this project still active?

I'm working to do somewhat what you did here, but adding a few more stuff. I could use someone better than me with bash.

Would you like to join forces?

mkv-extract-subtitles issue with last version of mkvmerge V36.

I've been using this specific script for years to automate the sub extraction from mkv files. I used my own to do the encoding .. etc .. but I found this script very helpful.
I recently built a new Linux machine using Fedora 30 and for my surprise all my scripts were working except for this. My family needs the subs so it was rather annoying.
It seems the issue is related with the command: mkvmerge --identify-verbose which doesn't exist anymore at least in V36. Checking some of the notes from mkvmerge it seems this has been done on purpose to use a JSON like output.
This output has been replaced by a -J and this messes up with the script.
I had the option to downgrade the version of mkvmerge but one of the reasons I was installing a new server was for compatibility issues.
Anyway, more than an issue this is just to let everybody using this script know that changing the following line:
tracks=$(LANG=en_US.utf8 LANGUAGE=en_US.utf8 mkvmerge --identify-verbose "$file_name" | tail --lines=+2)
by:
tracks=$(LANG=en_US.utf8 LANGUAGE=en_US.utf8 mkvmerge -J "$file_name" | jq -r '.tracks | map("Track ID " + (.id | tostring) + ": " + .type + " " + .codec + " language:" + .properties.language + " codec_id:" + .properties.codec_id + " track_name:" + .properties.track_name ) | join("\n")' | tail --lines=+2)
** you need to install jq - yum install jq.
The script maintains all his functionality. I haven't done extensive testing but it seems to be working fine.
Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.