You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With one particular video file (which I think I can share privately if needed) I noticed that created cut scene files generated by this command did not have the correct length in frames reported in the SceneTimings.csv file. Yet with recoding, in this case lossless, according to the doc (https://trac.ffmpeg.org/wiki/Seeking) the ffmpeg -ss commands should ensure accuracy.
(With SceneTimings.csv generated by scenedetect -i “%_InputFile%” -b pyav -s stats.csv --min-scene-len 10s detect-adaptive --weights 1 1 1 list-scenes -s -f scenesTimings.csv but it should not affect the behavior)
I also tried split-video with -m flag and manually running the ffmpeg commands with the values reported in the SceneTimings.csv file with different seek methods which I report in the following table where there is the number of frames per scene calculated with the command:
I noticed that the split made by scenedetect split-video using ffmpeg does not have the total frames as that of the original video, and neither do the manual ones using ffmpeg (-ss before or after -i, and -vf select="between(n,start_frame_num,end_frame_num) ).
The split that comes closest is with mkvmerge but it does not precisely cut each scene in the chosen timestamps.
Environment:
scenedetect version
[PySceneDetect] PySceneDetect 0.6.5
[PySceneDetect] Loading user config file:
C:\Users\A\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
If it is needed, perhaps to replicate or create a test, I can privately send the video file somehow.
EDIT: After looking at the mediainfo of the input file, it reports variable frame rate for the video.
Could it explain the mismatch between the frames written in SceneTiming.csv and the actual frames in the cuts?
The text was updated successfully, but these errors were encountered:
EDIT: After looking at the mediainfo of the input file, it reports variable frame rate for the video.
Could it explain the mismatch between the frames written in SceneTiming.csv and the actual frames in the cuts?
Yes that would explain it! VFR videos aren't well supported right now, this is being tracked in #168. I hope to eventually overhal the timecode APIs so that VFR works better with PySceneDetect.
For now, the best workaround is, unfortunately, to re-encode the input to be CFR.
Description:
With one particular video file (which I think I can share privately if needed) I noticed that created cut scene files generated by this command did not have the correct length in frames reported in the SceneTimings.csv file. Yet with recoding, in this case lossless, according to the doc (https://trac.ffmpeg.org/wiki/Seeking) the ffmpeg
-ss
commands should ensure accuracy.scenedetect -i “%_InputFile%” -b pyav load-scenes -i SceneTimings.csv -c “Start Frame” split-video -a “-map 0:v -c:v libx264 -preset veryfast -crf 0 ” -f $SCENE_NUMBER.mkv
(With SceneTimings.csv generated by
scenedetect -i “%_InputFile%” -b pyav -s stats.csv --min-scene-len 10s detect-adaptive --weights 1 1 1 list-scenes -s -f scenesTimings.csv
but it should not affect the behavior)I also tried split-video with
-m
flag and manually running the ffmpeg commands with the values reported in the SceneTimings.csv file with different seek methods which I report in the following table where there is the number of frames per scene calculated with the command:ffprobe -i “%SceneNumber%.mkv” -select_streams v:0 -count_frames -show_entries stream^=nb_read_frames -v quiet -of csv^=“p=0” >> framelist.txt
I noticed that the split made by scenedetect split-video using ffmpeg does not have the total frames as that of the original video, and neither do the manual ones using ffmpeg (-ss before or after -i, and -vf select="between(n,start_frame_num,end_frame_num) ).
The split that comes closest is with mkvmerge but it does not precisely cut each scene in the chosen timestamps.
Environment:
scenedetect version
Media/Files:
The SceneTimings.csv :
scenesTimings.csv
If it is needed, perhaps to replicate or create a test, I can privately send the video file somehow.
EDIT: After looking at the mediainfo of the input file, it reports variable frame rate for the video.
Could it explain the mismatch between the frames written in SceneTiming.csv and the actual frames in the cuts?
The text was updated successfully, but these errors were encountered: