antiboredom / videogrep

automatic video supercuts with python
https://antiboredom.github.io/videogrep
Other
3.33k stars 257 forks source link

--input not reading wildcard on windows powershell #101

Closed albertious closed 1 year ago

albertious commented 2 years ago

Hi

I have encountered a strange issue when using videogrep in windows.

If I try to use a wildcard to input all the mp4s in a folder --input *.mp4 it returns the following message: No subtitle file found for *.mp4 meaning that it is searching for a MP4 file with the literal name *.mp4

This wasn't happening with osx terminal. Has anyone encounter the same problem?

A

antiboredom commented 2 years ago

I'll look into it! I thought powershell should be able to handle the glob pattern but maybe not? Or maybe it's something in my implementation? A work around until it's fixed is to pass in the files separated by spaces like:

videogrep --input vid1.mp4 vid2.mp4 vid3.mp4 --search "whatever"
albertious commented 2 years ago

thanks, that's the solution i went with in the end!

i thought glob worked in windows too. it didn't like patterns such as filename{1..400}.mp4 either. I can test some other phrases once this is done processing. I moved to a PC because the processing consistently quit after 17000-18000 iterations on a macOS. windows seems better at allocating the resources for larger datasets.

a.

albertious commented 2 years ago

hey, this issue seems to become troublesome again when there are too many files to list.

Program 'videogrep.exe' failed to run: The filename or extension is too longAt line:1 char:1
+ videogrep -i 4-20min_1.mp4 4-20min_2.mp4 4-20min_3.mp4 4-20min_4.mp4  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
At line:1 char:1
+ videogrep -i 4-20min_1.mp4 4-20min_2.mp4 4-20min_3.mp4 4-20min_4.mp4

might enabling the option -i "source folder" (which calls all mp4s within the source folder) be a workaround from the windows glob obstacle? i see from issue #103 it is not currently possible, but it could be an easier fix temporarily?

albertious commented 2 years ago

actually i think the "filename or extension is too long" issue is to do with powershell, and trying to input too many files.

i have found a general solution for using wildcards on windows, if anyone is interested. in this instance to find 3 ngrams in the subs: videogrep -i @(get-childitem -name *.mp4) --ngrams 3

antiboredom commented 2 years ago

Thanks - I will still look into getting the * pattern fixed, but this is a great workaround.