I’m a novice script editor. I convert MOV/AVI video files to MP4 format using a script with ffmpeg and then move the files after processing:
`for f in *.mov; do ffmpeg -y -i “$f” “${f%}.mp4”; done
mv -f *.mov /Users/me/Videos/mov
mv -f *.MOV /Users/me/Videos/mov
mv -f *.avi /Users/me/Videos/avi
mv -f *.AVI /Users/me/Videos/avi`
-
Currently the script converts all videos, then moves them all to the other folders. Please how can the script be adjusted so that each video is moved immediately after processing (instead of waiting until all are complete)? This would be a great improvement, as sometimes there are a lot of videos and the script gets interrupted for some reason (not a fault of the script). It will make it easier to monitor progress.
-
Currently I manually tweak the first line changing *.mov for *.avi Please is there an easy way to handle either video file format/extension, within the same line?
-
Is there a better way of handling the mv statements which have multiple lines for lower/uppercase? They also give error if there are no files of that type.
Thank you
The above script is functional but will be better with enhancements or changes.
Matt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.