Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I'm trying to use this script to convert an rmvb video to mp4, but I'm having problems with the ffmpeg.

In apt-get there's only ffmpeg0 and ffmpeg-dev, I installed both, but the script doesn't work, it's saying that ffmpeg was not found.

Any hint on this?


The script I'm talking about:



help() {
  echo "Convertor de Vídeos para MP4"
  echo "Parametro 1 = Tipo: (A - Arquivo/D - Diretório)"
  echo "Parametro 2 = Arquivo/Caminho"
  echo "Parametro 3 = Resolução"
  echo "Parametro 4 = Tipo de Arquivos de Entrada (rmvb, avi, mpeg)"

if [ "$tipo" = "" -o "$arqv" = "" -o "$resolucao" = "" -o "$tipoarq" = "" ]; then

if [ "$tipo" = "D" ]; then
  count=`ls "$arqv"/*.$tipoarq | wc -l`

echo "$count arquivos encontrados para converter."

while [ ! $x -ge $count ]; do
  x=`echo $x + 1 | bc`
  if [ "$tipo" = "D" ]; then
    nome=`ls "$arqv"/*.$tipoarq | head -n $x | tail -n 1`

  echo "Convertendo $nome ..."
  ffmpeg -i "$nome" -acodec libfaac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -cmp 2 -subcmp 2 -s $resolucao "`echo $nome | sed "s/\.$tipoarq//g"`".mp4


Using WinFF it gives:

Unknown encoder 'libx264'

I've installed both the existing packages libx264-67 and libx264-dev, but none solved.

Looking for more alternatives...

share|improve this question
Could you please post the exact error message that you get? that "not found" is most likely related to the file being converted, not to the ffmpeg command itself (which you have checked and is installed). – João Pinto Dec 29 '10 at 21:56
@João Pinto the exactly error message is Unknown encoder 'libfaac' – Tom Brito Dec 29 '10 at 22:06
I guess the ffmpeg version available for Ubuntu was compiled without the libfaac encoder support, probably due to legal reasons. – João Pinto Dec 29 '10 at 23:20

4 Answers 4

up vote 1 down vote accepted

Used and it solved..

share|improve this answer

The FFmpeg package you'll find on Ubuntu repositories does not contain libfaac for some silly licensing reasons. That's why you're having problems.

However you almost certainly don't need to transcode your audio in your specific case anyways (assuming you just want the audio to play at the same quality as the original, and not try tweakings) because the rmvb audio stream is probably already in aac format, which is what you need.

So you should simply substitute in your script this bit:

 -acodec libfaac -ab 128kb 

for this:

-c:a copy

This will simply copy the audio stream from the rmvb file to the mp4 file, while converting the video stream. The resulting file will work perfectly.

However, if you wish to have your initial settings work exactly as they were laid out, and on Ubuntu, then you'll have to compile FFmpeg from source to add the missing codecs.

Follow this guide for compiling FFmpeg on Ubuntu:

Here's a more authoritative explanation for the problem involving libfaac:

share|improve this answer
As noted in the last link, you can use -c:a libvo_aacenc to produce AAC output if the input is a different format and you can't use -c:a copy. – chronitis Apr 3 '13 at 17:37

The package you need to install is ffmpeg, if you run "ffmpeg" from the terminal it will tell the command to install the package containing the command:

sudo apt-get install ffmpeg
share|improve this answer
Looks like it's already installed, FFmpeg version SVN-r19352-4:0.5+svn20090706-2ubuntu2.2, but that script says it was not found.. – Tom Brito Dec 29 '10 at 21:41

enter image description here

You can use my dmMediaConverter,a FFMpeg GUI which has a Bulk mode convert.

share|improve this answer

protected by Community 2 days ago

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.