Ubuntu: How to convert rmvb to mp4? (or, why ffmpeg doesn't work?)


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:

#!/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  


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...


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


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


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  


enter image description here

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

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »