<commit_before>[![Build
Status](https://travis-ci.org/LeoCBS/mkv-subtitle.svg?branch=master)](https://travis-ci.org/LeoCBS/mkv-subtitle) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/0929cf8d82a94343bd46124008592b8e)](https://www.codacy.com/app/LeoCBS/mkv-subtitle?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=LeoCBS/mkv-subtitle&amp;utm_campaign=Badge_Grade)



# mkv-subtitle

Embed subtitle to mkv container using [mkvmerge](https://github.com/mbunkus/mkvtoolnix) tool version 5.8.0.

Why using one old version?

Some hardware (TVs, HTs) don't have full compatibility with mkv specification.. mkvmerge tends to use all the latest features all the time, and this can pose problems for such players.. See this [link](https://github.com/mbunkus/mkvtoolnix/wiki/Improving-playback-compatibility-with-players) for more information about mkv compatibility

## How this works?

This using Docker to compile and install mkv merge tool 5.8.0 in one Docker image

## Requirements

Docker 1.9.0 +

## How to use:

Just use mkvmerge cli directly in docker container:

    docker run --rm -v $(pwd):/mkvtemp leocbs/mkvmergetool:1.0.0 mkvmerge -V

output:   
    
    mkvmerge v5.8.0 ('No Sleep / Pillow') built on Jan 15 2017 18:04:03

Must set one volume `/mkvtemp` with your mkv and subtitle files.

Simple example to embed subtitle:
 
    docker run -ti --rm -v $(pwd):/mkvtemp leocbs/mkvmergetool mkvmerge -o Vikings.S04E15c.mkv Vikings.S04E15.mkv Vikings.S04E15.str


## Virtual env

<commit_msg>update readme with attacher run example<commit_after>[![Build
Status](https://travis-ci.org/LeoCBS/mkv-subtitle.svg?branch=master)](https://travis-ci.org/LeoCBS/mkv-subtitle) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/0929cf8d82a94343bd46124008592b8e)](https://www.codacy.com/app/LeoCBS/mkv-subtitle?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=LeoCBS/mkv-subtitle&amp;utm_campaign=Badge_Grade)



# mkv-subtitle

Embed subtitle to mkv container using [mkvmerge](https://github.com/mbunkus/mkvtoolnix) tool version 5.8.0.

Why using one old version?

Some hardware (TVs, HTs) don't have full compatibility with mkv specification.. mkvmerge tends to use all the latest features all the time, and this can pose problems for such players.. See this [link](https://github.com/mbunkus/mkvtoolnix/wiki/Improving-playback-compatibility-with-players) for more information about mkv compatibility

## How this works?

This using Docker to compile and install mkv merge tool 5.8.0 in one Docker image

## Requirements

Docker 1.9.0 +

## How to use:

Just use mkvmerge cli directly in docker container:

    docker run --rm -v $(pwd):/mkvtemp leocbs/mkvmergetool:1.0.0 mkvmerge -V

output:   
    
    mkvmerge v5.8.0 ('No Sleep / Pillow') built on Jan 15 2017 18:04:03

Must set one volume `/mkvtemp` with your mkv and subtitle files.

Simple example to embed subtitle:
 
    docker run -ti --rm -v $(pwd):/mkvtemp leocbs/mkvmergetool mkvmerge -o Vikings.S04E15c.mkv Vikings.S04E15.mkv Vikings.S04E15.str


## How to run attacher

Attacher is one python script that extract subtitle from rar files and convert to
iso charset.

Attacher help:

    mkv-subtitle|master ⇒ python /home/leonardo/projects/mkv-subtitle/mkv/attacher.py --help
usage: attacher.py [-h] --mkvsource MKVSOURCE --hdddest HDDDEST

optional arguments:
  -h, --help            show this help message and exit
  --mkvsource MKVSOURCE
                        pass mkv folder source. ex:/home/user/mkvs
  --hdddest HDDDEST     path to external disk. ex:/home/user/mkvs


     python attacher.py --mkvsource /run/media/leonardo/DOC3/merge --hdddest /run/media/leonardo/mypassportultra/series_new

{'fraction_non_alphanumeric': 0.10952252495279202, 'fraction_numerical': 0.03425950903695711, 'mean_word_length': 4.08641975308642, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1106126', 'n_tokens_mistral': 1432, 'n_tokens_neox': 1306, 'n_words': 349}