Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

--update

The script I'm talking about:

#!/bin/bash

tipo=$1
arqv=$2
resolucao=$3
tipoarq=$4

help() {
  clear
  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
  help;
  exit
fi

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

echo "$count arquivos encontrados para converter."

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

  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
done
exit

--update

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
add comment

3 Answers 3

up vote 1 down vote accepted

Used http://us.onlinevideoconverter.com/ and it solved..

share|improve this answer
add comment

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: http://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide

Here's a more authoritative explanation for the problem involving libfaac: http://ffmpeg.org/trac/ffmpeg/wiki/AACEncodingGuide

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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