carykh / jumpcutter

Automatically edits vidx. Explanation here: https://www.youtube.com/watch?v=DQ8orIurGxw
MIT License
3.08k stars 541 forks source link

Suggestion: Process each in a directory #124

Open BaronVonScrub opened 5 years ago

BaronVonScrub commented 5 years ago

The original video stated Cary was going to use it to process a whole bunch of lecture videos, however having to process each and every video is ridiculously tedious, especially if there are a lot of them.

Can we set it up such that if there is no input file specified, it will try each file in its current directory with the stated (or default) settings, one after the other?

I don't imagine this could be much harder than a "for file f in DIRECTORY" before the processing starts, and "INPUT_FILE = f" when it looks for what file to start on - yet I'm struggling to get this approach to work due to a lack of experience in dealing with directories within Python.

Lamaun commented 5 years ago

Solution with bash would be (If you have no spaces in filenames)

for FILE in $(ls .)
do
    python3 ../jumpcutter.py --input_file $FILE
done

If you use a fork that allows parrallel processing, you can put an '&' behind the python line

mrbesen commented 4 years ago

or you could use find

find folder/ -name "*.mp4" -type f -exec python3 jumpcutter.py --input_file {} --output_file outputdir/{} \;