Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choosing directory for --save-images #45

Closed
nywhere opened this issue Sep 21, 2017 · 7 comments
Closed

Choosing directory for --save-images #45

nywhere opened this issue Sep 21, 2017 · 7 comments

Comments

@nywhere
Copy link

nywhere commented Sep 21, 2017

Hi!

Is there a workaround to be able to specify a different output directory for --save-images?

Thanks!

@Breakthrough
Copy link
Owner

Breakthrough commented Sep 27, 2017

Hello @nywhere;

Currently, due to the way PySceneDetect is implemented, images are outputted to the working directory. What are you trying to achieve/implement out of curiosity, and are you using the command-line or Python interface? (I assume CLI, but just want to make sure)

Assuming command-line, this is definitely possible with a script, but I can see this being a useful feature. In future versions, do you think it would be worth-while to allow the -si / --save-images flag to accept an optional output directory? If so, I can look into adding this as an official feature in an upcoming release.

Edit: The new command line interface is being previewed, see the comments below for an example.

Any feedback on the matter would be much appreciated. Thank you for your submission!

@nywhere
Copy link
Author

nywhere commented Sep 27, 2017

Hi,

Thanks for your answer! I'm using the CLI and want to obtain the first image of each scene along with the time of this scene change. It would be definitely great to be able to choose the output directory for images so it does not get messy in the working dir.

Few other simple things that could make the life easier, maybe you will find some of them interesting:

  • base naming convention for images (for example XXXX then the system will export XXXX_00001_IN.jpg). Btw, notice that I put 00001 so it stays consistent in the output folder, for now it orders the picture with 1,10,100,2, 3, 4, 5, 6, 7....
  • choosing to export IN or OUT or both IN and OUT images
  • defining output resolution for images (this one would be really cool actually)
  • output a Json listing the timecode and image filename for each scene change

Thanks!

@petamind
Copy link

I want this feature too! Thanks

@mancevd
Copy link

mancevd commented Jan 31, 2018

vote

@adius
Copy link

adius commented Feb 2, 2018

I'm using https://github.com/handflucht/PySceneDetect to run PySceneDetect and being able to specify an output directory would be really helpful!

@Breakthrough
Copy link
Owner

Breakthrough commented Jul 14, 2018

As an update, the new v0.5 CLI will support the concept of subcommands, where each subcommand will accept options such as output directory. My aim for the CLI implementation would be to call something like (EDIT: See comment after this one for the actual new CLI implementation, it is similar to the last one that is here.):

scenedetect --input somevideo.mp4 detect-content --threshold 27 output --images image_output_dir/  --scene-list scene_list_file.csv  --split-video video_output_dir/

The second alternative utilizies more sub-commands:

scenedetect --input somevideo.mp4 detect-content --threshold 27 output-images image_output_dir/  output-scene-list scene_list_file.csv output-videos video_output_dir/

The third alternative is to specify an output directory for everything PySceneDetect writes:

scenedetect --input somevideo.mp4 --output output_dir/ detect-content --threshold 27  save-images split-video save-scene-list

I am leaning towards the latter as I feel it is a cleaner solution, and the output directory could be overriden per command/action, although I am definitely open to any feedback or suggestions anyone may have.

@Breakthrough
Copy link
Owner

Breakthrough commented Aug 1, 2018

This is now implemented in v0.5-beta. You can run scenedetect help save-images how to specify the output folder. There are two options: specify the -o option for PySceneDetect itself, setting the output directory, or adding the -o option to the save-images command directly, which will override the global -o version. For example, to save the images in a folder called my_folder, you could do any of the following in PySceneDetect v0.5:

scenedetect -i input_video detect-content save-images -o my_folder

scenedetect -i input_video -o my_folder detect-content save-images

scenedetect -i input_video -o video_out_dir detect-content split-video save-images -o my_folder

You can grab/install a copy of v0.5-beta from the releases page if you would like, and feel free to share any feedback that you might have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants