You are not logged in.
Pages: 1
Is there a script which i can use to encode all videos inside a folder to a better format than mjpeg?
I have lot of videos from my camera and they are huge, please let me know if any such application/script exists.
thanks
Acer Aspire V5-573P Antergos KDE
Offline
you could in theory do this with one find command:
find /some/folder -name '*.some_extension' -exec some_encoding_command {} \;
but it gets tricky with extensions and such, i.e.
find ./ -name '*.avi' -exec ffmpeg -i {} {}.mp4 \;
would convert all avi's into mp4's (IIR[the options]C) but it'll leave a bunch of *.avi.mp4 files, which might be undesired. i'm sure procyon can come through with a more complex find line to take care of that but you could also just script it out:
#!/bin/bash
for video in $(find ./ -name '*.avi'); do
new="$(echo $video | sed 's/\.avi/\.mp4/g')"
ffmpeg -i $video $new
done
i _think_ that would work (some care might need to be taken if you've got spaces in filenames)... either way, i hope that gets you going in the right direction
Last edited by brisbin33 (2009-05-14 22:09:26)
//github/
Offline
thanks brisbin but what bout nested folders, will this work for folders inside folders?
Acer Aspire V5-573P Antergos KDE
Offline
Pages: 1