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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
provide output folder directory when splitting videos #298
Comments
How I solved it: update this: call_list += [
'-sn',
filename_template.safe_substitute(
VIDEO_NAME=video_name, SCENE_NUMBER=scene_num_format % (i + 1))
] with this: # create output dir at function start
Path(output_dir).mkdir(parents=True, exist_ok=True)
# prepend output_dir to filename
export_path = str(
Path(output_dir)
/ filename_template.safe_substitute(
VIDEO_NAME=video_name, SCENE_NUMBER=scene_num_format % (i + 1)
)
)
call_list += [
"-sn",
export_path,
] |
Hi @fcakyon; You can replace the from scenedetect.video_splitter import split_video_ffmpeg
export_dir = "C:/output_folder/"
split_video_ffmpeg(
filepath,
scene_list=scene_list,
output_file_template=export_dir + "$scene-$SCENE_NUMBER.",
show_progress=True,
) The documentation could probably be improved here, but I probably will leave this as-is and not introduce another argument. Thanks for the report! |
Apologies for raising a closed issue from the dead here, but the proposed solution (#298 (comment)), doesn't work for my example.
My code differs from your example by using the I considered whether there were some potential write permissions that throws the error but when I do the actual Let me know if I should have simply raised another issue here, but considering the "solution" doesn't work, I figured it might be best to follow up here. Thanks in advance for helping out one of your sponsors :) |
@Mensen what happens if you use forward slashes instead? Does it work as expected from the CLI? If it still fails feel free to re-open a new issue, what you show above should work. PySceneDetect/scenedetect/platform.py Line 95 in 46f47d1
|
Forward slashes also does not work.
No issue when simply specifying a file name, but this then puts the files in the code directory which, when splitting 100s of scenes are less than ideal
In the code snip above it refers to For example in: PySceneDetect/scenedetect/video_splitter.py Line 234 in 99a17b9
That would certainly replace the double \\ that os.path.join uses when combining paths to be os compatable.
And wouldn't the line: PySceneDetect/scenedetect/video_splitter.py Line 259 in 99a17b9
Replace the ":" with a ";" in the path I specified? |
@Mensen thanks for pointing that out, indeed that seems to be the issue here. My apologies, feel free to file a new bug report for this. |
This has come up a few times again (e.g. #363), so I will look into revisiting this for the next release. |
This will be included in the next release, thanks! |
@Breakthrough thanks for this awesome project! I am utilizing it on my PhD heavily 馃憤
Issue
You can set the output directory in
save_images
function which is super useful in my case. However, there is no such feature forsplit_video_ffmpeg
which is a must in my case.Example:
Question:
PySceneDetect/scenedetect/video_splitter.py
Lines 267 to 271 in b54aff9
The text was updated successfully, but these errors were encountered: