extractframes icon indicating copy to clipboard operation
extractframes copied to clipboard

about batch input

Open lixue17868800524 opened this issue 4 years ago • 1 comments

Hello, it's a great honor to see your project of extracting video frames, this will play a big role in most of my research. But in the process of doing it, a problem appeared how to input a folder, that is, batch video input, and then output the frames of batch video, I look forward to your answer, thank you!

lixue17868800524 avatar Mar 21 '20 13:03 lixue17868800524

Hi, I hope it can be helpful! Unfortunately it does not directly support taking multiple video inputs at once.

My suggestion would be to work around this problem by running extractframes once per video, and then renaming all the files at the end. For example:

extract.py ../first.avi vid01_frame%04d.jpg
extract.py ../second.avi vid02_frame%04d.jpg
extract.py ../third.avi vid03_frame%04d.jpg

ls | sort | nl -v 0 -n rz | while read new_frame file_name; do mv -i $file_name out_$new_frame.jpg; done

(other suggestions for how to do the last step could be found here: https://stackoverflow.com/questions/3211595/renaming-files-in-a-folder-to-sequential-numbers )

Hope this helps!

tgs avatar Mar 24 '20 23:03 tgs