lagmoellertim/unsilence

Crashes on `Segment-Durations-Ms` trying to interpret it as `Duration`

RomanKornev opened this issue · 0 comments

Describe the bug
Crashes on certain output of ffmpeg

To Reproduce
Steps to reproduce the behavior:

  1. unsilence in.mkv out.mkv
  2. Error Nonetype is not subsriptable

Expected behavior
Skips the Segment-Durations-Ms line instead of crashing.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS + version: W10 x64
  • Python version 3.9
  • FFMPEG version ffmpeg version 4.4-full_build-www.gyan.dev

Additional context
Seems to be an error in elif "Duration" in line: logic in DetectSilence.py.
Snippet of ffpmeg output, note Segment-Durations-Ms:

Input #0, matroska,webm, from '4_in.mkv':
  Metadata:
    HTTP://YOUTUBE.COM/STREAMING/OTF/DURATIONS/112015: Segment-Count: 1424
                    : Segment-Durations-Ms: 5067,5066,5067(r=1),5066,5067(r=1),5066,5067(r=1),5066,5067(r=1),5066,5067(r=1),5066,5067(r=1),5066,5067(r=1),5066,5067(r=1),5066,5067(r=1),5066,5067(r=1),5066,5067(r=1),5066,5067(r=1),5066,5067(r=1),5066,5067(r=1),5066,5067(r=1),506
                    :
                    :
    ENCODER         : Lavf58.29.100
  Duration: 02:00:12.07, start: 0.000000, bitrate: 363 kb/s
  Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv, bt709/unknown/unknown), 1280x720, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 1k tbn, 1k tbc (default)
    Metadata:
      DURATION        : 02:00:11.999000000
  Stream #0:1(eng): Audio: aac (LC), 44100 Hz, stereo, fltp (default)
    Metadata:
      HANDLER_NAME    : ISO Media file produced by Google Inc.
      DURATION        : 02:00:12.071000000
Stream mapping:
  Stream #0:0 -> #0:0 (vp9 (native) -> wrapped_avframe (native))
  Stream #0:1 -> #0:1 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help