Repository navigation
Mkvmerge split video failed #473
Copy link
Copy link
Closed
Description
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
Breakthrough commentedon Jan 10, 2025
Thanks for the report, indeed this is a bug. As a workaround, if you specify an output directory for the
split-videocommand with the-o/--outputyou should not hit this bug. To use your working directory just set-o .as in:Can you let me know if the workaround is successful?
Looks like this was introduced in 6f76961 when fixing #298 and #359.
Werve commentedon Jan 10, 2025
Yes, I confirm that with the addition of
-o .the command workedBreakthrough commentedon Jan 21, 2025
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!