here's the script I made for converting videos
Code:
#!/bin/bash
if [ -z "$rate" ]; then
rate="29.985"
fi
echo rate="$rate"
if [ -z "$flags" ]; then
flags="+aic+mv4"
fi
echo flags="$flags"
# new file name
F="converted/${1%.*}.mp4"
if [ ! -d "converted" ]; then
mkdir converted
fi
if [ ! -f "$F" ]; then
ffmpeg -i "$1" -r "$rate" -acodec libvo_aacenc -b 128k -vcodec mpeg4 -b 1200k -flags "$flags" "$F"
fi
make a new folder called Scripts in your home folder, then save it as '2mp4' (with no extension) in that folder. open a terminal and paste the following into it:
Code:
cd Scripts; chmod +x 2mp4; echo "PATH=$PATH:$HOME/Scripts" >> $HOME/.bashrc
then when you want to convrrt a file, simply type
from the same folder and the .mp4 will be in the 'converted' folder. if you want to specify a framerate, then prefix the command, like so
Code:
rate=25 2mp4 <file>
when I want to convert an entire foldrr, I do this (which is why it outputs to a 'converted' folder)
Code:
while read -r f; do 2mp4 "$f"; done< <(ls)
Bookmarks