Tuesday, October 5, 2010

Flv to 3gp converter

First of all I was installed ffmpeg on my centos 5.1 using yum.
If you don't have then simply run "yum install ffmpeg*".
Now to convert flv into 3gp, ffmpeg should contain h263 vedio codes generally it has and amrnb audio codes. In my case i don't have this audio code which was downloaded. Compiled and installed without any problem.
Create a file /bin/fl23gp and write below code.
------------------------------------------------------------------------------------------------------------
#!/bin/bash
echo "flv 2 3gb Convertion"
echo ""
if (($# ==0))
then
echo "Usage: flvto3gp [flv files] ..."
exit
fi

while (($# !=0 ))
do
ffmpeg -i $1 -s 176x144 -vcodec h263 -r 25 -b 200 -ab 6.7k -sameq -acodec libopencore_amrnb -ac 1 -ar 8000 ${1//.flv/.3gp}
shift
done
echo "Finished flv-to-3gp convertion"
echo "\" Enjoy \""
echo ""
------------------------------------------------------------------------------------------------------------
Run "chmod 777 /bin/flv23gp" .

"ffmpeg -formats | grep amr" will return what are audio codes preset with amr. Which was mentioned in /bin/flv3mp3 file for -acodec as "libopencore_amrnb" .

No comments: