PDA

View Full Version : How to add the AMR codec


RSD
09-14-2006, 12:26 PM
I was wondering how i should add the amr codec. I have compiled mplayer with amr support, but it still doesn't work. Can someone tell me what am I doing wrong? The ./configure output says that both amr's are enabled.

I added the codec by not putting amr_wb and amr_nb in de /usr/local/lib/codecs, because I couldn't find the good files.

I added amr by putting some files downloaded from www.3gpp.com and putting them in de libavcodec dir of mplayer and then compiling mplayer. When i try to make some videos it doesn't work.

kashani
09-15-2006, 04:11 AM
It has been my experience that only this code from 3gpp actually works.

http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip
http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip

Once you've pulled those down you need to unzip the top level to get to the actual code.

mkdir working
cd working
unzip -q 26104-510.zip
unzip -q 26204-510.zip

Now add into MPlayer

cd MPlayer
mkdir libavcodec/amr_float
mkdir libavcodec/amrwb_float
cd libavcodec/amr_float
unzip -q /working/26104-510_ANSI_C_source_code.zip
cd libavcodev/amrwb_float
unzip -q /working/26204-510_ANSI-C_source_code.zip

When you compile mplayer it should figure out that AMR is now enabled and add it in.

kashani

RSD
09-15-2006, 05:21 AM
Well I downloaded 3 packs and installed them as you told me. I did this before, then I am going to compile MPlayer. After that I reinstalled flixengine, but I still have no sound with my uploaded 3gp movie. Is there a way that I can check if the codecs are installed properly and to see if flixengine uses the MPlayer?

kashani
09-15-2006, 03:45 PM
It's not three packs it's two. If you attempt to add all three it will not work, yet another thing that isn't in any of the docs. When you compile you should see the following int he configure part.

Checking for AMR narrowband ... yes
Checking for AMR narrowband, fixed point ... no
Checking for AMR wideband ... yes

then should report this at the end.

Enabled optional drivers:
Input: ftp network tv vcd
Codecs: qtx x264 xvid libdv amr_wb amr_nb libavcodec dshow/dmo win32 faad2(internal) faac musepack libmpeg2 liba52 mp3lib tremor(internal) libmad gif

Remember that Flix installs its own mencoder and you'll need change paths or move things around in order for your new mencoder to be used.

kashani

kashani
09-15-2006, 04:43 PM
Also you do not need to reinstall Flix. All changes to mplayer/mencoder are completely independent of the actual flixd proccesses and code.

kashani

RSD
09-17-2006, 02:07 PM
I think that the problem is lying in the paths to mencoder. In the documentation I couldn't find anything how to change these. Do I need to install mencoder in a specific directory, so that flix can find mencoder there or do I need to set specific paths in a config file of flix? And if so, what paths and where can I find them?

RSD
09-18-2006, 12:23 PM
Because I couldn't find any config files for the flixengine where to change the path to the mencoder I decided to reinstall flixd and then I changed the "Binary path of mencoder" in the flix install to /usr/local/bin (default path of mencoder). After the install I could convert the videos, but not the 3gp movies. However, now I thought I can recompile mencoder with the amr support. The mencoder was now installed, but now the flixengine doesnt work anymore. What went wrong? Can someone tell me?

I think that I need to know how/where to change the path to mencoder, which the flixengine uses.

kashani
09-18-2006, 04:24 PM
Are you adding the On2 patches to the mplayer src dir when you build your custom mencoder. If you are not, it won't work.

I suggest reinistalling flix to make sure things work.
Then building your custom mencoder.
then mv mencoder mencoder-flix-original
then cp mencoder /whatever/flixd/puts/it/

kashani

RSD
09-18-2006, 05:08 PM
I downloaded from the following:

http://www.on2.com/gpl/mplayer/

and then added the amr codecs and compiled it. Then i let flixd point to the installed directory.

Now I copied the downloaded code from on 2 in the mplayer dir and then compiled it.. let's see what it does.

RSD
09-18-2006, 05:34 PM
It is still not working..

I download:

http://www.on2.com/gpl/mplayer/2006-07-31-mencoder-on2flixenglinux.tar.bz2

unzip it and copy it to the original source of mplayer. Is that what you mean by adding the on2 patches? Or can I download these patches somewhere else? Then I added the amr codecs and some others and then compiled the whole thing.

After that I copied /usr/local/bin/mencoder to /usr/local/libexec/on2/flixengine.

RSD
09-18-2006, 07:12 PM
I think that I know have the mencoder running correctly, but the 3gp movies still don't have sound.

I compiled the mencoder exactly as mentioned in the readme file.

for the prefix path i set: /usr/local/libexec/on2/flixengine/mencoder

and when i installed flix i also set the path to the mencoder binary as:

/usr/local/libexec/on2/flixengine/mencoder

When I configure, i get the following message:


