Converting ogv-files to avi with ffmpeg

Today I needed to convert an ogv file to an avi file. I found this script after a quick search in the web. But for some reason mencoder did not work for me. It was cutting the video. A big mess. So I changed it with ffmpeg and all is good.

Here is the ogv2avi script I made:

#!/bin/bash
# ogv to avi
# Call this with multiple arguments
# for example : ls *.{ogv,OGV} | xargs ogv2avi
N=$#;
echo “Converting $N files !”
for ((i=0; i<=(N-1); i++))
do
	echo “converting” $1
	filename=${1%.*}
	ffmpeg -i $1 -vcodec mpeg4 -sameq -acodec libmp3lame $filename.avi
	shift 1
done

Category: