1

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

3
  • 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). Dec 29, 2010 at 21:56
  • @João Pinto the exactly error message is Unknown encoder 'libfaac' Dec 29, 2010 at 22:06
  • I guess the ffmpeg version available for Ubuntu was compiled without the libfaac encoder support, probably due to legal reasons. Dec 29, 2010 at 23:20

5 Answers 5

2

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

1
  • 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, 2013 at 17:37
1

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

1

enter image description here

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

0

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
1
  • Looks like it's already installed, FFmpeg version SVN-r19352-4:0.5+svn20090706-2ubuntu2.2, but that script says it was not found.. Dec 29, 2010 at 21:41
0
ffmpeg -i input.rmvb -c:a copy output.mp4

Worked for me.

2
  • Please don't add "thank you" as an answer. Instead, vote up the answers that you find helpful. - From Review May 21, 2018 at 8:27
  • Thanks for the feedback. In fact, it took me some time to extract these few instructions from the vast amount of code of the AP and the answer of @camurgo. (Which now is first place only bc. I gave it an upvote) So this answer may still be useful.
    – Jan
    May 21, 2018 at 8:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .