Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mkvmerge cutter #216

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

nullSoup
Copy link

@nullSoup nullSoup commented Feb 7, 2019

Updated to support using mkvmerge to cut/combine clips. This is much faster than ffmpeg, and I find ffmpeg output crashes video players when playing across cuts on mkv file sources.

Pavol Babincak and others added 8 commits July 31, 2018 19:50
Until now last frame was always created in the format of enabled
formatted_time but that is disabled by default.

If smartcut is enabled GUI froze at 66 % of conversion and console has:

    vidcutter.libs.videoservice - INFO - /usr/bin/ffprobe -hide_banner -v error -show_packets -select_streams v -show_entries packet=pts_time,flags -of csv ".../filename.mp4"
    root - CRITICAL -   File ".../vidcutter/vidcutter/videocutter.py", line 1363, in saveMedia
        self.smartcutter(file, source_file, source_ext)
      File ".../vidcutter/vidcutter/videocutter.py", line 1413, in smartcutter
        allstreams=True)
      File ".../vidcutter/vidcutter/libs/videoservice.py", line 331, in smartcut
        bisections = self.getGOPbisections(source, start, end)
      File ".../vidcutter/vidcutter/libs/videoservice.py", line 590, in getGOPbisections
        end_pos = bisect_left(keyframes, end)

    root - CRITICAL - <class 'TypeError'>: '<' not supported between instances of 'str' and 'float'

Might relate to ozmartian#182.
In the case of failed video codec detection GUI freezes and console has following:

    vidcutter.libs.videoservice - INFO - /usr/bin/ffmpeg -hide_banner -i "/tmp/vidcutter/foo_middle_00.mp4"
    root - CRITICAL -   File ".../vidcutter/vidcutter/libs/videoservice.py", line 418, in smartcheck
        self.smartjoin(index)
      File ".../vidcutter/vidcutter/libs/videoservice.py", line 440, in smartjoin
        if self.isMPEGcodec(joinlist[1]):
      File ".../vidcutter/vidcutter/libs/videoservice.py", line 608, in isMPEGcodec
        codec = self.codecs(source)[0].lower()
      File ".../vidcutter/vidcutter/libs/videoservice.py", line 267, in codecs
        vcodec = re.search(r'Stream.*Video:\s(\w+)', result).group(1)

    root - CRITICAL - <class 'AttributeError'>: 'NoneType' object has no attribute 'group'

Fixes ozmartian#171
This could happen if the cut starts at the beginning of the file.
Following is found in console log:

    vidcutter.libs.videoservice - INFO - smartcut files are MPEG based so join via MPEG-TS
    vidcutter.libs.videoservice - ERROR - Exception during MPEG-TS join
    Traceback (most recent call last):
      File ".../vidcutter/vidcutter/libs/videoservice.py", line 626, in mpegtsJoin
        name, _ = os.path.splitext(file)
      File ".../vidcutter/lib64/python3.6/posixpath.py", line 122, in splitext
        p = os.fspath(p)
    TypeError: expected str, bytes or os.PathLike object, not NoneType
    vidcutter.libs.videoservice - INFO - smartcut MPEG-TS join failed, retry with standard concat
    root - CRITICAL -   File ".../vidcutter/vidcutter/libs/videoservice.py", line 418, in smartcheck
        self.smartjoin(index)
      File ".../vidcutter/vidcutter/libs/videoservice.py", line 446, in smartjoin
        self.smartcut_jobs[index].allstreams, None)
      File ".../vidcutter/vidcutter/libs/videoservice.py", line 459, in join
        filelist = os.path.normpath(os.path.join(os.path.dirname(inputs[0]), '_vidcutter.list'))
      File ".../vidcutter/lib64/python3.6/posixpath.py", line 156, in dirname
        p = os.fspath(p)

    root - CRITICAL - <class 'TypeError'>: expected str, bytes or os.PathLike object, not NoneType
If SmartCut is enabled GUI froze at 20 % of conversion and console has:

    vidcutter.libs.videoservice - INFO - SmartCut progress: {'middle': True, 'end': False}
    vidcutter.libs.videoservice - INFO - SmartCut resulted in zero length file, trying again without all stream mapping
    vidcutter.libs.videoservice - INFO - SmartCut progress: {'middle': True, 'end': False}
    vidcutter.libs.videoservice - INFO - SmartCut resulted in zero length file, trying again without all stream mapping
    root - CRITICAL -   File ".../vidcutter/vidcutter/libs/videoservice.py", line 397, in smartcheck
        self.smartcut_jobs[index].procs[name].started.disconnect()

    root - CRITICAL - <class 'TypeError'>: disconnect() failed between 'started' and all its connections

This makes conversion to fail and GUI to respond again. Error is still logged
and user is advised to turn off SmartCut.
…xtension. Much faster than ffmpeg, and I find ffmpeg output crashes video players when playing across cuts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant