woodruffw / snippets

Short (but useful) scripts and programs.

Home Page:https://yossarian.net/snippets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ffmpeg-mosaic "One or more invalid inputs."

moeC137 opened this issue · comments

doing this:
ruby ffmpeg-mosaic 1000x1000 10x10 mosaic.mp4 $(shuf -e -n 100 300x300/*.mp4)
gives me this error:
One or more invalid inputs.

I am trying this on Linux and my .mp4 videos are in the same folder

Here's the offending line:

abort "One or more invalid inputs." unless !inputs.empty? && inputs.all? { |i| File.file?(i) }

So the problem here is that your shuf expansion isn't producing a list of filepaths that the script can find.

How could i just choose all *.mp4 in the folder? I dont need them to be random.

running
ruby ffmpeg-mosaic 1000x1000 10x10 mosaic.mp4 $(shuf -e -n 100 *.mp4)
gave me this error:
ffmpeg-mosaic:45:in

': can't modify frozen String: "" (FrozenError)`

trying shuf -e -n 100 *.mp4 itself gives me a filelist tho

Ah, that might be my fault -- looks like that script got linted and had frozen_string_literal: true added to it even though it relies on non-frozen strings. I'll make a fix this afternoon/evening.

Removing the #frozen_string_literal: true one line 2 actually made it work, thx so much for the help

Glad it's working for you with that change! I'll make the more permanent fix later.