Git Product home page Git Product logo

mkvstrip's People

Contributors

ajslater avatar cyberjock avatar kurniliya avatar willforde avatar

Stargazers

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

Watchers

 avatar

mkvstrip's Issues

Make setting Title optional

Thanks for this great tool!
Would it be possible to make setting the title optional?
In my flow I process the files with mkvstrip before they are imported and as a result they will get the name of the downloaded file.

issue after cancelling script on directory

Worked originally and still does on sub directories

/tmp # mkvstrip -b /usr/bin/mkvmerge -l eng /storage/films
Searching for MKV files to process.
Warning: This may take some time...
Traceback (most recent call last):
File "/usr/bin/mkvstrip", line 8, in
sys.exit(main())
File "/usr/lib/python3.9/site-packages/mkvstrip.py", line 57, in wrapper
func(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/mkvstrip.py", line 360, in main
mkv_obj = MKVFile(mkv_file)
File "/usr/lib/python3.9/site-packages/mkvstrip.py", line 234, in init
for track_data in json__data["tracks"]:
KeyError: 'tracks'

UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 14730: character maps to <undefined>

Have an episode that gives an error, I think it is the Chinese characters

Searching for MKV files to process.
Warning: This may take some time...
Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Python37\lib\threading.py", line 926, in _bootstrap_inner
    self.run()
  File "C:\Python37\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Python37\lib\subprocess.py", line 1238, in _readerthread
    buffer.append(fh.read())
  File "C:\Python37\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 14730: character maps to <undefined>

Traceback (most recent call last):
  File "C:\GitHub\mkvstrip\mkvstrip.py", line 406, in <module>
    main()
  File "C:\GitHub\mkvstrip\mkvstrip.py", line 62, in wrapper
    func(*args, **kwargs)
  File "C:\GitHub\mkvstrip\mkvstrip.py", line 400, in main
    mkv_obj = MKVFile(mkv_file)
  File "C:\GitHub\mkvstrip\mkvstrip.py", line 232, in __init__
    stdout, _ = process.communicate(timeout=10)
  File "C:\Python37\lib\subprocess.py", line 939, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "C:\Python37\lib\subprocess.py", line 1288, in _communicate
    stdout = stdout[0]
IndexError: list index out of range

This is the MediaInfo

General
Unique ID                                : 143997547468014760918389400065283668341 (0x6C54EB3A52D62114E289E0B2B0573975)
Complete name                            : C:\TEMP\Torrent\PROCD\test\The.Marvelous.Mrs.Maisel.S03E04.2160p.AMZN.WEBRip.DDP5.1.x264-NTb.mkv
Format                                   : Matroska
Format version                           : Version 4
File size                                : 9.75 GiB
Duration                                 : 48 min 5 s
Overall bit rate                         : 29.0 Mb/s
Encoded date                             : UTC 2019-12-09 14:06:27
Writing application                      : mkvmerge v32.0.0 ('Astral Progressions') 64-bit
Writing library                          : libebml v1.3.7 + libmatroska v1.5.0

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : [email protected]
Format settings                          : CABAC / 5 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 5 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 48 min 5 s
Bit rate                                 : 28.4 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.143
Stream size                              : 9.53 GiB (98%)
Writing library                          : x264 core 158 r2984+47 456d10a t_mod_New [0-bit@all X86_64]
Encoding settings                        : cabac=1 / ref=5 / deblock=1:-3:-3 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / fade_compensate=0.00 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=48 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=0 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / fgo=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc=crf / mbtree=0 / crf=18.0000 / qcomp=0.60 / qpmin=0:0:0 / qpmax=69:69:69 / qpstep=4 / ip_ratio=1.30 / pb_ratio=1.20 / aq=3:0.80 / aq-sensitivity=10.00 / aq-factor=1.00:1.00:1.00 / aq2=0 / aq3=0
Language                                 : English
Default                                  : Yes
Forced                                   : No

Audio
ID                                       : 2
Format                                   : E-AC-3
Format/Info                              : Enhanced AC-3
Commercial name                          : Dolby Digital Plus
Codec ID                                 : A_EAC3
Duration                                 : 48 min 5 s
Bit rate mode                            : Constant
Bit rate                                 : 640 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Stream size                              : 220 MiB (2%)
Language                                 : English
Service kind                             : Complete Main
Default                                  : Yes
Forced                                   : No

Text #1
ID                                       : 3
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 179 b/s
Count of elements                        : 1042
Stream size                              : 60.3 KiB (0%)
Language                                 : Arabic
Default                                  : No
Forced                                   : No

Text #2
ID                                       : 4
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 107 b/s
Count of elements                        : 1040
Stream size                              : 36.2 KiB (0%)
Language                                 : Danish
Default                                  : No
Forced                                   : No

Text #3
ID                                       : 5
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 50 s
Bit rate                                 : 97 b/s
Count of elements                        : 778
Stream size                              : 32.8 KiB (0%)
Language                                 : German
Default                                  : No
Forced                                   : No

Text #4
ID                                       : 6
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 47 min 47 s
Bit rate                                 : 120 b/s
Count of elements                        : 1303
Stream size                              : 42.2 KiB (0%)
Title                                    : SDH
Language                                 : English
Default                                  : No
Forced                                   : No

Text #5
ID                                       : 7
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 112 b/s
Count of elements                        : 1041
Stream size                              : 37.9 KiB (0%)
Title                                    : Latinoamérica
Language                                 : Spanish
Default                                  : No
Forced                                   : No

Text #6
ID                                       : 8
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 113 b/s
Count of elements                        : 1037
Stream size                              : 38.3 KiB (0%)
Title                                    : España
Language                                 : Spanish
Default                                  : No
Forced                                   : No

Text #7
ID                                       : 9
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 98 b/s
Count of elements                        : 1040
Stream size                              : 33.1 KiB (0%)
Language                                 : Finnish
Default                                  : No
Forced                                   : No

Text #8
ID                                       : 10
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 97 b/s
Count of elements                        : 1041
Stream size                              : 32.9 KiB (0%)
Language                                 : French
Default                                  : No
Forced                                   : No

Text #9
ID                                       : 11
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 170 b/s
Count of elements                        : 1042
Stream size                              : 57.3 KiB (0%)
Language                                 : Hebrew
Default                                  : No
Forced                                   : No

Text #10
ID                                       : 12
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 280 b/s
Count of elements                        : 1042
Stream size                              : 94.4 KiB (0%)
Language                                 : Hindi
Default                                  : No
Forced                                   : No

Text #11
ID                                       : 13
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 86 b/s
Count of elements                        : 1042
Stream size                              : 29.1 KiB (0%)
Language                                 : Indonesian
Default                                  : No
Forced                                   : No

Text #12
ID                                       : 14
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 108 b/s
Count of elements                        : 1040
Stream size                              : 36.7 KiB (0%)
Language                                 : Italian
Default                                  : No
Forced                                   : No

Text #13
ID                                       : 15
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 50 s
Bit rate                                 : 79 b/s
Count of elements                        : 1034
Stream size                              : 26.6 KiB (0%)
Language                                 : Japanese
Default                                  : No
Forced                                   : No

Text #14
ID                                       : 16
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 116 b/s
Count of elements                        : 1042
Stream size                              : 39.2 KiB (0%)
Language                                 : Korean
Default                                  : No
Forced                                   : No

Text #15
ID                                       : 17
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 109 b/s
Count of elements                        : 1041
Stream size                              : 36.7 KiB (0%)
Language                                 : Norwegian Bokmal
Default                                  : No
Forced                                   : No

Text #16
ID                                       : 18
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 94 b/s
Count of elements                        : 1041
Stream size                              : 31.8 KiB (0%)
Language                                 : Dutch
Default                                  : No
Forced                                   : No

Text #17
ID                                       : 19
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 84 b/s
Count of elements                        : 1037
Stream size                              : 28.3 KiB (0%)
Language                                 : Polish
Default                                  : No
Forced                                   : No

Text #18
ID                                       : 20
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 108 b/s
Count of elements                        : 1042
Stream size                              : 36.4 KiB (0%)
Language                                 : Portuguese
Default                                  : No
Forced                                   : No

Text #19
ID                                       : 21
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 188 b/s
Count of elements                        : 1041
Stream size                              : 63.4 KiB (0%)
Language                                 : Russian
Default                                  : No
Forced                                   : No

Text #20
ID                                       : 22
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 110 b/s
Count of elements                        : 1040
Stream size                              : 37.1 KiB (0%)
Language                                 : Swedish
Default                                  : No
Forced                                   : No

Text #21
ID                                       : 23
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 340 b/s
Count of elements                        : 1042
Stream size                              : 115 KiB (0%)
Language                                 : Tamil
Default                                  : No
Forced                                   : No

Text #22
ID                                       : 24
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 285 b/s
Count of elements                        : 1042
Stream size                              : 96.1 KiB (0%)
Language                                 : Telugu
Default                                  : No
Forced                                   : No

Text #23
ID                                       : 25
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 256 b/s
Count of elements                        : 1042
Stream size                              : 86.3 KiB (0%)
Language                                 : Thai
Default                                  : No
Forced                                   : No

Text #24
ID                                       : 26
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 95 b/s
Count of elements                        : 1042
Stream size                              : 32.1 KiB (0%)
Language                                 : Turkish
Default                                  : No
Forced                                   : No

Text #25
ID                                       : 27
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 110 b/s
Count of elements                        : 1042
Stream size                              : 37.3 KiB (0%)
Title                                    : 中文(简体)
Language                                 : Chinese
Default                                  : No
Forced                                   : No

Text #26
ID                                       : 28
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Duration                                 : 45 min 58 s
Bit rate                                 : 100 b/s
Count of elements                        : 1042
Stream size                              : 33.9 KiB (0%)
Title                                    : 中文(繁體)
Language                                 : Chinese
Default                                  : No
Forced                                   : No

Menu
00:00:00.000                             : en:Amazon Original
00:00:05.000                             : en:Midge has a good show
00:01:54.000                             : en:Title Sequence
00:01:59.000                             : en:A night out in Vegas
00:06:55.000                             : en:Adjusting to a new living situation
00:09:49.000                             : en:Midge's first paycheck
00:14:50.000                             : en:Mei brings a gift
00:18:29.000                             : en:Early morning wake up call
00:20:10.000                             : en:A flight to Vegas
00:21:46.000                             : en:Susie comes home to New York for meetings
00:25:39.000                             : en:Joel arrives in Vegas
00:26:26.000                             : en:Scheduling civil unrest
00:28:37.000                             : en:Comedy and drama come together
00:33:35.000                             : en:A night in Vegas together
00:36:56.000                             : en:A rough morning after
00:43:30.000                             : en:Ready to leave Vegas
00:46:05.000                             : en:End Credits

Make Progress percentage optional

I capture the output from mkvstrip in my process to be able to send an mail with evrything done at the end.
The issue is that the percentage is captured 😄 The resulting mail is like this.

Remuxing: file.mkv
============================
Retaining subtitle track(s):
    Track #2: eng - SubRip/SRT
    Track #3: eng - SubRip/SRT
Removing subtitle track(s):
    Track #4: spa - SubRip/SRT
----------------------------
Progress 0%
Progress: 0%
Progress: 2%
Progress: 4%
Progress: 6%
Progress: 9%
Progress: 12%
Progress: 15%
Progress: 18%
Progress: 20%
Progress: 23%
Progress: 26%
Progress: 29%
Progress: 32%
Progress: 35%
Progress: 37%
Progress: 41%
Progress: 43%
Progress: 46%
Progress: 49%
Progress: 51%
Progress: 54%
Progress: 57%
Progress: 59%
Progress: 61%
Progress: 64%
Progress: 67%
Progress: 70%
Progress: 72%
Progress: 74%
Progress: 76%
Progress: 79%
Progress: 81%
Progress: 84%
Progress: 87%
Progress: 89%
Progress: 92%
Progress: 94%
Progress: 97%
Progress: 99%
Progress: 100%

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.