Enabled optional drivers:
Input: ftp network tv-v4l2 tv-v4l tv mpdvdkit2 vcd dvb
Codecs: qtx amr_wb amr_nb libavcodec real xanim dshow/dmo win32 faad2(internal) libmpeg2 liba52 mp3lib tremor(internal)
Audio output: oss mpegpes(dvb)
Video output: xvidix cvidix md5sum pnm jpeg png mpegpes(dvb) opengl dga xv x11 xover tga


Is there probably a codec missing for 3gp files?

RSD
09-19-2006, 12:12 PM
At the moment I can't even make mplayer, because it gives me an error. I think this is because I installed x264 and xvid. But I don't know hiow I can delete these codecs. I'm a newbie to linux, so maybe someone can help me?

kashani
09-19-2006, 04:03 PM
It is still not working..

I download:

http://www.on2.com/gpl/mplayer/2006-07-31-mencoder-on2flixenglinux.tar.bz2

unzip it and copy it to the original source of mplayer. Is that what you mean by adding the on2 patches? Or can I download these patches somewhere else? Then I added the amr codecs and some others and then compiled the whole thing.

After that I copied /usr/local/bin/mencoder to /usr/local/libexec/on2/flixengine.

Oh boy. My recommendation is to go steal a Linux kid from your local high school at this point.

How to build mplayer yourself and have it work with Flix.

1. Install flixd

2. Find the mencoder binary flixd installed and do mv mencoder mencoder-original

3. Install mplayer dependencies. The On2 provided mplayer is statically linked to libs so it doesn't need any libs on your system. Since you're building your own you need the libs at least on your build system. On my system, Gentoo Linux, that means these libs. These libs may have some dependencies of their own which I have not included.

[ebuild N ] media-libs/x264-svn-20060612
[ebuild N ] media-libs/win32codecs-20060611
[ebuild N ] media-libs/libmad-0.15.1b
[ebuild N ] media-libs/libmpcdec-1.2.2
[ebuild N ] media-libs/jpeg-6b-r7
[ebuild N ] media-libs/giflib-4.1.4
[ebuild N ] media-libs/freetype-2.1.10-r2
[ebuild N ] media-libs/libpng-1.2.12-r1
[ebuild N ] media-libs/xvid-1.1.0-r1
[ebuild N ] media-sound/lame-3.96.1
[ebuild N ] media-libs/libdv-0.102

4. Download the MPlayer src dir

5. Install the On2 patches. If you read the README in the On2 patches you will need to copy a few files into the Mplayer src dirs AND additionally patch a number of files using the patch utility.

6. Install any additional codecs like amr.

7. Build mplayer

8. Copy mencoder to where ever the original was.

That's pretty much it. Once you move your mencoder to the right place flixd will start using it. If you reinstall flixd it may over write mencoder so make sure you keep it somewhere safe on the system.

Or you can wait the two months it'll take for a native AMR codec to be built into ffmpeg which is the basis of mplayer. :)
http://rob.opendot.cl/index.php/2006/08/31/soc-job-interview-further-development-ideas/

kashani

RSD
09-20-2006, 08:59 PM
I still don't have it working.

At the moment I have a fresh install of fedoa core.

I installed all of the packages using yum:

yum install xvidcore
yum install libmad
etc...

When i do configure, he doesn't list even one installed package.

Do I need to compile these packages from source or what?

RSD
09-20-2006, 10:03 PM
While this doesn't make anysense i also installed all the development packages:

yum install xvidcore-devel
etc..

now after configure the packages are listed as being enabled, but when i try to make the build, it gives an error! What goes wrong....?

What do I need to do with all those packages and how ow do i need to install them.. it is pretty difficult to get this thing running isn't it?

RSD
09-21-2006, 07:43 AM
Whatever I do to install x264... I get this error:

ve_x264.c: In function 'config':
ve_x264.c:278: error: 'struct <anonymous>' has no member named 'b_cbr'
make[1]: *** [ve_x264.o] Error 1
make[1]: Leaving directory `/tmp/mencoder/build/libmpcodecs'
make: *** [libmpcodecs/libmpcodecs.a] Error 2

searched on some lists, tried several other versions... nothing seems to work!

RSD
09-22-2006, 08:13 AM
Isn't there someone who can tell me how to install it on a fedora server with all the extra codecs. I think that I have the AMR codec workoing because when I compile it whit that one it doesn't give an error. Then I move it to the one which flixengine uses. But when I want some extra codecs such as libmad, libdv, libmpcodecs and x264 etc.. it gives me errors when I do a "make". Isn't there a manual? Or can I beter start using gentoo linux?

RSD
09-25-2006, 03:20 PM
No one?

rectalogic
11-06-2006, 07:50 PM
I think that the problem is lying in the paths to mencoder. In the documentation I couldn't find anything how to change these.

Set FLIXD_MENCODER environment variable to the path of your mencoder