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
{{ message }}
Repository navigation
provide output folder directory when splitting videos #298
@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 for split_video_ffmpeg which is a must in my case.
My code differs from your example by using the os.path functions instead of writing the path in a regular string... but I have also tried that with no apparent difference.
I considered whether there were some potential write permissions that throws the error but when I do the actual scenedetect, I also specify a stats_file_path in precisely the same way using the os.path method
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.
scenedetect.video_splitter.split_video_ffmpeg(video_file, scene_list[0:2],
... output_file_template='F:/Gamepass_Clips/Clip-$SCENE_NUMBER.mp4')
Error splitting video (ffmpeg returned 1).
1
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 output_directory and not necessarily output_file_template so there seems to be an intermediate step between the split_video_ffmeg and the get_and_create_path code. Could the problem lie there?
Activity
fcakyon commentedon Nov 12, 2022
How I solved it:
update this:
with this:
Breakthrough commentedon Nov 13, 2022
Hi @fcakyon;
You can replace the
output_file_templateparameter with an absolute path as well to work around this, e.g.:The documentation could probably be improved here, but I probably will leave this as-is and not introduce another argument. Thanks for the report!
Mensen commentedon Nov 16, 2022
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
os.pathfunctions instead of writing the path in a regular string... but I have also tried that with no apparent difference.I considered whether there were some potential write permissions that throws the error but when I do the actual
scenedetect, I also specify astats_file_pathin precisely the same way using theos.pathmethodLet 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 :)
Breakthrough commentedon Nov 17, 2022
@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
Mensen commentedon Nov 20, 2022
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
output_directoryand not necessarilyoutput_file_templateso there seems to be an intermediate step between thesplit_video_ffmegand theget_and_create_pathcode. Could the problem lie there?For example in:
PySceneDetect/scenedetect/video_splitter.py
Line 234 in 99a17b9
That would certainly replace the double \\ that
os.path.joinuses 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?
Breakthrough commentedon Nov 21, 2022
@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.
Breakthrough commentedon Dec 1, 2023
This has come up a few times again (e.g. #363), so I will look into revisiting this for the next release.
[video_splitter] Add `output_dir` argument to split_video_* functions.
Breakthrough commentedon Jan 22, 2024
This will be included in the next release, thanks!
[video_splitter] Add `output_dir` argument to split_video_* functions.