Skip to content

Mkvmerge split video failed #473

Closed
Closed

Description

@Werve

Description:

When I executed the split video command with the -m flag to use mkvmerge an error is shown. Without the -m flag then with ffmpeg it works normally.

Command:

scenedetect -i "E:\Videos\D Real\AR. Park - AR.Flying FREE!(1080p_H.264-AAC).mp4" split-video -m -f $SCENE_NUMBER

Output:

[PySceneDetect] PySceneDetect 0.6.5
[PySceneDetect] Loading user config file:
  C:\Users\A\AppData\Local\PySceneDetect\scenedetect.cfg
[PySceneDetect] Output file name format: $SCENE_NUMBER
[PySceneDetect] Detecting scenes...
  Detected: 38 | Progress: 100%|███████████████████████████████████████████████| 2262/2262 [00:25<00:00, 88.39frames/s]
[PySceneDetect] Processed 2262 frames in 25.6 seconds (average 88.33 FPS).
[PySceneDetect] Detected 39 scenes, average shot length 2.3 seconds.
[PySceneDetect] Splitting video with mkvmerge, output path template:
  $SCENE_NUMBER.mkv
Traceback (most recent call last):
  File "scenedetect\__main__.py", line 60, in <module>
  File "scenedetect\__main__.py", line 46, in main
  File "scenedetect\_cli\controller.py", line 79, in run_scenedetect
  File "scenedetect\_cli\commands.py", line 228, in split_video
  File "scenedetect\video_splitter.py", line 211, in split_video_mkvmerge
AttributeError: 'str' object has no attribute 'parent'
[PYI-39272:ERROR] Failed to execute script '__main__' due to unhandled exception!

Environment:

[PySceneDetect] PySceneDetect 0.6.5
[PySceneDetect] Loading user config file:
  C:\Users\Antonio\AppData\Local\PySceneDetect\scenedetect.cfg

System Info
------------------------------------------------------------
OS               Windows-10-10.0.19045-SP0
Python           CPython 3.13.0rc1
Architecture     64bit + WindowsPE

Packages
------------------------------------------------------------
av               13.1.0
click            8.1.7
cv2              4.10.0
imageio          2.36.0
imageio_ffmpeg   0.5.1
moviepy          2.1.1
numpy            2.1.3
platformdirs     4.3.6
scenedetect      0.6.5
tqdm             4.67.1

Tools
------------------------------------------------------------
ffmpeg           7.1-full_build-www.gyan.dev
mkvmerge         v88.0 ('All I Know') 64-bit

Activity

  1. Breakthrough commented on Jan 10, 2025

    @Breakthrough
    Owner

    Thanks for the report, indeed this is a bug. As a workaround, if you specify an output directory for the split-video command with the -o/--output you should not hit this bug. To use your working directory just set -o . as in:

    scenedetect - video.mp4 split-video -m -o .
    

    Can you let me know if the workaround is successful?


    Looks like this was introduced in 6f76961 when fixing #298 and #359.

  2. Werve commented on Jan 10, 2025

    @Werve
    Author

    Thanks for the report, indeed this is a bug. As a workaround, if you specify an output directory for the split-video command with the -o/--output you should not hit this bug. To use your working directory just set -o . as in:

    scenedetect - video.mp4 split-video -m -o .
    

    Can you let me know if the workaround is successful?

    Looks like this was introduced in 6f76961 when fixing #298 and #359.

    Yes, I confirm that with the addition of -o . the command worked

  3. pinned this issue on Jan 12, 2025
  4. added this to the 0.6.6 milestone on Jan 21, 2025
  5. Breakthrough commented on Jan 21, 2025

    @Breakthrough
    Owner

    This should be fixed by 3ee41b5. I also found a few other issues with the filename templates that I've resolved in some follow up commits.

    These fixes will be included in the next release (v0.6.6). Thanks for the report!

  6. unpinned this issue on Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions