convert videos using ffmpeg (avi to flv, mpg to 3gp)



error: Unknown encoder 'mp3' or Unknown encoder 'libmp3lame' fix:
sudo apt-get install libavcodec-unstripped-52
#!/bin/bash

# avi to flv
fname=test.avi          # input filename
vbrate=2048             # video bitrate
res=640x480             # video resolution
frate=20                # video framerate
acodec=libmp3lame	# audio codec
abrate=88               # audio bitrate
ach=1                   # audio channel
srate=11025             # audio sample rate

ffmpeg -i $fname -b ${vbrate}k -s ${res} -r ${frate} -acodec $acodec -ac $ach -ab $abrate -ar $srate ${fname}_${vbrate}_${res}_${frate}.flv

#!/bin/bash

# mpg to 3gp (for Nokia 6300)
fname=test.mpg          # input filename
vcodec=h263             # video codec
res=128x96              # video resolution
frate=15                # video framerate
acodec=aac              # audio codec
abrate=80               # audio bitrate
ach=1                   # audio channel
srate=8000              # audio sample rate

ffmpeg -i $fname -s ${res} -vcodec ${vcodec} -r ${frate} -acodec ${acodec} -ac $ach -ab $abrate -ar $srate ${fname}_${vcodec}_${res}_${frate}.3gp

Last update:
2009-12-05 17:45
Author:
Daniel
Revision:
1.7
Average rating:0 (0 Votes)

You can comment this FAQ

Chuck Norris has counted to infinity. Twice.