Skip to main content

Setuptools setup.py for mkvsubmerge.

Project description

mkvsubmerge

Split MKV file according to timestamp pairs specified by SRT subtitle file and then merge into a new video file.

Requirements

  1. Python 3
  2. MKVToolNix

Install

Install latest version:

 pip install mkvsubmerge

For mkvtoolnix installation, see https://mkvtoolnix.download/downloads.html

On macOS you can install mkvtoolnix via brew:

brew install mkvtoolnix

Upgrade

Upgrade to latest version:

pip install mkvsubmerge --upgrade

Usage

usage: mkvsubmerge [-h] [-o OUT] [--srt SRT]
                   [--srt-encoding SRT_ENCODING]
                   [--start-offset START_OFFSET]
                   [--end-offset END_OFFSET]
                   mkv

positional arguments:
  mkv                   MKV file

optional arguments:
  -h, --help            show this help message and exit
  -o OUT                output MKV file
  --srt SRT             SRT file
  --srt-encoding SRT_ENCODING
                        SRT file encoding
  --start-offset START_OFFSET
                        offset to apply to every start
                        timestamp
  --end-offset END_OFFSET
                        offset to apply to every end
                        timestamp

Example

# Looks for `example_video.srt` under same directory. Will output to `example_video.surbmerge.mkv` under same directory.
mkvsubmerge example_video.mkv

# Will output to `example_video` under same directory.
mkvsubmerge example_video.mkv --srt example_srt.srt

# Will output `output_video.mkv`
mkvsubmerge example_video.mkv --srt example_srt.srt -o output_video.mkv

If some sentence appears not complete in the generated video file, chances are that some timestamp falls between two key frames. See https://mkvtoolnix.download/doc/mkvmerge.html#mkvmerge.description for detailed explanation:

Note that mkvmerge(1) only makes decisions about splitting at key frame positions. This applies to both the start and the end of each range. So even if an end timestamp is between two key frames mkvmerge(1) will continue outputting the frames up to but excluding the following key frame.

In that case you can extend every timestamp pair by specifying --start-offset and end-offset to include more key frames.

# This will extend every timestamp pair by two seconds. Every timestamp will start one second earlier and end one second later.
# No need to worry about overlapping/out-of-bounds timestamps as mkvsubmerge will take care of them.
mkvsubmerge example_video.mkv --start-offset -1000 --end-offset 1000

About

Med0paW

medopaw@gmail.com

https://github.com/medopaw

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkvsubmerge-0.0.4.tar.gz (5.0 kB view details)

Uploaded Source

File details

Details for the file mkvsubmerge-0.0.4.tar.gz.

File metadata

  • Download URL: mkvsubmerge-0.0.4.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for mkvsubmerge-0.0.4.tar.gz
Algorithm Hash digest
SHA256 1bde0e17fd6cb693c110d26d48eb4d64bc03e9c834611609f87a5a822cf2ad4e
MD5 304d134545037e674cae815a78afa13a
BLAKE2b-256 f600f6ac880c458db47f31fad5378117a14e3cb1eeef5e0b7020c2b9d8c37d18

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page