PDA

View Full Version : HOWTO: Install and use the latest FFmpeg and x264



Pages : [1] 2 3 4 5 6 7 8 9 10

FakeOutdoorsman
May 8th, 2008, 02:20 AM
This guide has been moved to the official FFmpeg wiki:

How to Compile FFmpeg and x264 on Ubuntu (https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu)

The guide will be kept up to date and all supported Ubuntu versions will be included.

Paerez
May 12th, 2008, 09:48 PM
Great guide. Thanks a lot. One problem:

When I configure x264 I get the error:

./configure --enable-pthread --enable-mp4-output --enable-shared
No suitable assembler found. x264 will be several times slower.
Please install 'yasm' to get MMX/SSE optimized code.

I tried nasm and yasm from the repos but they didn't work :-(

But I figured it out!

All I had to do was go to:
http://www.tortall.net/projects/yasm/wiki/Download

Grab the 0.7.0 tarball, then ./configure, make, sudo checkinstall, then build x264, then ffmpeg. Now I can encode much faster.

A note to those who are interested:

I used the ffmpeg encoding script:

#!/bin/sh
ffmpeg -i $1 -y -an -pass 1 -vcodec libx264 -threads 4 -b 1024kbps -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me epzs -subq 1 -trellis 0 -refs 1 -bf 3 -b_strategy 1 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 $2

ffmpeg -i $1 -y -acodec libfaac -ab 128k -pass 2 -vcodec libx264 -threads 4 -b 1024kbps -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -flags2 +mixed_refs -me umh -subq 5 -trellis 1 -refs 5 -bf 3 -b_strategy 1 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 $2


Which can be run:

./scriptname myfile.avi myfile.mp4
And the result plays in Flash 9 using their h264 playback stuff. Pretty neat and high quality too.

FakeOutdoorsman
May 12th, 2008, 11:34 PM
Great guide. Thanks a lot. One problem:

When I configure x264 I get the error:

./configure --enable-pthread --enable-mp4-output --enable-shared
No suitable assembler found. x264 will be several times slower.
Please install 'yasm' to get MMX/SSE optimized code.

I tried nasm and yasm from the repos but they didn't work :-(

...
Thanks for pointing that out. I'll update it with a section on yasm compilation. Was the error the same if you tried using just nasm?

As of March 14, '08 (I think), x264 requires a newer yasm >= 0.6.0 than what is in the Ubuntu universe repository (yasm 0.5.0). x264 should fallback to nasm if yasm isn't detected and worked for me just fine despite the following error:

./configure: 330: yasm: not found
If I omitted nasm, I got the same error as you. I'm not sure why nasm worked for me and not for you.

Before I wrote this tutorial I tested the speed of x264 either using a compiled yasm 0.7.0, nasm from the repository, or no assembler. The speed differences were very small between compiled yasm and nasm from the repo:
x264/mencoder/ffmpeg on a dual quad core (http://ubuntuforums.org/showpost.php?p=4905281&postcount=5).

Edit: Tutorial updated with yasm compilation.

Paerez
May 14th, 2008, 04:45 PM
I tried using both nasm and yasm from the repos, and x264 would compile but it would say it was building without support for yasm and nasm.

Then, when I used it to convert a file it would say that it was using no cpu extensions, as opposed to saying "MMX SSE ...". It would also take significantly longer (like 2-5 times as long).

But just installing the yasm from source fixed it, and it wasn't very difficult to do.

ractalfece
June 24th, 2008, 06:39 AM
Thanks a million. Great in depth job on this one.

d_mcqueen
June 26th, 2008, 04:44 PM
This is a great howto, since in my opinion ffmpeg is broken due to these issues.

Therefore, what are the additional steps to fully replace ffmpeg, x64 and the libx264 packages such that it satisfies dependencies for other applications that use ffmpeg and my update manager does not keep asking me to upgrade from the checkinstall packages?

Nais
June 26th, 2008, 06:04 PM
When I try to "make" x264, I get this error.


/usr/bin/ld: common/mc.o: relocation R_X86_64_32S against `a local symbol' can not be used
when making a shared object; recompile with -fPIC
common/mc.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libx264.so.60] Error 1


I'm on 64-bit Ubuntu, is there something else I should be doing? Dunno what "-fPIC" means.

UPDATE: Never mind. Cleaned up my folder of a previous failed build attempt and it seems to be okay now. Thanks for the guide!

FakeOutdoorsman
June 26th, 2008, 06:09 PM
This is a great howto, since in my opinion ffmpeg is broken due to these issues.

Therefore, what are the additional steps to fully replace ffmpeg, x64 and the libx264 packages such that it satisfies dependencies for other applications that use ffmpeg and my update manager does not keep asking me to upgrade from the checkinstall packages?
I believe your compiled versions should satisify as dependencies for other packages as long as the packages are named correctly and compiling options that are required by the parent package are enabled. I don't use update-manager so I can't give instruction on that, but you can try:

sudo aptitude hold ffmpeg
If you prefer Synaptic, then select the package and then choose "Package -> Lock Version" from the menu. I haven't tested either of these commands, so I'm unsure how effective they are.

cor2y
June 27th, 2008, 02:38 AM
Yes locking versions work but how about trying to get synaptic to see that you installed libx264 via the source code with checkinstall so far according to synaptic i only have x264 the binary installed and not libx264 and libx264-dev so now other multimedia apps will not install without using the repos version of libx264 if i try to install via synaptic

FakeOutdoorsman
June 28th, 2008, 06:58 PM
Yes locking versions work but how about trying to get synaptic to see that you installed libx264 via the source code with checkinstall so far according to synaptic i only have x264 the binary installed and not libx264 and libx264-dev so now other multimedia apps will not install without using the repos version of libx264 if i try to install via synaptic
When you compile x264 it should create the same files that libx264 and libx264-dev would create. If you add "--prefix=/usr" to the x264 configure line then these files will also install in the same location as the repo versions instead of the default /usr/local/lib. I'm unsure how to get Synaptic or apt to recognize this. I'm out of town until July 4 and can't test anything until then.

vjktm
June 29th, 2008, 04:38 AM
Thanks a bundle for this clear & concise set of instructions. Both installed perfectly. Only one question, bash can't find ffmpeg and x264, they are installed inside my home directory. What do I do to get them to run from bash with: ffmpeg?
Thanks.

TArozzelle
June 29th, 2008, 10:12 AM
./configure returns this error when I try to compile.


cc1: out of memory allocating 248 bytes after a total of 16900096 bytes
make: *** [libavcodec/motion_est.o] Error 1


Any thoughts?

Thanks!

FakeOutdoorsman
June 30th, 2008, 07:30 AM
Thanks a bundle for this clear & concise set of instructions. Both installed perfectly. Only one question, bash can't find ffmpeg and x264, they are installed inside my home directory. What do I do to get them to run from bash with: ffmpeg?
Thanks.
What version of Ubuntu are you using? Do you have a modified .bashrc file? What are the outputs of "whereis ffmpeg" and "whereis x264"?

FakeOutdoorsman
June 30th, 2008, 07:30 AM
./configure returns this error when I try to compile.


cc1: out of memory allocating 248 bytes after a total of 16900096 bytes
make: *** [libavcodec/motion_est.o] Error 1


Any thoughts?

Thanks!
I haven't encountered this error before. Are you compiling within a virtual machine? My guess is you don't have enough RAM and/or swap, or the particular version of ffmpeg you are trying to compile has a bug.

What is the output of the "free" command? Also show the output of "cat /proc/meminfo".

Leefmc
July 6th, 2008, 12:49 PM
Great tutorial!

I got it all working i believe, but i've got two questions:

1.) I've been trying many different combinations, but so far i have had no luck in creating a quicktime compatible x264. Any thoughts on how to do this? To my knowledge, the simple fact is that QuickTime doesn't support much of the features available to H264. So far i've had no real luck, but i have managed to turn a 10mb ogg into a 50mb mov.

2.) On the same note as #1, i've been making a friend suffer through testing my mov's on his windows box, since i dont have one heh. Anyone know of a good way to test QuickTime compatibility without being able to run.. quicktime?

3.) Lastly, FFMPEG from the repos will come with a "qt-faststart" command. Any idea how to build/download that functionality without replacing the FFMPEG build done via this tutorial?



Thanks!

FakeOutdoorsman
July 7th, 2008, 03:32 AM
1.) I've been trying many different combinations, but so far i have had no luck in creating a quicktime compatible x264. Any thoughts on how to do this? To my knowledge, the simple fact is that QuickTime doesn't support much of the features available to H264. So far i've had no real luck, but i have managed to turn a 10mb ogg into a 50mb mov.
I just tested my example script from this tutorial and the resulting mp4 file worked in Quicktime 7.5. What ffmpeg command are you using? Are you using the latest Quicktime? Some people use MP4Box (part of the gpac package) to help create iTunes/iPod compatible files after using ffmpeg to encode:

MP4Box -add video.mp4 video.mp4
Another option, added in March and untested by me, is "-f ipod":

ffmpeg -i inputvideo.avi -f ipod outputvideo.mp4

2.) On the same note as #1, i've been making a friend suffer through testing my mov's on his windows box, since i dont have one heh. Anyone know of a good way to test QuickTime compatibility without being able to run.. quicktime?
I do my testing in a virtualized Windows session using VirtualBox (https://help.ubuntu.com/community/VirtualBox). It works well for me. I doubt Quicktime will run under Wine.

3.) Lastly, FFMPEG from the repos will come with a "qt-faststart" command. Any idea how to build/download that functionality without replacing the FFMPEG build done via this tutorial?
Yes. qt-faststart is also included in your ffmpeg folder that you made from this tutorial. Cut and pasted from ~/ffmpeg/tools/qt-faststart.c because I'm a bad paraphraser:

* This utility rearranges a Quicktime file such that the moov atom
* is in front of the data, thus facilitating network streaming.
*
* To compile this program, start from the base directory from which you
* are building FFmpeg and type:
* make tools/qt-faststart
* The qt-faststart program will be built in the tools/ directory. If you
* do not build the program in this manner, correct results are not
* guaranteed, particularly on 64-bit platforms.
* Invoke the program with:
* qt-faststart <infile.mov> <outfile.mov>

maxbear
July 8th, 2008, 08:29 PM
Thanks a lot for this useful guide. I use my ubuntu machine for file server and encoding purpose only. And you save me a lot of time.

By the way, if ubuntu asked me to update ffmpeg and x264, should I do it? I didn't do it.

FakeOutdoorsman
July 8th, 2008, 08:54 PM
Thanks a lot for this useful guide. I use my ubuntu machine for file server and encoding purpose only. And you save me a lot of time.

By the way, if ubuntu asked me to update ffmpeg and x264, should I do it? I didn't do it.
If you didn't give ffmpeg and x264 new names in checkinstall then your package management software will try to "update" it to the outdated version from the repository. You can either uninstall and then run checkinstall again using a new name (like ffmpeg-svn), or if you use aptitude you can try:

sudo aptitude hold ffmpeg

maxbear
July 9th, 2008, 01:31 AM
Thanks a lot. You are super!

Leefmc
July 10th, 2008, 05:00 AM
Ugh, im so bummed heh. I spent forever finding the right combinations of h264 settings and finally got everything right. Now i made the mistake of updating (apt-get update) and it just trashed my compiled ffmpeg junk. It was most likely just references, but none the less i eventually ended up starting over. Note that i did aptitude hold, but that didnt stop apt-get apparently.. what does it stop? Aptitude?

With all that said, now my new compile is not working right. Im getting errors when using ffmpeg:


*** glibc detected *** ffmpeg: free(): invalid pointer: 0x08757158 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0xb7b5fa85]
/lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0xb7b634f0]
ffmpeg(av_set_string2+0x8fb)[0x80eff9b]
======= Memory map: ========
08048000-08509000 r-xp 00000000 08:02 108607 /usr/local/bin/ffmpeg
08509000-08513000 rw-p 004c0000 08:02 108607 /usr/local/bin/ffmpeg

The only thing i did different this time is during checkinstall, i used custom names for ffmpeg, x264, and yasm, hoping that it would no longer be beat to death by apt-get.

Any thoughts onto whats wrong?

FakeOutdoorsman
July 10th, 2008, 06:43 AM
Note that i did aptitude hold, but that didnt stop apt-get apparently.. what does it stop? Aptitude?
I haven't used apt-get for a few years so I'm unsure if it has an equivalent of aptitude's "hold". I should have mentioned that hold probably would not stop apt-get and Synaptic.

With all that said, now my new compile is not working right. Im getting errors when using ffmpeg:


*** glibc detected *** ffmpeg: free(): invalid pointer: 0x08757158 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0xb7b5fa85]
/lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0xb7b634f0]
ffmpeg(av_set_string2+0x8fb)[0x80eff9b]
======= Memory map: ========
08048000-08509000 r-xp 00000000 08:02 108607 /usr/local/bin/ffmpeg
08509000-08513000 rw-p 004c0000 08:02 108607 /usr/local/bin/ffmpeg


What is the ffmpeg command that you are using to get this error? I've never encountered this error, but I would like to try to reproduce it. My guess is that there may be a mess of several ffmpeg/x264 installs (or residual files) screwing each other up. Use you package manager to completely remove all installed yasm, x264, and ffmpeg. Now you can either:

cd ~/yasm
make distclean
./configure, make, checkinstall
cd ~/x264
make distclean
git pull
./configure, make, checkinstall
sudo ldconfig
cd ~/ffmpeg
make distclean
svn update
./configure, etc
or delete the yasm, ffmpeg and x264 directories and start the tutorial over.

Leefmc
July 10th, 2008, 10:57 PM
or delete the yasm, ffmpeg and x264 directories and start the tutorial over.

I actually have, many times. I tried custom names, same error. Note that when i used custom names, upon removal, i made sure to sudo aptitude purge the names i gave them (and even the normal names, x264 && ffmpeg)

Last night i tried compiling it 4 to 6 different ways, each time i fully purged, and deleted, all of the installs.

I am out of ideas. Thoughts?

(Note i'll post the command i tried when i get home, but also note that the command worked great on my previous compile.)

PGLGreg
July 10th, 2008, 11:52 PM
If you have an AMD 64-bit system, here is something I just stumbled on that might be useful. In compiling x264, the linker told me I should use "-fPIC" and recompile common/x86/cabac-a.o. But that .o file is assembled rather than compiled. So, hoping that the assembler (yasm) would understand, I started over and configured with:


./configure --prefix=/usr --libdir=/usr/lib64 \
--enable-gtk --enable-pthread --enable-visualize --enable-pic --enable-shared \
--enable-mp4-output \
--extra-asflags="-fPIC" \
--extra-cflags="-O4 -march=k8 -mtune=k8 -pipe -ffast-math -fomit-frame-pointer"

That seems to have worked.

FakeOutdoorsman
July 11th, 2008, 12:20 AM
I am out of ideas. Thoughts?
I suggest posting this problem to the ffmpeg-user mailing list (https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user/). They are much more knowledgeable than I am with ffmpeg, but be sure to read the posting guidelines (http://ffmpeg.mplayerhq.hu/mailinglists.html) (first paragraph) or they may ignore or flame you if you don't follow their strict protocol. Also, this is unstated in their rules, but if you subscribe to the digest mode and reply to it with a non-mime digest compatible mail client then they will flame you. Make sure to include both your full ffmpeg command and the ffmpeg output or they will flame you.

FakeOutdoorsman
July 11th, 2008, 12:31 AM
If you have an AMD 64-bit system, here is something I just stumbled on that might be useful. In compiling x264, the linker told me I should use "-fPIC" and recompile common/x86/cabac-a.o. But that .o file is assembled rather than compiled. So, hoping that the assembler (yasm) would understand, I started over and configured with:


./configure --prefix=/usr --libdir=/usr/lib64 \
--enable-gtk --enable-pthread --enable-visualize --enable-pic --enable-shared \
--enable-mp4-output \
--extra-asflags="-fPIC" \
--extra-cflags="-O4 -march=k8 -mtune=k8 -pipe -ffast-math -fomit-frame-pointer"

That seems to have worked.
Thanks, PGLGreg. I'll add a note to the tutorial.

Leefmc
July 11th, 2008, 01:56 AM
Ok, just got home. Seems this is my code:


ffmpeg -y -i $1 -pass 1 -threads 4 -s 1170x728 -vcodec libx264 -b 384k -bt 192k -f mp4 -flags +loop -cmp +chroma -partitions 0 -me_method epzs -subq 1 -trellis 0 -refs 1 -coder 0 -me_range 16 -g 300 -keyint_min 30 -sc_threshold 40 -i_qfactor 0.71 -maxrate 10M -bufsize 10M -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -an -r ntsc /dev/null
ffmpeg -y -i $1 -pass 2 -threads 4 -s 1170x728 -vcodec libx264 -b 384k -bt 192k -f mp4 -flags +loop -cmp +chroma -partitions +parti4x4+partp4x4+partp8x8+partb8x8 -me_method umh -subq 7 -trellis 2 -refs 1 -coder 0 -me_range 16 -g 300 -keyint_min 30 -sc_threshold 40 -i_qfactor 0.71 -maxrate 10M -bufsize 10M -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -acodec libfaac -ab 96k -ac 1 -r ntsc $2_temp.mp4

I forget where i got it from, but most of it is not by me. I tested a bunch, and eventually went with that one after tweaking it some to my liking. It produced good output, good filesize, and most of all it worked for QuickTime.

*edit*
Note that at the moment im taking random arguments from the commands and trying to make something work, to hopefully pinpoint the problem.

*edit2*
Best i can find, it seems this is the problem:

-rc_eq 'blurCplx^(1-qComp)'
If i remove that from the 2 commands, it runs. Im searching the ffmpeg docs to find out what rc_eq is.

*edit3*
Yea, seems it is a rate control equation. Not knowing encoding at all, how important is this? If i use the command "ffmpeg -rc_eq" i get the same error, so im guessing that specific command is corrupted or something? I compared an older videos size to the newly "no rc_eq" encoded one, and they seem to be the same size and quality, though i have not tested on quicktime yet (thats a bit of a pain when you dont have windows heh).

Thoughts?

PGLGreg
July 11th, 2008, 01:56 AM
cd ~/x264
git pull
make distclean


Generally, you should clean up before doing the pull, because the pull might change the configuration in a way that confuses make and prevents it from doing the distclean correctly.


cd ~/x264
make distclean
git pull

Nullack
July 11th, 2008, 02:45 AM
If you have an AMD 64-bit system, here is something I just stumbled on that might be useful. In compiling x264, the linker told me I should use "-fPIC" and recompile common/x86/cabac-a.o. But that .o file is assembled rather than compiled. So, hoping that the assembler (yasm) would understand, I started over and configured with:


./configure --prefix=/usr --libdir=/usr/lib64 \
--enable-gtk --enable-pthread --enable-visualize --enable-pic --enable-shared \
--enable-mp4-output \
--extra-asflags="-fPIC" \
--extra-cflags="-O4 -march=k8 -mtune=k8 -pipe -ffast-math -fomit-frame-pointer"

That seems to have worked.

My understanding is that anything over -O3 in GCC just results in the compiler using 3.

I'm using -march=native on Intrepid, which is running well. I think native is a better setting.

PGLGreg
July 11th, 2008, 03:08 AM
My understanding is that anything over -O3 in GCC just results in the compiler using 3.

I'm using -march=native on Intrepid, which is running well. I think native is a better setting.
Yes, that's my understanding, also. So, one may as well use "-O4".

I use those compiler flags not because I think they're good, but because mplayer thinks they're good. That is, when I configured mplayer, it took a look at my system and decided those are the flags I should use. Me -- I dunno.

What's good about "-march=native"? What does it even mean?

FakeOutdoorsman
July 11th, 2008, 09:09 PM
*edit3*
Yea, seems it is a rate control equation.
I can confirm this error. I'm getting the same error but haven't found a reason or solution yet.

Nullack
July 12th, 2008, 12:50 AM
mtune and march as native just means gcc uses the best available for your specific cpu - your native setup.

Leefmc
July 12th, 2008, 02:29 AM
I can confirm this error. I'm getting the same error but haven't found a reason or solution yet.

Well im not even sure what im missing out on haha. I know very little about encoding videos (actually, i know just about all i want to heh ;)).

PGLGreg
July 12th, 2008, 05:31 AM
mtune and march as native just means gcc uses the best available for your specific cpu - your native setup.
How do you think gcc knows that, or even knows what cpu I have? If I had compiled gcc and tailored it to my own system, then it would know whatever I told it about that, and if I told it correctly, then it would know my cpu. I didn't actually compile my gcc -- it came with my distribution, and it knows I have an AMD 64-bit processor, but it doesn't know which one. I have to tell it, if I want optimal results.

I don't find any documentation of "-march=native" in "info gcc".

Nullack
July 12th, 2008, 06:18 AM
Have a look on the web, native is the optimal setting when your compiled binaries dont need to be run on anything else than your machine.

PGLGreg
July 12th, 2008, 08:00 AM
Have a look on the web, native is the optimal setting when your compiled binaries dont need to be run on anything else than your machine.
I did look. I learn that "-march=native" was introduced in gcc 4.2. I have only gcc 4.1.2 here, so it's no good to me personally, until I update. Still, very interesting.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=448370

Nullack
July 12th, 2008, 09:37 PM
Im on gcc 4.3.1 and have no problems with it. Mplayer now use mtune and march as native in mplayer / mencoder builds. Its super fast, much faster than VLC, Totem etcetc

FakeOutdoorsman
July 13th, 2008, 02:05 AM
FFmpeg does not support "-threads auto" as an option anymore. If your command or script gives you the following error when using "-threads auto", then use "-threads 0" (the integer zero, not a letter) instead:

Expected number for threads but found: auto
I'm unsure when this change was introduced.

Update from S. Sabatini on ffmpeg-user mailing list:

-threads auto never worked as you expected, "auto" was previously parsed by atoi() which returned "0", now it omplains if it can't recognize the argument as a number.

FakeOutdoorsman
July 13th, 2008, 09:52 PM
*edit3*
Yea, seems it is a rate control equation. Not knowing encoding at all, how important is this? If i use the command "ffmpeg -rc_eq" i get the same error, so im guessing that specific command is corrupted or something? I compared an older videos size to the newly "no rc_eq" encoded one, and they seem to be the same size and quality, though i have not tested on quicktime yet (thats a bit of a pain when you dont have windows heh).

Thoughts?
Looks like you found a bug in ffmpeg. I submitted this to the ffmpeg-user mailing list. You can follow it here:
rc_eq causes 'invalid pointer' error (http://comments.gmane.org/gmane.comp.video.ffmpeg.user/17424)

And the resulting patch that should be applied to svn soon:
[PATCH] Fix the ffmpeg -rc_eq "foo" bug (http://thread.gmane.org/20080713163609.GB10019@geppetto)

Also, I will not have internet acces for a week, so I can't reply until then.

Update: This error has been fixed in today's SVN.

maxbear
July 17th, 2008, 02:03 AM
I got one more question about ffmpeg on ubuntu. Just to see if there is anyone have any idea about this problem.

I am using a quad core (q9450) cpu. But ffmpeg only utilize 25% cpu usage. I already add "-threads 4" or even "-threads 8" in the command line. But I don't see any increase in speed.

I used to have over 200-250 fps in windows (320x240 video encoding). But I got only 100-150 fps in ubuntu (same video, same encoder setting.....).

seagull man
July 17th, 2008, 02:10 PM
absolute gold. thanks for the howto.

FakeOutdoorsman
July 21st, 2008, 04:12 AM
I got one more question about ffmpeg on ubuntu. Just to see if there is anyone have any idea about this problem.

I am using a quad core (q9450) cpu. But ffmpeg only utilize 25% cpu usage. I already add "-threads 4" or even "-threads 8" in the command line. But I don't see any increase in speed.

I used to have over 200-250 fps in windows (320x240 video encoding). But I got only 100-150 fps in ubuntu (same video, same encoder setting.....).
What is your ffmpeg command and the full ffmpeg ouput?

nowhere@cox.net
July 23rd, 2008, 11:25 PM
Hey guys, I'm not very knowledgeable on video encoding and such. Just having a look in synaptic I see
libx264-57
x264 video coding library
is the only x264 thing I have installed. If I mark it for removal, it takes a TON of stuff with it, including ffmpeg. So, it seems to me that the repo ffmpeg should have x264 already built in, yah? Why do I need to recompile it?

I am trying to convert avi's encoded with xvid into something my iPhone will play but without luck so far. I have avidemux installed but using the ipod preset just gives an error
Encoder initialization failed

Not activated.

Is this related to this x264 thing this HowTo is addressing?

Thanks,
Eric

FakeOutdoorsman
July 24th, 2008, 08:53 PM
Hey guys, I'm not very knowledgeable on video encoding and such. Just having a look in synaptic I see
is the only x264 thing I have installed. If I mark it for removal, it takes a TON of stuff with it, including ffmpeg. So, it seems to me that the repo ffmpeg should have x264 already built in, yah?
The repo ffmpeg does not support restricted formats due to legal reasons and has not been configured to support h264 encoding. You have to use a different repo or compile ffmpeg yourself to encode to ipod compatible formats if you want to use ffmpeg.

Why do I need to recompile it?
You don't need to recompile it. I'm not familiar with avidemux, but I believe it uses a built in version of the ffmpeg libavcodec library, so you don't need to install ffmpeg to use avidemux.

I am trying to convert avi's encoded with xvid into something my iPhone will play but without luck so far. I have avidemux installed but using the ipod preset just gives an error

Is this related to this x264 thing this HowTo is addressing?

Thanks,
Eric
You are encoding to XVID so x264 is not even being called by avidemux, so the problem probably isn't with x264. I suggest running avidemux from the command-line to see additional errors that it may spit out in the terminal. You should also take a look at the Ubuntu Wiki page: Encoding Video for the iPod Video (https://help.ubuntu.com/community/iPodVideoEncoding).

mocha
July 29th, 2008, 08:48 AM
Using the compiled x264 I get


[libx264 @ 0x8466530]no ratecontrol method specified

when I try to encode something with ffmpeg. Was this a bug in x264 a few weeks ago, because that's when I built it. I went back to an ffmpeg not built with this newer version of the x264 libs.

EDIT: I had to uninstall the git x264 and ffmpeg, and then recompile ffmpeg with only the libx264 from the Ubuntu repository.

Another thing I noticed is that svn ffmpeg 14xxx won't compile with the Ubuntu libx264, only svn 13xxx will compile. I'm really confused with these x264 issues. I'm having the same problems with svn mplayer/mencoder.

I'm curious how a fresh checkout of x264 and ffmpeg are working for other folks. Do you get ratecontrol errors when you try to encode a video?

Regarding mplayer/mencoder, I cannot get it to complie with "--enable-x264".

Any comments would be appreciated. Thanks.

FakeOutdoorsman
July 29th, 2008, 07:19 PM
What FFmpeg command are you using and what s the full FFmpeg output? There was an issue with FFmpeg and the rate control option a few threads back and some people on the ffmpeg-user mailing list have the same error as you: Error: "no ratecontrol method specified" (http://comments.gmane.org/gmane.comp.video.ffmpeg.user/17574).

I compiled today's FFmpeg (r14466) and x264 (r920) and encoded a few videos without any problem using a simple command and a more complex one with "-rc_eq 'blurCplx^(1-qComp)'".

There was probably another bug with FFmpeg or the same one from earleir, and it looks like it's already been fixed, but I'd like to try your command to make sure I didn't miss anything.

I don't use libx264 from the stock Ubuntu repo, so I'm unsure why FFmpeg svn won't work with it anymore.

mocha
July 29th, 2008, 08:35 PM
When I get home later I'll post my ffmpeg command for you to try.

I found out that in additon to the 14xxx ffmpeg, the mplayer 27xxx will also not compile with libx264 support from the libx264 in the Ubuntu repository. I had to revert to an mplayer 26xxxx to get it to work.

In summary, I'm using the Ubuntu libx264, ffmpeg 13060, and mplayer 26672, both ffmpeg and mencoder have working x264 encoding with this version configuration.

If I have time later I'll pull the recent versions of x264, ffmpeg, mplayer and try everything again.

lunaz
July 30th, 2008, 02:46 AM
i'm trying to compile this and got stuck at configuring, i tried it a couple times with same error; tried google but dont know wot to search for.. 'not working' wont help ;p


luna@sux:~$ cd ffmpeg

luna@sux:~/ffmpeg$ ./configure --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264
FAAD test failed.
If you think configure made a mistake, make sure you are using the latest
version from SVN. If the latest version fails, report the problem to the
ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.err" produced by configure as this will help
solving the problem.

luna@sux:~/ffmpeg$ make
Makefile:1: config.mak: No such file or directory
libavdevice/Makefile:1: libavdevice/../config.mak: No such file or directory
libavformat/Makefile:1: libavformat/../config.mak: No such file or directory
libavcodec/Makefile:1: libavcodec/../config.mak: No such file or directory
libavutil/Makefile:1: libavutil/../config.mak: No such file or directory
> vhook/watermark.d
> vhook/null.d
> vhook/fish.d
> libavutil/tree.d
> libavutil/string.d
> libavutil/sha1.d
> libavutil/rc4.d
> libavutil/rational.d
> libavutil/random.d
> libavutil/mem.d
> libavutil/md5.d
> libavutil/mathematics.d
> libavutil/lzo.d
> libavutil/log.d
> libavutil/lls.d
> libavutil/intfloat_readwrite.d
> libavutil/fifo.d
> libavutil/des.d
> libavutil/crc.d
> libavutil/base64.d
> libavutil/aes.d
> libavutil/adler32.d
make: *** No rule to make target `libavutil/../config.mak'. Stop.

luna@sux:~/ffmpeg$ ./configure --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264
FAAD test failed.
If you think configure made a mistake, make sure you are using the latest
version from SVN. If the latest version fails, report the problem to the
ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.err" produced by configure as this will help
solving the problem.
luna@sux:~/ffmpeg$

FakeOutdoorsman
July 30th, 2008, 03:05 AM
Did you install "libfaad-dev"? The error message is saying that FFmpeg can't find the necessary files to build itself with support for FAAD. FAAD is a decoder (like a file reader) for AAC audio. If you're not planning on decoding AAC files or transcoding videos with AAC audio then you can remove "--enable-libfaad" from the FFmpeg configure line and "libfaad-dev" will not be needed.

lunaz
July 30th, 2008, 03:57 AM
i installed libfaad2-0 stuff from synaptic


luna@sux:~/ffmpeg$ ./configure --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad2-0 --enable-libfaac --enable-pthreads --enable-libx264
Unknown option "--enable-libfaad2-0".
See ./configure --help for available options.
luna@sux:~/ffmpeg$

i tried the above line w libfaad also, and w/o the option, still not working :( --disable libfaad doesn't do any diferent either.

do i have to start all over after installing libfaad2-0 packages?

mocha
July 30th, 2008, 01:43 PM
What FFmpeg command are you using and what s the full FFmpeg output?


Here is the command that was failing with "no ratecontrol method specified"


ffmpeg -threads 2 -i INPUT_FILE -vcodec libx264 -aspect 4:3 -flags +loop -cmp +chroma -deblockalpha 0 -deblockbeta 0 -b 1000k -maxrate 1250k -bufsize 4M -bt 256k -refs 1 -coder 0 -me umh -me_range 16 -subq 7 -partitions +parti4x4+parti8x8+partp8x8 -g 250 -keyint_min 25 -level 30 -qmin 10 -qmax 51 -qcomp 0.6 -trellis 2 -sc_threshold 40 -i_qfactor 0.71 -acodec libfaac -ac 2 OUTPUT_FILE

Can you give this a try with the latest x264 and ffmpeg? Thanks!

FakeOutdoorsman
July 30th, 2008, 08:09 PM
i installed libfaad2-0 stuff from synaptic


luna@sux:~/ffmpeg$ ./configure --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad2-0 --enable-libfaac --enable-pthreads --enable-libx264
Unknown option "--enable-libfaad2-0".
See ./configure --help for available options.
luna@sux:~/ffmpeg$

i tried the above line w libfaad also, and w/o the option, still not working :( --disable libfaad doesn't do any diferent either.

do i have to start all over after installing libfaad2-0 packages?
There is no ffmpeg configuration option called "--enable-libfaad2-0". You can see what configuration options are available with "./configure --help" when you are in your ffmpeg folder. You are getting this error because you told ffmpeg to compile with FAAD support, but ffmpeg thinks that the libfaad-dev package isn't installed or it can't find it for some reason. Try this:

sudo aptitude install libfaad-dev libfaac-dev liblame-dev
cd ~/ffmpeg
make distclean
./configure --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264
If you want to disable support for FAAD, then remove "--enable-libfaad" from your ffmpeg configuration line. I made a mistake when telling you to use "--disable-libfaad" because by default it is disabled according to "./configure --help".

FakeOutdoorsman
July 30th, 2008, 08:10 PM
Can you give this a try with the latest x264 and ffmpeg? Thanks!
I didn't get any errors. Works fine for me with yesterday's ffmpeg and x264. I bet the latest ffmpeg will work for you.

mocha
July 30th, 2008, 09:24 PM
I didn't get any errors. Works fine for me with yesterday's ffmpeg and x264. I bet the latest ffmpeg will work for you.

Thanks. I'll give it a shot.

lunaz
July 31st, 2008, 05:13 AM
i tried to install the packages but it couldn't be found :(

i did check if i had muli/universe repos enabled and i do (according to synaptic)


luna@sux:~$ sudo aptitude install libfaad-dev libfaac-dev liblame-dev
[sudo] password for luna:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done
Building tag database... Done
Couldn't find any package whose name or description matched "libfaad-dev"
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Writing extended state information... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done

FakeOutdoorsman
July 31st, 2008, 05:31 AM
i tried to install the packages but it couldn't be found :(

i did check if i had muli/universe repos enabled and i do (according to synaptic)
I should have noticed that your probably not running Hardy according to your signature. The package name for libfaad is different in Feisty. Try this:

sudo aptitude install libfaad2-dev

pedrogent
July 31st, 2008, 04:05 PM
Great HOWTO. Many thanks.

This may be a stupid question but why do we find these 'old' x264 builds in the repos? If there are constant improvements, then why aren't they added to the repos? Seems to make sense to me.

FakeOutdoorsman
July 31st, 2008, 07:04 PM
Thanks for the feedback. That's a good question. I think because Ubuntu is not a rolling release the package is only usually updated once per stable release. If there is a bad bug or someone files a backport then it may get updated. That's my guess.

lunaz
July 31st, 2008, 08:23 PM
actually, that computer is running gutsy. :) i don't update my sig enough i'll try that command when i get home :)


I should have noticed that your probably not running Hardy according to your signature. The package name for libfaad is different in Feisty. Try this:

sudo aptitude install libfaad2-dev

lunaz
August 1st, 2008, 01:41 AM
ok, i tried again & i definately have the libfaad2-dev pack installed, but i still cant do the configure thing even if i do --disable libfaad2-dev

FakeOutdoorsman
August 1st, 2008, 02:20 AM
What is the error you are getting? "--disable libfaad2-dev" is not an option since it is not listed in "./configure --help". By default ffmpeg will not compile with support for libfaad, so you don't even need to mention libfaad in your configuration options if you don't want it. You can see what configuration options are enabled or disabled by default with "./configure --help".

lunaz
August 1st, 2008, 06:06 AM
this is the step i got stuck at :)


cd ffmpeg
./configure --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264

this is the output i get


ERROR: x264 not found
If you think configure made a mistake, make sure you are using the latest
version from SVN. If the latest version fails, report the problem to the
ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.err" produced by configure as this will help
solving the problem.

wow this is a different error than i got last night... wow now i'm confused :P

FakeOutdoorsman
August 1st, 2008, 06:37 PM
This is a different error because you fixed the libfaad error. This error is telling you that you didn't install x264. Did you install x264 (step 4 from the tutorial)?

You might be better off installing ffmpeg from the Medibuntu (https://help.ubuntu.com/community/Medibuntu) repository since I haven't tested this tutorial on anything other than Hardy and because it seems to be giving you a lot of trouble.

flyakite
August 2nd, 2008, 07:24 PM
I didn't get any errors. Works fine for me with yesterday's ffmpeg and x264. I bet the latest ffmpeg will work for you.

I had the same no ratecontrol error from x264. I finally found the solution in Andrew's posting http://ubuntuforums.org/showthread.php?p=5482316: before compile x264 make sure you remove the libx264-dev ubuntu package!

sudo apt-get remove libx264-dev

Then follow this posting and it will work

Enjoy

FakeOutdoorsman
August 2nd, 2008, 08:19 PM
Thanks, flyakite. I'll update the tutorial.

mocha
August 3rd, 2008, 02:28 AM
I had the same no ratecontrol error from x264. I finally found the solution in Andrew's posting http://ubuntuforums.org/showthread.php?p=5482316: before compile x264 make sure you remove the libx264-dev ubuntu package!

sudo apt-get remove libx264-dev

Then follow this posting and it will work

Enjoy

Okay, I haven't tried it yet, but I'll keep that in mind. I have a theory that you don't need to remove the Ubuntu version cause the compiled version puts its libs in /usr/local/lib whereas the Ubuntu version has the libs in /usr/lib. And I would assume that when you complie ffmpeg and mplayer they look in /usr/local/lib first. But anyway, when I try it I'll post and let you know.

lunaz
August 3rd, 2008, 02:52 AM
ok i installed hardy on the laptop. got it running anyways, tried that script but it only successfully converted one video. the other froze up the terminal when it got back to prompt. then it said video size 48 bytes, and whatever player i have gave an error when i tried to play it.

i tried to upload the working mp4 to youtube but it looks craptastic :( http://www.youtube.com/watch?v=MjqVVQ0gq08

jcr1
August 4th, 2008, 03:43 PM
well after installing it all, when I go ffmpeg, I get file not found.

FakeOutdoorsman
August 4th, 2008, 08:47 PM
ok i installed hardy on the laptop. got it running anyways, tried that script but it only successfully converted one video. the other froze up the terminal when it got back to prompt. then it said video size 48 bytes, and whatever player i have gave an error when i tried to play it.

i tried to upload the working mp4 to youtube but it looks craptastic :( http://www.youtube.com/watch?v=MjqVVQ0gq08
What script did you use? Youtube will re-compress your video to a low bitrate, so it is best to use a high bitrate video when submitting to Youtube. If you used the example script from this tutorial, at least double the bitrate and change the audio to mono "-ac 1". Also, some screen recording software lets you zoom in or record only a certain area/window. This will make your screencast easier to read instead of recording and compressing your entire desktop.

FakeOutdoorsman
August 4th, 2008, 09:12 PM
well after installing it all, when I go ffmpeg, I get file not found.

frink@hedron:~$ whereis ffmpeg
ffmpeg: /usr/local/bin/ffmpeg
Do you get a similar output when you run "whereis ffmpeg"?

lunaz
August 7th, 2008, 02:44 AM
Ok i tried changing the -b option to 768 then 1200 on both passes.

all it does is make a 48byte file that doesnt work; and it freezes up the terminal. :( i was using that script in the tutorial first page.

the input files are both ogg files & tried using output mp4 and avi neither work.

mocha
August 7th, 2008, 05:29 AM
Ok i tried changing the -b option to 768 then 1200 on both passes.

all it does is make a 48byte file that doesnt work; and it freezes up the terminal. :( i was using that script in the tutorial first page.

the input files are both ogg files & tried using output mp4 and avi neither work.

You should take a look at WinFF. It's a frontend to ffmpeg. Don't install the one from the repository, get the deb from the author's website. It comes with tons of presets. Just make sure to point it at "/usr/local/bin/ffmpeg" in the preferences.

mocha
August 20th, 2008, 04:17 PM
Can someone give me a hand? Please do a fresh pull of x264 and ffmpeg, then try to encode any video with ffmpeg using libx264 and verify that you get a segmentation fault. It seems there is a new bug either in ffmpeg or x264. If you search google, there is 1 or 2 threads about this on the ffmpeg mailing list from August 2008. In one of the messages the ffmpeg dev says it 'probably' has something to do with x264.

Can someone also tell me the last SVN of ffmpeg that they successfully got working with x264? I temporairily went back to 13060 which was the last version I was using prior to rebuilding x264 and ffmpeg last night, but I'm sure there's probably a later version that will still work. Thanks.

FakeOutdoorsman
August 20th, 2008, 07:41 PM
What is the command that you used to get the segmentation fault? A patch has been released 6 1/2 hours ago regarding a rc_eq default value bug: [PATCH] Fix crash in libx264 when rc_eq is not set (http://thread.gmane.org/20080820120740.GA20314@geppetto). It will probably be applied to SVN, but I don't know how long that will take.

mocha
August 20th, 2008, 08:12 PM
What is the command that you used to get the segmentation fault? A patch has been released 6 1/2 hours ago regarding a rc_eq default value bug: [PATCH] Fix crash in libx264 when rc_eq is not set (http://thread.gmane.org/20080820120740.GA20314@geppetto). It will probably be applied to SVN, but I don't know how long that will take.

heheh.. Yep, the thread that patch refers to is the same one I was talking about. I don't specify a rc_eq in my command line. Well at least now I know the SVN number where this regression occurred. Thanks!

mocha
August 21st, 2008, 03:18 AM
What is the command that you used to get the segmentation fault? A patch has been released 6 1/2 hours ago regarding a rc_eq default value bug: [PATCH] Fix crash in libx264 when rc_eq is not set (http://thread.gmane.org/20080820120740.GA20314@geppetto). It will probably be applied to SVN, but I don't know how long that will take.

So I downloaded 14787 and compilied, and it doesn't have the seg fault problem. However, this version has a different issue. I use the following command line:


ffmpeg -threads 2 -i INPUT_FILE -vcodec libx264 -s 320x240 -aspect 4:3 -flags +loop -cmp +chroma -deblockalpha 0 -deblockbeta 0 -b 800k -maxrate 1250k -bufsize 4M -bt 256k -refs 1 -coder 0 -me umh -me_range 16 -subq 7 -partitions +parti4x4+parti8x8+partp8x8 -g 250 -keyint_min 25 -level 30 -qmin 10 -qmax 51 -qcomp 0.6 -trellis 2 -sc_threshold 40 -i_qfactor 0.71 -acodec libfaac -ac 2 -ab 128k OUTPUT_FILE

The 14787 version insists on only encoding at 150 kbits/s, if I remove the "-maxrate xxxx" then it encodes at the specified bitrate. Was this yet another change in ffmpeg? Version 13060 doesn't have any problems with the above command line.

FakeOutdoorsman
August 21st, 2008, 05:35 AM
I updated to 14872 and the latest x264. Your command seg faulted while converting a dv avi, but it worked when I added -rc_eq 'blurCplx^(1-qComp)' and it encoded at the proper bitrate. I don't know if that's helpful since I updated to a different revision.

mocha
August 21st, 2008, 08:44 AM
I updated to 14872 and the latest x264. Your command seg faulted while converting a dv avi, but it worked when I added -rc_eq 'blurCplx^(1-qComp)' and it encoded at the proper bitrate. I don't know if that's helpful since I updated to a different revision.

Very nice! That works for me with the latest SVN. Care to inform us WTF that magic little command does and why/when it needs to be used?

FakeOutdoorsman
August 21st, 2008, 06:23 PM
This is the rate control equation for x264. I don't understand what the equation itself means, but there have been several ffmpeg bugs lately if you include it (5 weeks ago) or don't include it (this bug). The equation is the recommended default for x264, but for some reason ffmpeg doesn't use it by default so it has to be declared.

mocha
August 21st, 2008, 07:42 PM
Ok, well that all kind of makes sense now regarding my original problem with the seg fault. At least I'm up and running with a new version of ffmpeg. Thanks for the help.

jiexi
August 24th, 2008, 06:05 PM
What command would output the highest quality x264/aac mp4 possible in a single pass encode? file size isnt too a big issue to me, but if you could explain what each variable did would be nice also

jiexi
August 24th, 2008, 06:26 PM
What command would output the highest quality x264/aac mp4 possible in a single pass encode? file size isnt too a big issue to me, but if you could explain what each variable did would be nice also

FakeOutdoorsman
August 24th, 2008, 08:43 PM
I have little experience with one-pass x264 encoding, but you have two major choices to make. You can either encode using Constant Rate Factor (CRF) or by bitrate. Here's two examples that are what I think would be good for one-pass, but I didn't test them.

CRF:

ffmpeg -i input -crf 16 -threads 0 -vcodec libx264 -refs 6 -subq 6 -flags +loop -cmp +chroma -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -flags2 +brdo+dct8x8+wpred+bpyramid+mixed_refs -me_method umh -trellis 1 -bf 16 -directpred 3 -b_strategy 1 -bidir_refine 1 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -vframes 200 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 output.mp4
Using the above code will make a high-quality encode but it will also be very slow.

Bitrate:

ffmpeg -i input -threads 0 -b 800k -bt 800k -vcodec libx264 -refs 6 -subq 6 -flags +loop -cmp +chroma -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -flags2 +brdo+dct8x8+wpred+bpyramid+mixed_refs -me_method umh -trellis 1 -bf 16 -directpred 3 -b_strategy 1 -bidir_refine 1 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -vframes 200 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 ouput.mp4

Most important settings to mess with are crf, b, bt, refs, and subq. If you want to learn what each parameter does:
FFmpeg x264 encoding guide (http://rob.opendot.cl/index.php/useful-stuff/ffmpeg-x264-encoding-guide/) (more and probably better examples)
FFmpeg x264 mapping (http://ffmpeg.x264.googlepages.com/mapping)
x264 Settings (http://mewiki.project357.com/wiki/X264_Settings)
Encoding with the x264 codec (http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-x264.html) (for mencoder, but still useful)

jiexi
August 24th, 2008, 09:40 PM
what do u recommend, crf or bitrate?
and what is the point of 2 pass encoding?
i mean cant everthing be done in 1 pass? lol srry im new to this.

thanks :)

FakeOutdoorsman
August 24th, 2008, 10:51 PM
what do u recommend, crf or bitrate?
I would experiment with both and see which is faster and/or better quality. You can add "-vframes 300" to encode just 300 frames (or whatever number you want) to test. You can also add "-psnr" which will output the Peak Signal to Noise Ratio. Higher is better: look at the "global" value. You can time the encode by using the time command like "time ffmpeg".

and what is the point of 2 pass encoding?
"Encoding with the x264 codec" linked in my previous post will explain this better than me.

MichaelBailey
August 25th, 2008, 05:28 AM
Can someone give me a hand? Please do a fresh pull of x264 and ffmpeg, then try to encode any video with ffmpeg using libx264 and verify that you get a segmentation fault. It seems there is a new bug either in ffmpeg or x264. If you search google, there is 1 or 2 threads about this on the ffmpeg mailing list from August 2008. In one of the messages the ffmpeg dev says it 'probably' has something to do with x264.

Can someone also tell me the last SVN of ffmpeg that they successfully got working with x264? I temporairily went back to 13060 which was the last version I was using prior to rebuilding x264 and ffmpeg last night, but I'm sure there's probably a later version that will still work. Thanks.

I have the latest version of everything and I can verify the segmentation fault takes place with
-vcodec libx264

MichaelBailey
August 25th, 2008, 05:29 AM
Can someone give me a hand? Please do a fresh pull of x264 and ffmpeg, then try to encode any video with ffmpeg using libx264 and verify that you get a segmentation fault. It seems there is a new bug either in ffmpeg or x264. If you search google, there is 1 or 2 threads about this on the ffmpeg mailing list from August 2008. In one of the messages the ffmpeg dev says it 'probably' has something to do with x264.

Can someone also tell me the last SVN of ffmpeg that they successfully got working with x264? I temporairily went back to 13060 which was the last version I was using prior to rebuilding x264 and ffmpeg last night, but I'm sure there's probably a later version that will still work. Thanks.

Does 13060 work with -vcodec libx264 ?

jiexi
August 25th, 2008, 05:44 AM
since 2 pass gives higher quality even tho it takes more time
i think i figured out how to include a 2 pass with the video sharing script i am using. so if you would be so kind, please give me a 2 pass code for the crf way u showed in ur great example.
btw, for some reason i cant seek in the 8 second videos that are created with both the bitrate and crf examples u gave. nor does qt-faststart work with them. well it seems to me as if that is the issue, or maybe its because the files are only 8 seconds.

Thanks again! :D

EDIT: nvm, ur examples dont mess with qtfaststart.

FakeOutdoorsman
August 25th, 2008, 08:37 PM
please give me a 2 pass code for the crf way u showed in ur great example.
I dont think CRF is used for two-pass very often. There is a good two-pass example at FFmpeg x264 encoding guide (http://rob.opendot.cl/index.php/useful-stuff/ffmpeg-x264-encoding-guide/).

btw, for some reason i cant seek in the 8 second videos that are created with both the bitrate and crf examples u gave.
I believe seeking is related to the keyframe interval or length of the Group of Pictures (GOP), which in your case was "-g 250" frames, or 8.3 seconds which is larger than your whole video.

jiexi
August 26th, 2008, 03:13 AM
I dont think CRF is used for two-pass very often. There is a good two-pass example at FFmpeg x264 encoding guide (http://rob.opendot.cl/index.php/useful-stuff/ffmpeg-x264-encoding-guide/).

I believe seeking is related to the keyframe interval or length of the Group of Pictures (GOP), which in your case was "-g 250" frames, or 8.3 seconds which is larger than your whole video.

Thanks for your help!

eoalvarez
August 26th, 2008, 11:46 AM
Stuck on trying to code an mpg to mpg4 using the ffmpeg and x264, this is what I am getting.....

ouicho@Atalanta:~$ ffmpeg -i /home/ouicho/Desktop/56-form-chensi.mpg -crf 16 -threads 0 -vcodec libx264 -refs 6 -subq 6 -flags +loop -cmp +chroma -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -flags2 +brdo+dct8x8+wpred+bpyramid+mixed_refs -me_method umh -trellis 1 -bf 16 -directpred 3 -b_strategy 1 -bidir_refine 1 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -vframes 200 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 output.mp4

FFmpeg version SVN-r14974, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --enable-nonfree
libavutil 49.10. 0 / 49.10. 0
libavcodec 51.69. 0 / 51.69. 0
libavformat 52.21. 0 / 52.21. 0
libavdevice 52. 1. 0 / 52. 1. 0
built on Aug 26 2008 18:18:19, gcc: 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
Input #0, mpeg, from '/home/ouicho/Desktop/56-form-chensi.mpg':
Duration: 00:05:40.96, start: 0.213333, bitrate: 614 kb/s
Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 320x240 [PAR 1:1 DAR 4:3], 104857 kb/s, 30.00 tb(r)
Stream #0.1[0x1c0]: Audio: mp2, 32000 Hz, mono, s16, 32 kb/s
Warning: not compiled with thread support, using thread emulation
Unknown encoder 'libx264'

FakeOutdoorsman
August 26th, 2008, 06:11 PM
Stuck on trying to code an mpg to mpg4 using the ffmpeg and x264, this is what I am getting
Did you follow this tutorial to install ffmpeg? Your version of ffmpeg has only been configured with "--enable-nonfree". You will have to remove ffmpeg, make distclean, reconfigure, and then reinstall. Refer to "Updating Your Installation" from the first post of this thread.

vector
September 4th, 2008, 08:57 AM
Man my head hurts...when is this going to "just work".. I went to a mates place who had windows. I installed winFF and he was transcoding things b4 I drunk my thankyou beer.. and yet here on my hardy heron, the home of linux box, I still cant do that because of the building and making and what ifs and stuff that have to be done and which I dont understand... Why is this not part of the standard ubuntu build? Is it in the works to be done? or is there some techno reason.

FakeOutdoorsman
September 4th, 2008, 06:31 PM
Sometimes familirity of Windows can be viewed instead as being better or easier. Your friend was most likely using an older, precompiled, third-party version of ffmpeg that can come with the Windows version of WinFF.

The goal of this tutorial is creating a fully customized, bleeding-edge ffmpeg and x264 installation. As with all bleeding-edge applications, things may not always go smoothly without some extra work and would be at least as work intensive to do the same in Windows. The Ubuntu License Policy (http://www.ubuntu.com/community/ubuntustory/licensing) keeps Ubuntu from releasing software that might be restricted by copyrights and patents, so proprietary formats, such as mp3, will not always work without the user enabling it themselves (see Restricted Formats (https://help.ubuntu.com/community/RestrictedFormats)).

Getting WinFF and ffmpeg installed in Ubuntu is as easy as downloading the WinFF deb and using Synaptic, aptitude, or apt-get to install ffmpeg. Ubuntu's version of ffmpeg doesn't support restricted formats, so if you want to use those you need to either use a precompiled third-party version, such as the one from Medibuntu, or compile ffmpeg yourself.

mocha
September 5th, 2008, 08:36 PM
I think one of the nice things about Debian based distros is that it's fairly easy to get dependancies installed even when you are compiling a more bleeding edge version of something, like ffmpeg or mplayer/mencoder for example.

"sudo apt-get build-dep ffmpeg"

That should take care of the dependancies for core ffmpeg. When you do the ./configure xxxxx on it you will see which libraries you have and which you don't. For reference, I use the following config line.

./configure --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264 --enable-liba52 --enable-libdc1394 --enable-libgsm --enable-libxvid

You have to have installed the dev packages for these libs of course.

The Winblows version of WinFF is using a pre-compiled ffmpeg. A very old version as far as I know. SVN 9xxx I think.

Roderik
September 11th, 2008, 03:18 PM
I've created some hardy debs af x264, yasm and ffmpeg based on this thread, you can get them here: https://launchpad.net/~roderik/+archive

comradburk
September 15th, 2008, 07:38 AM
I've followed this tutorial up to the point of making ffmpeg, but I then proceed to get this error:

gcc -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/home/aburk/ffmpeg" -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -fasm -std=c99 -fomit-frame-pointer -pthread -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -O3 -fno-math-errno -c -o libavcodec/libx264.o libavcodec/libx264.c
libavcodec/libx264.c: In function ‘X264_init’:
libavcodec/libx264.c:165: error: ‘x264_param_t’ has no member named ‘b_bframe_adaptive’
make: *** [libavcodec/libx264.o] Error 1


The checkinstall installation results displays the same error message. I searched around but haven't come to any conclusions regarding what might be wrong and I have no idea where to start looking with this...I tried to remove and reinstall the x264 package but that didn't seem to make a difference. Any ideas?

davidw89
September 15th, 2008, 04:03 PM
4. Get the most current source files from the official x264 git repository, compile, and install. You can run "./configure --help" to see what features you can enable/disable. If you are behind a firewall or unable to use git, then daily source tarballs are also available.
Code:

cd ~/
git clone git://git.videolan.org/x264.git
cd x264
./configure --enable-pthread --enable-mp4-output --enable-shared
make
sudo checkinstall



please help me i am stuck!!

david@david-desktop:~$ git clone git://git.videolan.org/x264.git
Initialized empty Git repository in /home/david/x264/.git/
git.videolan.org[0: 91.121.111.144]: errno=Connection refused
fatal: unable to connect a socket (Connection refused)
fetch-pack from 'git://git.videolan.org/x264.git' failed.

hugmenot
September 15th, 2008, 04:30 PM
please help me i am stuck!!

david@david-desktop:~$ git clone git://git.videolan.org/x264.git
Initialized empty Git repository in /home/david/x264/.git/
git.videolan.org[0: 91.121.111.144]: errno=Connection refused
fatal: unable to connect a socket (Connection refused)
fetch-pack from 'git://git.videolan.org/x264.git' failed.


Server possibly down. They made a release today and get hammered.

FakeOutdoorsman
September 15th, 2008, 07:35 PM
I've followed this tutorial up to the point of making ffmpeg, but I then proceed to get this error:

gcc -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/home/aburk/ffmpeg" -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -fasm -std=c99 -fomit-frame-pointer -pthread -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -O3 -fno-math-errno -c -o libavcodec/libx264.o libavcodec/libx264.c
libavcodec/libx264.c: In function ‘X264_init’:
libavcodec/libx264.c:165: error: ‘x264_param_t’ has no member named ‘b_bframe_adaptive’
make: *** [libavcodec/libx264.o] Error 1


The checkinstall installation results displays the same error message. I searched around but haven't come to any conclusions regarding what might be wrong and I have no idea where to start looking with this...I tried to remove and reinstall the x264 package but that didn't seem to make a difference. Any ideas?
You're not doing anything wrong. Since this is the bleeding-edge of ffmpeg and x264 there will be issues like this once in a while. The developers made a change which causes this error. I'm guessing there should be a fix within a day or two. You would just have to follow the "Updating Your Installation" section of this howto.

More info: [FFmpeg-devel] [PATCH] libx264: support for BUILD >= 63 (http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2008-September/053527.html)

FakeOutdoorsman
September 15th, 2008, 07:39 PM
please help me i am stuck!!

david@david-desktop:~$ git clone git://git.videolan.org/x264.git
Initialized empty Git repository in /home/david/x264/.git/
git.videolan.org[0: 91.121.111.144]: errno=Connection refused
fatal: unable to connect a socket (Connection refused)
fetch-pack from 'git://git.videolan.org/x264.git' failed.

I was able to connect and download the source with git with no problems. Perhaps there was a temporary network problem on their end or maybe your firewall is causing problems. You can always try to download a daily x264 source tarball (ftp://ftp.videolan.org/pub/videolan/x264/snapshots/) instead if git isn't working.

comradburk
September 15th, 2008, 07:47 PM
Alright, I got it working. I ended up just downloading a slightly older one from the daily source tarballs and it worked just fine :) Now I'm stoked...I can get this working :p Thanks!

davidw89
September 16th, 2008, 01:31 AM
I was able to connect and download the source with git with no problems. Perhaps there was a temporary network problem on their end or maybe your firewall is causing problems. You can always try to download a daily x264 source tarball (ftp://ftp.videolan.org/pub/videolan/x264/snapshots/) instead if git isn't working.

You're right, the network was down. It's working now.

Btw how do i optimize everything for quad core?(q6600) and auto upsize to 1680x1050 and enable all the features that makes the videos looks a lot better like sharpen, post processing etc?]
1 error:
make: *** [libavcodec/libx264.o] Error 1

FakeOutdoorsman
September 16th, 2008, 01:56 AM
You're right, the network was down. It's working now.

Btw how do i optimize everything for quad core?(q6600) and auto upsize to 1680x1050 and enable all the features that makes the videos looks a lot better like sharpen, post processing etc?]
If you're using x264 you can use the "-threads 0" option in your command to encode in parallel. Take a look at the "Additional Resources" section of the howto for examples and explanations.

1 error:
make: *** [libavcodec/libx264.o] Error 1
For this error, refer to post #99 (http://ubuntuforums.org/showpost.php?p=5794225&postcount=99) of this thread.

HolyRoses
September 18th, 2008, 05:11 PM
If you are updating to the newest ffmpeg you currently need to update your x264 also.

http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2008-September/053527.html

If you don't you will get this:

libavcodec/libx264.c: In function `X264_init':
libavcodec/libx264.c:165: error: structure has no member named `i_bframe_adaptive'
make: *** [libavcodec/libx264.o] Error 1


-HR

HolyRoses
September 18th, 2008, 05:13 PM
The developers have also checked in some x264 presets you might want to check out in the newest source code.

ls -l ffmpeg/ffpresets/
total 20
-rw-r--r-- 1 root root 235 Sep 18 11:53 libx264-default.ffpreset
-rw-r--r-- 1 root root 314 Sep 18 11:53 libx264-fastfirstpass.ffpreset
-rw-r--r-- 1 root root 311 Sep 18 11:53 libx264-hq.ffpreset
-rw-r--r-- 1 root root 322 Sep 18 11:53 libx264-max.ffpreset
-rw-r--r-- 1 root root 295 Sep 18 11:53 libx264-normal.ffpreset


-HR

FakeOutdoorsman
September 18th, 2008, 07:03 PM
Thanks for pointing out the presets, HolyRoses.

If you dump them into ~/.ffmpeg/ then you can use them as follows:
ffmpeg -i infile -vcodec libx264 -vpre hq -b 1M -bt 1M -threads 0 outfile.mp4
From FFmpeg libx264 presets (http://rob.opendot.cl/index.php/2008/09/17/ffmpeg-libx264-presets/) by Robert Swain. The link has more info and preset descriptions. You can edit the -b (bitrate) and -bt (bitrate tolerance) values from the example above to suit your needs.

HolyRoses
September 19th, 2008, 06:11 PM
I think they are the exact same preset files actually.

Looks like he just copied superdumps checkin's.

Oh, I see now, he just shows you how to use them. The defaults file dont set any bitrates, they just set encoding parameters. I wasn't aware how to actually use them.

-HR

HolyRoses
September 19th, 2008, 06:31 PM
I also think that -rc_eq 'blurCplx(1-qComp)' is hard coded into x264 now.

-HR

mikko.ohtamaa
September 22nd, 2008, 08:53 PM
FFMPEG trunk is not stable, please use revision 15261.

http://ffmpeg.mplayerhq.hu/

mikko.ohtamaa
September 22nd, 2008, 09:05 PM
If you are updating to the newest ffmpeg you currently need to update your x264 also.

http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2008-September/053527.html

If you don't you will get this:

libavcodec/libx264.c: In function `X264_init':
libavcodec/libx264.c:165: error: structure has no member named `i_bframe_adaptive'
make: *** [libavcodec/libx264.o] Error 1

-HR

To apply patch:



~/ffmpeg$ wget http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080915/f69a09a0/attachment.patch

~/ffmpeg$ patch -p0 attachment.patch

mikko.ohtamaa
September 22nd, 2008, 09:23 PM
After compiling and installing ffmpeg, it tries to use wrong libavcodec



moo@rousku:~/ffmpeg$ ./ffmpeg
./ffmpeg: symbol lookup error: ./ffmpeg: undefined symbol: av_tree_node_size
moo@rousku:~/ffmpeg$ sudo ldconfig
moo@rousku:~/ffmpeg$ ldd ffmpeg
linux-gate.so.1 => (0xb7f70000)
libpostproc.so.51 => /usr/lib/libpostproc.so.51 (0xb7f52000)
libavutil.so.49 => /usr/lib/libavutil.so.49 (0xb7f48000)
libz.so.1 => /usr/lib/libz.so.1 (0xb7f32000)
libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7f0d000)
libfaac.so.0 => /usr/lib/libfaac.so.0 (0xb7efc000)
libfaad.so.0 => /usr/lib/libfaad.so.0 (0xb7ebe000)
libmp3lame.so.0 => /usr/lib/libmp3lame.so.0 (0xb7e29000)
libtheora.so.0 => /usr/lib/libtheora.so.0 (0xb7de2000)
libvorbisenc.so.2 => /usr/lib/libvorbisenc.so.2 (0xb7ce8000)
libvorbis.so.0 => /usr/lib/libvorbis.so.0 (0xb7cc0000)
libx264.so.57 => /usr/lib/libx264.so.57 (0xb7c35000)
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7c31000)
libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7c19000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7aca000)
/lib/ld-linux.so.2 (0xb7f71000)
libogg.so.0 => /usr/lib/libogg.so.0 (0xb7ac4000)
libX11.so.6 => /usr/lib/libX11.so.6 (0xb79dd000)
libxcb-xlib.so.0 => /usr/lib/libxcb-xlib.so.0 (0xb79db000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb79c3000)
libXau.so.6 => /usr/lib/libXau.so.6 (0xb79c0000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb79ba000)

mikko.ohtamaa
September 22nd, 2008, 11:10 PM
After compiling and installing ffmpeg, it tries to use wrong libavcodec



moo@rousku:~/ffmpeg$ ./ffmpeg
./ffmpeg: symbol lookup error: ./ffmpeg: undefined symbol: av_tree_node_size


I am also getting


Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 29.97 (30000/1001)
Input #0, asf, from 'WiredPussy - 2008-02-07 - Isis Love , Annie Cruz , Amber Rayne (5057).wmv':
Duration: 01:00:32.34, start: 3.000000, bitrate: 943 kb/s
Stream #0.0: Audio: wmav2, 48000 Hz, stereo, s16, 64 kb/s
Stream #0.1: Video: wmv3, yuv420p, 960x540, 856 kb/s, 29.97 tb(r)
Output #0, mp4, to 'test.mp4':
Stream #0.0: Video: libx264, yuv420p, 256x144, q=16-51, 300 kb/s, 29.97 tb(c)
Stream #0.1: Audio: libfaac, 48000 Hz, stereo, s16, 96 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Stream #0.0 -> #0.1
[libx264 @ 0x889da40]no ratecontrol method specified


Let's see if this helps


sudo apt-get remove libx264-dev # Make sure we don't have old x264 lying around
make clean
make
sudo checkinstall


Yay... it's encoding!

mikko.ohtamaa
September 23rd, 2008, 12:27 AM
Ok, got it working finally.

I created this little script to mass convert video files suitable for mobile viewing (Nokia N-Series):

http://blog.redinnovation.com/2008/09/23/how-to-encode-h264-video-files-for-nokia-series-60-standalone-playback/

piratec
September 25th, 2008, 05:24 AM
Hello! This is my adventure on Ubuntu 8.04:

1.- I uninstalled ffmpeg and x264 from synaptic. It also removed many programs that were dependencies (SMPlayer, mplayer, vlc, some gstreamer stuff etc) I took note of it and I did remove all.

2.- I followed this guide to update yasm, x264 and ffmpeg. Then I downloaded Avidemux from the autor's website http://fixounet.free.fr/avidemux/ and installed it.

3.- I did various encodings from AVI files to mp4 for a PSP, for IPOD and a Blackberry and they all work great! Even with subtitles, I just needed to search for a proper TTF font on the subtitles settings. (/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType/FreeSans.ttf works at 14 pts.

I later installed some stuff I wanted like SMPlayer and I'll wait more for vlc, SMPlayer is lighter and works great too (is a nicer gui to mplayer) Something I like of it it resumes the movie were you left after closing it.

But still, on the automatic updates keeps asking me to "downgrade" to the crippled versions of fmpeg and x264, the ones that CANNOT encode to PSP or IPOD because legal stuff I believe. I did try the "sudo aptitude hold ffmpeg x264" but it didn't work. So is just annoying to have it on red telling me all the time I need to "downgrade".

Has anyone else found a fix for this? I gloogled about it without any luck so far.

Anyway I just registered today to tell you thank you! My Avidemux works now :)

EDIT: I got it working, read my next post.

FakeOutdoorsman
September 25th, 2008, 06:33 PM
SMPlayer sounds interesting. Do you usually use aptitude, apt, or Synaptic? Each has it's own way of "locking" a program version and they don't always listen to each other, so if you lock something in aptitude it still might want to upgrade in apt and Synaptic. Although Synaptic and apt should work well together I think.

I can't test my Ubuntu install on locking packages because the VirtualBox package on Arch Linux is broken right now. Curses! I believe in Synaptic you choose the package, then "Package -> Lock Package". For apt, I suppose you could use apt pin (http://www.debian.org/doc/manuals/apt-howto/ch-apt-get.en.html), but shouldn't there be an easier way?

cbl016
September 26th, 2008, 07:58 PM
This is a great tutorial! I was wondering after installing yasm, x264 and ffmpeg, what is the preferred method of re-installing mplayer? When I try to compile and install from source I get the error found on post #96 (I haven't tried the patch yet, I'll have to try it when I get home). Is there any way to tell mplayer to use the libraries that ffmpeg installed instead of installing them again?

mocha
September 28th, 2008, 08:17 PM
This is a great tutorial! I was wondering after installing yasm, x264 and ffmpeg, what is the preferred method of re-installing mplayer? When I try to compile and install from source I get the error found on post #96 (I haven't tried the patch yet, I'll have to try it when I get home). Is there any way to tell mplayer to use the libraries that ffmpeg installed instead of installing them again?


I understand what you are talking about, I ran into a similar problem. I believe the issue is that x264 needs to be installed in /usr rather than /usr/local. Do a "make uninstall" on x264, ffmpeg, and mplayer/mencoder. Then try compiling/installing with the following config lines (assmuing you have all the correct dev libs for the codecs):


x264 config line

./configure --prefix=/usr --enable-pthread --enable-mp4-output --enable-shared --enable-gtk


ffmpeg config line

./configure --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264 --enable-liba52 --enable-libdc1394 --enable-libgsm --enable-libxvid


mplayer/mencoder config line

./configure --enable-gui --enable-menu --enable-xvmc

s_bahmani
September 28th, 2008, 08:29 PM
Hello! This is my adventure on Ubuntu 8.04:

1.- I uninstalled ffmpeg and x264 from synaptic. It also removed many programs that were dependencies (SMPlayer, mplayer, vlc, some gstreamer stuff etc) I took note of it and I did remove all.

2.- I followed this guide to update yasm, x264 and ffmpeg. Then I downloaded Avidemux from the autor's website http://fixounet.free.fr/avidemux/ and installed it.

3.- I did various encodings from AVI files to mp4 for a PSP, for IPOD and a Blackberry and they all work great! Even with subtitles, I just needed to search for a proper TTF font on the subtitles settings. (/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType/FreeSans.ttf works at 14 pts.

I later installed some stuff I wanted like SMPlayer and I'll wait more for vlc, SMPlayer is lighter and works great too (is a nicer gui to mplayer) Something I like of it it resumes the movie were you left after closing it.

But still, on the automatic updates keeps asking me to "downgrade" to the crippled versions of fmpeg and x264, the ones that CANNOT encode to PSP or IPOD because legal stuff I believe. I did try the "sudo aptitude hold ffmpeg x264" but it didn't work. So is just annoying to have it on red telling me all the time I need to "downgrade".

Has anyone else found a fix for this? I gloogled about it without any luck so far.

Anyway I just registered today to tell you thank you! My Avidemux works now

i do this but not work

FakeOutdoorsman
September 28th, 2008, 09:58 PM
This is a great tutorial! I was wondering after installing yasm, x264 and ffmpeg, what is the preferred method of re-installing mplayer? When I try to compile and install from source I get the error found on post #96 (I haven't tried the patch yet, I'll have to try it when I get home). Is there any way to tell mplayer to use the libraries that ffmpeg installed instead of installing them again?
I was able to install today's most recent x264 and ffmpeg 15451 without that error, but this is on a clean, up-to-date, standard installation of Ubuntu with the only additional packages being the ones needed for the tutorial. I think the patch has already been applied in ffmpeg SVN.

I was also able to install mplayer from the repo without it wanting to reinstall any ffmpeg libraries, but I only looked at the dependencies and didn't look into detail.

So, basically I'm no help. Have you tried again with the most recent x264 and ffmpeg? Make sure to refer to the "Updating Your Installation" section of the tutorial.

FakeOutdoorsman
September 28th, 2008, 09:59 PM
i do this but not work
What are you trying to do? What errors do you have?

mocha
September 29th, 2008, 01:04 AM
So, basically I'm no help. Have you tried again with the most recent x264 and ffmpeg? Make sure to refer to the "Updating Your Installation" section of the tutorial.

See my post a few posts up. I just compiled and installed x264, ffmpeg, and mplayer this morning using the config lines I posted. Everything is working fine here.

FYI. In the latest ffmpeg version the "-me" command line parameter has changed to "-me_method".

piratec
September 29th, 2008, 11:24 PM
SMPlayer sounds interesting. Do you usually use aptitude, apt, or Synaptic? Each has it's own way of "locking" a program version and they don't always listen to each other, so if you lock something in aptitude it still might want to upgrade in apt and Synaptic. Although Synaptic and apt should work well together I think.

Hey I got it working :) I was doing it wrong, what I did I put on hold all my updates, so my system was not upgrading properly.

I was a Gentoo freak, so I'm used to doing manual stuff. I used to "fine tune" my laptop to the point that all the system was running with the bleeding edge and all compiled for my processor and stuff. Well, I left Gentoo for server setups and changed to Ubuntu on my laptop after 5 years, because "it just works" is what I need. Well I see that some stuff you still need to do manually on Ubuntu. Well even on Mac OS X right? :)

Ok, I did the "Reverting Changes Made by This Tutorial" steps and deinstalled Avidemux again. My system was clean, and started this howto all over. When the Synaptic updates daemon told me there were "downgrades" for x264, ffmpeg and Avidemux, I opened synaptic (im using that) and I searched for each one of them, and blocked their versions. That did it.

I would advice you specify this "package blocking" as step #7 if you like, for Ubuntu newbies like me. For fixing the mess I did I had to "learn" to use Aptitude, because Synaptic stopped responding. It seems Aptitude is more powerful than Synaptic for some tasks. For not going into many details, just after doing this howto, go immediately to Synaptic, search for ffmpeg, x264, avidemux and avidemux-common, and block their versions.

Also, a good way to start this HOWTO is by removing first ffmpeg and x264 with all dependencies, any programs that might use them with Synaptic. If you are planning on using Avidemux, make sure you FIRST install mplayer or SMPlayer, which installs Mencoder and all utilities for Avidemux to use. If you want to "clean" it more, execute also the "Reverting Changes Made by This Tutorial" commands, and then start it for the beginning.

My laptop is working great now. This should just work on a Ubuntu 8.04 LTS by following the steps.

Thanks for sharing this howto.

FakeOutdoorsman
September 30th, 2008, 08:04 PM
Thanks for the suggestions. I'll update the tutorial this weekend.

vector
October 2nd, 2008, 01:49 PM
Many thanks for this I finally found the time and the "balls" to give this a go.

findings of a newbie scaredycat

step 1 'uninstall x264 and ffmpeg'.. ok Im assuming apt-get remove x264 etc is the same thing?

step 3 Yasm
"sudo checkinstall"
ok its asking me

sudo checkinstall

checkinstall 1.6.1, Copyright 2002 Felipe Eduardo Sanchez Diaz Duran
This software is released under the GNU GPL.


The package documentation directory ./doc-pak does not exist.
Should I create a default set of package docs? [y]: y

Preparing package documentation...OK

Please write a description for the package.
End your description with an empty line or EOF.

ummm Im lost? for the record I typed in yasmhelp
it created a deb file

Done. The new package has been installed and saved to

/home/mark/yasm-0.7.1/yasm_0.7.1-1_i386.deb

You can remove it from your system anytime using:

dpkg -r yasm


so what do I do now? i understand it as saying its installed so I guess I just go on to step 4

Step4- similar understanding

Step 6-the wheel falls off?
svn ffmpeg works untill...


Fetching external item into 'ffmpeg/libswscale'
svn: Unknown hostname 'svn.mplayerhq.hu'

and thuis the ./configure fails because libswscale is missing

at this point I go to bed
what to do next?

ahh but b4 i do i tried


git clone git://git.mplayerhq.hu/libswscale/

then ./configure.......etc

which worked up untill


libavcodec/libx264.c: In function ‘X264_init’:
libavcodec/libx264.c:230: error: ‘struct <anonymous>’ has no member named ‘b_bidir_me’
libavcodec/libx264.c:231: error: ‘struct <anonymous>’ has no member named ‘b_bframe_rdo’
make: *** [libavcodec/libx264.o] Error 1

now I am lost :(

zcold
October 2nd, 2008, 05:47 PM
Don't worry, I have come to the same thing. Its the latest svn so I think its just broken.

libx264.c
libavcodec/libx264.c: In function ‘X264_init’:
libavcodec/libx264.c:230: error: ‘struct <anonymous>’ has no member named ‘b_bidir_me’
libavcodec/libx264.c:231: error: ‘struct <anonymous>’ has no member named ‘b_bframe_rdo’
make: *** [libavcodec/libx264.o] Error 1

zcold
October 2nd, 2008, 06:25 PM
either ffmpeg libx264.c is borked or its the x264 thats broken, im going to try and use an earlier snapshot of x264 and try compiling ffmpeg again.

Dark Shikari
October 2nd, 2008, 06:52 PM
x264 updated its API (http://git.videolan.org/?p=x264.git;a=commitdiff;h=c89bc900a3bf0d4c4c728ad 378703970b4f14e18), ffmpeg hasn't updated its libx264.c to compensate. Either fix ffmpeg's libx264.c (patch is available on the ffmpeg-devel ML as "[FFmpeg-devel] [PATCH] Update ffmpeg for libx264 core 65"), bug Michael or mru repeatedly until he fixes it, just go there and drop the two problematic lines of C code yourself, or use a version of x264 before r996.

The way the API change affects the commandline options you should use is detailed here (http://forum.doom9.org/showthread.php?t=141569).

reikoshea
October 2nd, 2008, 07:07 PM
Link to the ML Thread.

http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2008-October/054199.html

zcold
October 2nd, 2008, 07:10 PM
Update...
removed my x254 install and grabbed the latest snapshot (as opposed to an earlier one, was updated last night) x264-snapshot-20081001. Compiled and installed x264 and then compiled latest svn ffmpeg... compiled fine and im encoding something as we speak. See how it goes.

ftp://ftp.videolan.org/pub/videolan/x264/snapshots/

Dark Shikari
October 2nd, 2008, 07:12 PM
FFMPEG trunk is not stable, please use revision 15261.

http://ffmpeg.mplayerhq.hu/ffmpeg won't work with x264 then, since I have frequently updated the x264 API recently, so I doubt older ffmpegs will work.

Also, the trunk of ffmpeg is perpetually stable; there is no separate "stable version", contrary to what Debian, Ubuntu, and most Linux distros seem to think sometimes ;)

(of course, this doesn't mean things don't break, it just means that there is nothing more stable than the main branch)

FakeOutdoorsman
October 2nd, 2008, 08:11 PM
step 1 'uninstall x264 and ffmpeg'.. ok Im assuming apt-get remove x264 etc is the same thing?
Yes. You may not have these installed, but if you do they should be uninstalled. You can use apt-get, Synaptic, or aptitude.



step 3 Yasm
"sudo checkinstall"
ok its asking me

sudo checkinstall

checkinstall 1.6.1, Copyright 2002 Felipe Eduardo Sanchez Diaz Duran
This software is released under the GNU GPL.


The package documentation directory ./doc-pak does not exist.
Should I create a default set of package docs? [y]: y

Preparing package documentation...OK

Please write a description for the package.
End your description with an empty line or EOF.

ummm Im lost? for the record I typed in yasmhelp
it created a deb file
You can make the description anything you want. It's just for your future reference.



Done. The new package has been installed and saved to

/home/mark/yasm-0.7.1/yasm_0.7.1-1_i386.deb

You can remove it from your system anytime using:

dpkg -r yasm


so what do I do now? i understand it as saying its installed so I guess I just go on to step 4
Checkinstall is telling you that it installed yasm and you now have the option to remove it later by using dpkg. Since you used checkinstall, you can also later remove yasm with apt-get/Synaptic, or aptitude--whichever you're comfortable with.



Step 6-the wheel falls off?
svn ffmpeg works untill...


Fetching external item into 'ffmpeg/libswscale'
svn: Unknown hostname 'svn.mplayerhq.hu'

and thuis the ./configure fails because libswscale is missing

at this point I go to bed
what to do next?

Looks like network problems.


ahh but b4 i do i tried


git clone git://git.mplayerhq.hu/libswscale/

then ./configure.......etc
Good thinking and it probably worked, but I would delete the ~/ffmpeg folder and try again due to the network issues from before. Once you delefe the ffmpeg folder start at:


cd ~/
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
It should attempt to download what it couldn't get earlier.


which worked up untill


libavcodec/libx264.c: In function ‘X264_init’:
libavcodec/libx264.c:230: error: ‘struct <anonymous>’ has no member named ‘b_bidir_me’
libavcodec/libx264.c:231: error: ‘struct <anonymous>’ has no member named ‘b_bframe_rdo’
make: *** [libavcodec/libx264.o] Error 1

now I am lost :(
Not your fault. Look at Dark Shikari's response above. Since this is the bleeding-edge, there will be problems once in awhile, but the x264 and ffmpeg developers are usually quick and get things fixed within a few days.

If you don't feel comfortable doing this you can use ffmpeg from the Medibuntu repository, but it's an older version and you can't customize it they way you want...and you won't learn as much/get as frustrated as doing it this way.

Dark Shikari
October 2nd, 2008, 08:37 PM
And ffmpeg's libx264.c has been updated with my patch, so no more issues.

vector
October 3rd, 2008, 09:15 AM
Many many thanks guys , that seems to have compiled this time.. now I just got get a handle on how ffmpeg works and try a few things out.

cheers

FakeOutdoorsman
October 3rd, 2008, 09:18 PM
Revised the howto:

Removed some extra packages
Removed unnecessary x264 compilation options
Revised the example script to use recommended settings (instead of being iPood-centric)
Added preset usage instructions

See the "Tutorial Updates" section for a few more details.

NeonRush
October 4th, 2008, 07:23 AM
Just compiled, but there's no ffplay. Where'd it go?

FakeOutdoorsman
October 4th, 2008, 07:38 PM
Just compiled, but there's no ffplay. Where'd it go?

You're missing libsdl1.2-dev. Install it, remove ffmpeg, "make distclean" in the ffmpeg folder, and then recompile.

sojyujai
October 6th, 2008, 02:17 PM
I'm trying to compile ffmpeg on intrepid beta.
I checked out yesterdays svn (revision 15572 I think) and tried the following .configure line:


./configure --prefix=/usr/local --disable-debug --enable-shared --enable-gpl --enable-postproc --enable-swscale --enable-pthreads --enable-x11grab --enable-liba52 --enable-libdc1394 --enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid

But I get the error:

Unknown option "--enable-liba52".


Any ideas why this might happen & how to fix it?
I do have liba52-0.7.4-dev installed.

I'm pretty sure I want liba52 enabled to give support for ac3 audio - is that correct?

Edit: there seems to be no mention of --enable-liba52 in the ./configure --help
Has it been removed from ffmpeg?

FakeOutdoorsman
October 6th, 2008, 06:13 PM
The "--enable-liba52" option has been removed because ffmpeg now has a native ac3 encoder. It's built in.

HolyRoses
October 8th, 2008, 04:12 AM
ffmpeg presets have been updated in SVN to reflect new x264 changes regarding subq modifications and removal of -flags2 +brdo and bidir_refine.

-HR

chriscross83
October 10th, 2008, 10:04 PM
Hi guys,

i just read the thread but i am so much desperate. My ffmpeg is not running with x264. It was running before but i liked to update the two packets but now i am suffering from a segmentation fault every time i am using -vcodec libx264.

I compiled at least 15 possible combinations of ffmpeg and x264. I am running debian 64 bit. Furthermore i checked several combinations of ffmpeg and x264 incl patching libx264.c with no result. Everytime i get a segmentation fault:
31736 segmentation fault. ffmpeg is working fine except libx264. Can somebody help me and give me the right revision combination of x264 and ffmpeg? That would be very nice!! It is so desperating because it worked before updating.

Greetings, Chris

FakeOutdoorsman
October 10th, 2008, 10:20 PM
I haven't tested the tutorial on Debian or anything 64-bit. I recommend asking for support through #ffmpeg IRC or the ffmpeg-user (http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user/) mailing list. You should always use the latest git x264 and svn ffmpeg, otherwise you will either be ignored or told to use the latest version. If you ask on the mailing list then include your full ffmpeg command, the full ffmpeg output, and make sure to read the posting rules (the first paragraph on the mailing list site). If you use IRC, use ffmpeg.pastebin.com (http://ffmpeg.pastebin.com/) to show the command and output.

I can try to help you debug, but you will have to remove all x264, libx264-dev, and ffmpeg installations and reinstall using the latest versions by following the tutorial. If that doesn't work then give me your full ffmpeg command and the full ffmpeg output.

davidlm
October 11th, 2008, 07:41 PM
I had the same problem to encode x264... with fatal segmentation..

With the post before a resolve the problem, i remove x264, ffmpeg and libx264-dev (i guess this is the problem) and i do the update steps on the first post...and i can encode in x264.

synthaxx
October 18th, 2008, 01:12 AM
While installing on intrepid, i ran into some problems.

First i had to make the /usr/local/lib/pkgconfig to get x264 installed.

Secondly I got an "ERROR: LAME not found" while configuring ffmpeg. The reason is that the lame dev package name has been changed, so make sure you do an "sudo apt-get install libmp3lame-dev"

Third problem i ran into was the checkinstall for ffmpeg. I don't know why but for some reason i had to make the direcories:
/usr/local/include/libpostproc
/usr/local/include/libavdevice
/usr/local/include/libavformat
/usr/local/include/libavcodec
/usr/local/include/libavutil
/usr/local/lib/vhook
(make sure you do a "sudo mkdir" for each of these)

After that it installed. So if you see the same problems maybe the above can help.

I'm going to test it out now, see if all my hacking worked.

FakeOutdoorsman
October 18th, 2008, 01:24 AM
Thanks for the update on Intrepid. I have not tested this howto on Intrepid yet, so any reports are useful.

synthaxx
October 19th, 2008, 04:33 PM
After battling some features that made my processor lock at 1 ghz, i was finally able to test it out, and it seems to have worked like a charm!

1080p h264 streams now play silky smooth on my X2 4600+. Thanks FakeOutdoorsman!
I watched Iron Man yesterday on my Sony 1271 CRT beamer with a couple of friends and we were blown away!

piratec
October 20th, 2008, 04:27 PM
Hey, I'm back again :)

Well after some weeks of nice encoding, I satisfied my thirst for knoledge. I have found that, in order to properly upgrade your system from time to time, you will need to revert all of this, because blocking this packages eventually will block also some new upgrades on other programs too.

this is not so bad, because when you do this howto again you will have the latest ffmpeg and x264, and of course your whole system will be up-to-date.

My Ubuntu 8.04 LTS has this nice feature for automatic updates a-la "ms-update", a nice thing that keeps my mom out of troubles on her new Dell Laptop, I actually moved myself from Gentoo because of it, it helps me focus on other things rather than having my system updated. I know it is a "newbie" feature, but any Gentoo lover would agree with me when I say that doing an emerge world is a real pain.

What I'm trying to say is IF you want to go through all of this howto also means you are not a newbie anymore. You are becoming 1337 at encoding. Don't expect things to be supereasy. Your automatic updates won't work so automatic anymore, unless you revert this. I ended up using aptitude instead of synaptic, because it is more powerful, but also a little bit more difficult to use. Even being a text-mode program you can still use the mouse with it, so its ok. aptitude could be as easy as pressing "u" (upgrade) and then "g" (go!) to upgrade all, but sometimes you will need to do more than that.

Anyways, I only wanted to share my experience after some weeks, and thank you again
FakeOutdoorsman. great job!

andrew.46
October 21st, 2008, 07:36 AM
Hi FakeOutdoorsman!

Just a quick question about a change to your configure line when compiling x264:


--enable-shared is not recommended by x264 devs

I was a little curious about the reason for this change? And BTW thanks for all the work you have obviously put into this guide :-).

Andrew

FakeOutdoorsman
October 21st, 2008, 08:18 AM
Good question. I asked this question too. Before I made the change I asked one of the x264 developers what they thought about the guide and that was one of the changes suggested. To paraphrase:

Enabling shared requires PIC on many systems and PIC is slower, especially for 64-bit. PIC used to be allowed on 32-bit also, but was removed because it was annoying and too many people were enabling it accidentally. There's no good reason to have it and the speed penalty is about 3-4 times as large. PIC is about 1% slower and 3-4% slower on 32-bit. In ffmpeg, the penalty is considerably higher than in x264. FFmpeg and others like mplayer can link statically, so shared isn't needed.

mrkofee
October 22nd, 2008, 02:19 PM
I just installed ffmpeg and x264 according to the first post, but ffmpeg always core-dumps:

$ ffmpeg -y -i infile.avi -f mp4 -title boston.legal.s04e05.hdtv.xvid -vcodec libx264 -level 21 -s 480x270 -r 24000/1001 -b 768k -bt 768k -bufsize 2000k -maxrate 768k -g 250 -coder 0 -threads 0 -acodec libfaac -ac 2 -ab 128k outfile.avi
FFmpeg version SVN-r15665, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 0. 0 / 52. 0. 0
libavformat 52.22. 1 / 52.22. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Oct 22 2008 15:10:26, gcc: 4.3.2
[NULL @ 0x197c830]Invalid and inefficient vfw-avi packed B frames detected

Seems stream 0 codec frame rate differs from container frame rate: 23.98 (65535/2733) -> 23.98 (2997003/125000)
Input #0, avi, from 'Videos/001tvshows/Boston Legal/boston.legal.s04e05.hdtv.xvid-xor.avi':
Duration: 00:42:07.08, start: 0.000000, bitrate: 1164 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 624x352 [PAR 1:1 DAR 39:22], 23.98 tb(r)
Stream #0.1: Audio: mp3, 48000 Hz, stereo, s16, 128 kb/s
Output #0, mp4, to 'Videos/001iPod/boston.legal.s04e05.hdtv.xvid-xor.avi':
Stream #0.0: Video: libx264, yuv420p, 480x270 [PAR 254:255 DAR 4064:2295], q=2-31, 768 kb/s, 23.98 tb(c)
Stream #0.1: Audio: libfaac, 48000 Hz, stereo, s16, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
[libx264 @ 0x197ea40]width or height not divisible by 16 (480x270), compression will suffer.
Segmentation fault (core dumped)

I found
[ 3726.365486] ffmpeg[15704]: segfault at 72c77775 ip 00007f94724f4690 sp 00007fff7c457ce8 error 4 in libc-2.8.90.so[7f9472472000+169000]
in dmesg. How can I fix this?

Thanks

FakeOutdoorsman
October 23rd, 2008, 08:59 PM
I just installed ffmpeg and x264 according to the first post, but ffmpeg always core-dumps:

...

I found
[ 3726.365486] ffmpeg[15704]: segfault at 72c77775 ip 00007f94724f4690 sp 00007fff7c457ce8 error 4 in libc-2.8.90.so[7f9472472000+169000]
in dmesg. How can I fix this?

Thanks
I tried to duplicate this using the same ffmpeg revision and your command, but I didn't get any error. I'm unsure what is causing it. You can ask the ffmpeg-user (http://ffmpeg.mplayerhq.hu/mailinglists.html) mailing list. Make sure to include the whole ffmpeg command and the full response. The dmesg message will help too. Make sure to use the latest ffmpeg revision, don't hijack threads, and don't top-post when replying or they might ignore your question.

calraith
October 24th, 2008, 02:55 AM
My own notes (mostly to myself, but here if anyone else can use them):

To get x264 to build as a shared library on 32-bit Hardy, I had to do the following in addition to the tutorial:

sudo aptitude install libgpac-dev
sudo ranlib /usr/lib/libgpac_static.a
sudo ldconfigThe configure arguments I used for x264 were as follows:

./configure --prefix=/usr \
--enable-pthread --enable-visualize --enable-shared --enable-mp4-output \
--extra-asflags="-fPIC" \
--extra-cflags="-O3 -march=k8 -mtune=k8 -pipe -ffast-math -fomit-frame-pointer"The --enable-avis-input option enables avisynth input on win32 only.

I also wanted xvid support in ffmpeg, so I installed libxvidcore4-dev:

sudo aptitude install libxvidcore4-dev
sudo ldconfigThe configure arguments I used for ffmpeg were as follows:

./configure --prefix=/usr \
--enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug \
--enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads \
--enable-libx264 --enable-libxvid \
--extra-cflags="-O3 -march=k8 -mtune=k8 -pipe -ffast-math -fomit-frame-pointer"

DocTauri
October 29th, 2008, 05:57 PM
Hopefully someone can help me here.

First off, thanks for the great tutorial, I got it compiled and working great (under Fedora 9). The problem I'm having now is this:

I have used Handbrake to convert my DVD library to .mp4 files. I want to use ffmpeg to convert some of these for use on my iPod. Some work just great, some though come back with this


[libxvid @ 0x8b417b0]Invalid pixel aspect ratio 0/1
Video encoding failed


Can anyone give me some more insight into what the cause of this is, and how I can work around it?

Thanks!
Doc

FakeOutdoorsman
October 29th, 2008, 06:14 PM
What is your ffmpeg command and the complete ffmpeg output?

DocTauri
October 29th, 2008, 07:14 PM
The command is:


ffmpeg -i 'age2.mp4' -f mp4 -vcodec libxvid -maxrate 1000 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec libfaac -s 320x176 -padtop 32 -padbottom 32 -ab 128000 -b 40000 'age2.ipod.mp4'


and the output is:


FFmpeg version SVN-r15735, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264 --enable-libxvid
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 1. 0 / 52. 1. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Oct 28 2008 15:57:13, gcc: 4.3.0 20080428 (Red Hat 4.3.0-8)

Seems stream 0 codec frame rate differs from container frame rate: 44100.00 (44100/1) -> 23.98 (24000/1001)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'age2.mp4':
Duration: 01:30:31.00, start: 0.000000, bitrate: 3618 kb/s
Stream #0.0(eng): Video: h264, yuv420p, 720x400, 23.98 tb(r)
Stream #0.1(eng): Audio: aac, 44100 Hz, stereo, s16
Output #0, mp4, to 'age2.ipod.mp4':
Stream #0.0(eng): Video: libxvid, yuv420p, 320x240, q=3-5, 40 kb/s, 23.98 tb(c)
Stream #0.1(eng): Audio: libfaac, 44100 Hz, stereo, s16, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
[libxvid @ 0x97fb7b0]Invalid pixel aspect ratio 0/1
Video encoding failed


Not knowing anything about ffmpeg, I used mp4ize -v mymovie.mp4 to generate the ffmpeg command. This is how the parameters were determined.

Thanks,
Doc

mocha
October 29th, 2008, 07:31 PM
What happens if you pass "-aspect 4:3" or whatever aspect you want in the ffmpeg command?

FakeOutdoorsman
October 29th, 2008, 07:36 PM
Those parameters may have worked with an older version of ffmpeg. I've never seen this error before (I never use xvid), but you can fix it by adding the aspect option, "-aspect 16:9" for example. Other options include 4:3, 1.3333, or 1.7777. Other changes you can make:

copy the audio stream instead of re-encoding it: -acodec copy
use a higher video bitrate, you're currently using 40k
use libx264 instead of libxvid
use two-pass encoding

Take a look at Robert Swain's iPod video guide (http://rob.opendot.cl/index.php/useful-stuff/ipod-video-guide/) for 768kbit/s 320×240 H.264 videos. The only difference I would make from Robert's settings is replacing the second pass with:

ffmpeg -i INPUT -acodec copy -pass 2 -s WIDTHxHEIGHT -vcodec libx264 -b BIT_RATE -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -flags2 +mixed_refs -me_method umh -subq 6 -trellis 1 -refs 5 -coder 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt BIT_RATE -maxrate 768k -bufsize 2M -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 13 -title SOME_TITLE -threads 0 OUTPUT.mp4
This way you're not re-encoding the audio because your source audio is probably already compatible. You'll also want to add "-threads 0" to both passes if you have a multicore or multithreaded CPU.

Looks like I'm the slow typer.

DocTauri
October 29th, 2008, 07:54 PM
snip

DocTauri
October 29th, 2008, 07:54 PM
The -aspect setting did it! Funny thing is, the original video is 720x400, which equates to an aspect ratio of 1.8, and if I do -aspect 1.8, it works without erroring!

I'll look at Robert Swain's iPod video guide this evening.

One other question... Why would I use 2 pass instead of 1 pass?

Thanks again!
Doc

FakeOutdoorsman
October 29th, 2008, 07:57 PM
One other question... Why would I use do 2 pass instead of 1 pass?
To generalize, use two-pass if you want your output to be a certain filesize. The encoder will adjust the quality to achieve this file size. Use single pass CRF (assuming you're using x264) if you care more about quality. The encoder will use a constant quality and the file size will be unknown.

I hardly ever use two-pass.

DocTauri
October 29th, 2008, 08:08 PM
Got it. I think if I were going to watch this on TV, I'd look towards the 2 pass, but on a iPod, single's probably great.

Thanks again.
Doc

billhung
October 30th, 2008, 06:26 AM
Hi,

I did what the #1 post said and got the latest x264 codec, but at the step where I need to configure ffmpeg (I got ffmpeg from svn like the post said). And I used x264 as the name instead of x265-git. I accepted all the default names.

I got this error:



billh@billaspire:~/temp/ffmpeg/x264/ffmpeg$ sudo ./configure --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264 --enable-nonfree
ERROR: libx264 version must be >= 0.65.
If you think configure made a mistake, make sure you are using the latest
version from SVN. If the latest version fails, report the problem to the
ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.err" produced by configure as this will help
solving the problem.
billh@billaspire:~/temp/ffmpeg/x264/ffmpeg$


By going to System -> Administration -> Synaptic Package Manager, I see x264 have "1:0.svn20080408-0.0ubuntu1" for both "Installed Version" and "Latest Version".

Any idea which step went wrong?

billhung
October 30th, 2008, 06:49 AM
ok, instead of sudo checkinstall suggested by the post, I did a simple sudo make install. That got me through.

However, I still couldn't encode in h264. This is my ffmpeg command that works on another computer, but not this computer with a fresh new install



billh@billaspire:~/temp/ffmpeg/ffmpeg$ nice -n 18 ./ffmpeg -y -i "/home/billh/Videos/input.avi" -r 29.97 -vcodec h264 -s 640x480 -aspect 4:3 -flags +loop -cmp +chroma -deblockalpha 0 -deblockbeta 0 -b 400kb -maxrate 1250k -bufsize 4M -bt 256k -refs 1 -coder 0 -subq 5 -partitions +parti4x4+parti8x8+partp8x8 -g 250 -keyint_min 25 -level 30 -qmin 10 -qmax 51 -qcomp 0.6 -trellis 2 -sc_threshold 40 -i_qfactor 0.71 -acodec aac -ab 64k -ar 48000 -ac 1 "/home/billh/Videos/output.mp4"
FFmpeg version SVN-r15746, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264 --enable-nonfree
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 1. 0 / 52. 1. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Oct 30 2008 13:37:51, gcc: 4.3.2

Seems stream 0 codec frame rate differs from container frame rate: 23.98 (65535/2733) -> 23.98 (2997003/125000)
Input #0, avi, from '/home/billh/Videos/input.avi':
Duration: 00:42:58.00, start: 0.000000, bitrate: 1141 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 624x352 [PAR 1:1 DAR 39:22], 23.98 tb(r)
Stream #0.1: Audio: mp3, 48000 Hz, stereo, s16, 128 kb/s
Unknown encoder 'h264'



On the other hand, I installed mencoder on Ubuntu 8.10 Intrepid, and h264 encoding was working fine with mencoder. However, mencoder has problem with the audio codec aac. So I want to make ffmpeg works.

Any idea how to solve this?

billhung
October 30th, 2008, 11:31 AM
ok, now I see the example used libx264, instead of h264.

I use h264 on another machine and it was working.

Anyhow, after changing ot libx264 and libfaac, ffmpeg complains about the bitrate and I eventually couldn't get it to work....

FakeOutdoorsman
October 30th, 2008, 08:27 PM
...
By going to System -> Administration -> Synaptic Package Manager, I see x264 have "1:0.svn20080408-0.0ubuntu1" for both "Installed Version" and "Latest Version".

Any idea which step went wrong?
I'm guessing you already had x264 and/or libx264-dev installed. When ffmpeg looked for libx264, it found your already installed version (not your compiled one) and complained that your x264 is too old.

ok, now I see the example used libx264, instead of h264.

I use h264 on another machine and it was working.
The other machine was using an older version of ffmpeg. Option and codec names can change between ffmpeg revisions, and in this case it used to be called h264 and is now called libx264.

Anyhow, after changing ot libx264 and libfaac, ffmpeg complains about the bitrate and I eventually couldn't get it to work....
I was able to get it to work fine with the following:

ffmpeg -y -i "/home/billh/Videos/input.avi" -r 29.97 -vcodec libx264 -s 640x480 -aspect 4:3 -flags +loop -cmp +chroma -deblockalpha 0 -deblockbeta 0 -b 400k -maxrate 1250k -bufsize 4M -bt 256k -refs 1 -coder 0 -subq 5 -partitions +parti4x4+parti8x8+partp8x8 -g 250 -keyint_min 25 -level 30 -qmin 10 -qmax 51 -qcomp 0.6 -trellis 2 -sc_threshold 40 -i_qfactor 0.71 -acodec libfaac -ab 64k -ar 48000 -ac 1 "/home/billh/Videos/output.mp4"


What is the complete output ffmpeg gives you when it complains about the bitrate?
What is the output of "ldd /usr/bin/ffmpeg"?

ercdvs
October 31st, 2008, 06:55 PM
Worked fairly well on Intrepid server ..

The only issue was x264 / ffmpeg failed on checkinstall with permission issues (i used sudo)

sudo make install was fine though

FakeOutdoorsman
October 31st, 2008, 07:38 PM
Worked fairly well on Intrepid server ..

The only issue was x264 / ffmpeg failed on checkinstall with permission issues (i used sudo)

sudo make install was fine though
For x264 on Intrepid I've found that using

./configure --prefix=/usr
will allow checkinstall to install x264 without any errors. I'm still working on ffmpeg. synthaxx mentioned that he had to create a bunch of folders (http://ubuntuforums.org/showpost.php?p=5985479&postcount=143) to get checkinstall to work with ffmpeg, but I haven't found an alternative solution yet.

Checkinstall ffmpeg errors for reference:

========================= Installation results ===========================
install -d "/usr/lib"
install -m 644 libpostproc/libpostproc.a "/usr/lib"
ranlib "/usr/lib/libpostproc.a"
install -d "/usr/lib"
install -m 644 libavdevice/libavdevice.a "/usr/lib"
ranlib "/usr/lib/libavdevice.a"
install -d "/usr/lib"
install -m 644 libavformat/libavformat.a "/usr/lib"
ranlib "/usr/lib/libavformat.a"
install -d "/usr/lib"
install -m 644 libavcodec/libavcodec.a "/usr/lib"
ranlib "/usr/lib/libavcodec.a"
install -d "/usr/lib"
install -m 644 libavutil/libavutil.a "/usr/lib"
ranlib "/usr/lib/libavutil.a"
install -d "/usr/include/libpostproc"
install: cannot change permissions of `/usr/include/libpostproc': No such file or directory
make: *** [install-headers] Error 1

**** Installation failed. Aborting package creation.

Using:

./configure --prefix=/usr --enable-gpl --enable-postproc --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264

flynch
October 31st, 2008, 09:40 PM
For x264 on Intrepid I've found that using

./configure --prefix=/usr
will allow checkinstall to install x264 without any errors. I'm still working on ffmpeg. synthaxx mentioned that he had to create a bunch of folders (http://ubuntuforums.org/showpost.php?p=5985479&postcount=143) to get checkinstall to work with ffmpeg, but I haven't found an alternative solution yet.

Checkinstall ffmpeg errors for reference:

========================= Installation results ===========================
install -d "/usr/lib"
install -m 644 libpostproc/libpostproc.a "/usr/lib"
ranlib "/usr/lib/libpostproc.a"
install -d "/usr/lib"
install -m 644 libavdevice/libavdevice.a "/usr/lib"
ranlib "/usr/lib/libavdevice.a"
install -d "/usr/lib"
install -m 644 libavformat/libavformat.a "/usr/lib"
ranlib "/usr/lib/libavformat.a"
install -d "/usr/lib"
install -m 644 libavcodec/libavcodec.a "/usr/lib"
ranlib "/usr/lib/libavcodec.a"
install -d "/usr/lib"
install -m 644 libavutil/libavutil.a "/usr/lib"
ranlib "/usr/lib/libavutil.a"
install -d "/usr/include/libpostproc"
install: cannot change permissions of `/usr/include/libpostproc': No such file or directory
make: *** [install-headers] Error 1

**** Installation failed. Aborting package creation.

Using:

./configure --prefix=/usr --enable-gpl --enable-postproc --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264


I worked around this by creating the following dirs and running checkinstall again:


sudo mkdir /usr/local/lib/pkgconfig
sudo mkdir /usr/include/libavdevice
sudo mkdir /usr/include/libavformat
sudo mkdir /usr/include/libavcodec
sudo mkdir /usr/include/libavutil
sudo mkdir /usr/lib/vhook


now its all installed nicely on intrepid :)

@H.264
November 1st, 2008, 02:03 AM
What i'm doing wrong?

http://i34.tinypic.com/eq48ww.png

FakeOutdoorsman
November 1st, 2008, 03:04 AM
What i'm doing wrong?
I'm assuming you're using Ubuntu 8.10. Try this:

cd ~/x264
make distclean
./configure --prefix=/usr
make
sudo checkinstall
I've updated the tutorial for Intrepid since you posted, but it could use some improvements with the checkinstall issues.

@H.264
November 1st, 2008, 03:58 AM
That is fine :), but now same with ffmpeg...:(

http://i36.tinypic.com/1zmhxso.png

What is the catch...what do i need to do also for ac3 support?

p.s. any guide for ffmpeg+x264+ac3?

FakeOutdoorsman
November 1st, 2008, 04:06 AM
That is fine :), but now same with ffmpeg...:(

What is the catch...what do i need to do also for ac3 support?

p.s. any guide for ffmpeg+x264+ac3?

cd ~/ffmpeg
make distclean
./configure --prefix=/usr --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264
make
sudo mkdir /usr/lib/pkgconfig
sudo mkdir /usr/include/libpostproc
sudo mkdir /usr/include/libavdevice
sudo mkdir /usr/include/libavformat
sudo mkdir /usr/include/libavcodec
sudo mkdir /usr/include/libavutil
sudo mkdir /usr/lib/vhook
sudo checkinstall
FFmpeg supports ac3 natively, so you won't need to do anything extra.

ercdvs
November 3rd, 2008, 02:20 AM
2 points :

Why not include support for xvid (--enable-libxvid) ? I end up using mencoder a number of times to fix audio channel mapping, and xvids come out nice and clean for ps3 output. In my understanding, mencoder uses ffmeg in the background.

why specifically disable debug? I thought its not outputting any debug info unless specifically called. is there some performance boost without it ?

FakeOutdoorsman
November 3rd, 2008, 04:41 AM
2 points :

Why not include support for xvid (--enable-libxvid) ? I end up using mencoder a number of times to fix audio channel mapping, and xvids come out nice and clean for ps3 output. In my understanding, mencoder uses ffmeg in the background.
I had it listed a while back but I removed it because a "native MPEG-4/Xvid encoder exists" according to "./configure --help". I'll add it to the list of optional codecs.


why specifically disable debug? I thought its not outputting any debug info unless specifically called. is there some performance boost without it ?
It probably doesn't do much because I believe debugging is off by default. I'm guessing it is specific to ffmpeg_g (the debug build). I did some non-scientific tests and encoding times were around 2/10th of a second faster with debug disabled for mpeg4 and libx264 encodes.

Fisslefink
November 3rd, 2008, 08:24 AM
Thank you for the excellent tutorial, FakeOutdoorsman. I was pleasantly surprised to find such clean instructions for Intrepid Ibex, so soon after the release!

I have two small corrections for you:

At Step 2, my install of Intrepid Ibex did not have libvorbis-dev by default, so I'd suggest adding it to your list of packages. Save someone the little bit of grief looking for the right package :-)

So for Intrepid users, the code at Step 2 should read:

sudo aptitude install build-essential subversion git-core checkinstall yasm libfaad-dev libfaac-dev libmp3lame-dev libtheora-dev libvorbis-dev

At Step 5, my install of Intrepid Ibex did not have the directory "/usr/include/libpostproc", so I'd suggest adding it to your list of directories to make.

So for Intrepid users, the code at Step 5 should read:

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --prefix=/usr --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264
make
sudo mkdir /usr/local/lib/pkgconfig
sudo mkdir /usr/include/libavdevice
sudo mkdir /usr/include/libavformat
sudo mkdir /usr/include/libavcodec
sudo mkdir /usr/include/libavutil
sudo mkdir /usr/lib/vhook
sudo mkdir /usr/include/libpostproc
sudo checkinstall

And if I may make two small suggestions as well:

Because of your excellent color scheme in Step 3 (marking it Hardy only), I skipped right to Step 5, which was marked "Intrepid". Missing Step 4 turned out to be a major error. Perhaps you could add colored text that says "Both Hardy Heron and Intrepid Ibex" to Steps 1, 4, and 6.

Finally, why not include xvid support? This is a pretty common codec used by nuvexport (for MythTV), Handbrake, and others. This could be accomplished by simply adding "libxvidcore4-dev" to the list of packages to download at Step 2, and adding "--enable-xvid" to the ffmpeg "./configure" command at Step 5. After following your tutorial once as written, I went back and made only these changes, and it worked fine.

Anyway, excellent job, and thanks again.

Cheers.

PS: For those who don't know, you can check which codecs are supported by your ffmpeg installation using this command:
ffmpeg -formats|less
...scroll down to the "Codecs:" section, and note that many critical ones begin with 'lib', i.e. "libfaac" and "libx264"

Utopic
November 3rd, 2008, 03:55 PM
@Fisslefink:
It's --enable-libxvid ...And it's works fine !
Thanks for this how to !

FakeOutdoorsman
November 3rd, 2008, 08:13 PM
At Step 2, my install of Intrepid Ibex did not have libvorbis-dev by default, so I'd suggest adding it to your list of packages. Save someone the little bit of grief looking for the right package :-)
I removed libvorbis-dev from the dependency list, but forgot to remove --enable-libvorbis from the ffmpeg configuration. I removed it because a native vorbis encoder exists and I wanted to reduce the number of dependencies. Unfortunately, ffmpeg defaults to flac when encoding to ogg instead of vorbis which can be unexpected. You have to add "-acodec vorbis". Might be bug report worthy.

At Step 5, my install of Intrepid Ibex did not have the directory "/usr/include/libpostproc", so I'd suggest adding it to your list of directories to make.
Another omission on my part. I even mentioned this in an earlier thread. Thanks for pointing that out.

Because of your excellent color scheme in Step 3 (marking it Hardy only), I skipped right to Step 5, which was marked "Intrepid". Missing Step 4 turned out to be a major error. Perhaps you could add colored text that says "Both Hardy Heron and Intrepid Ibex" to Steps 1, 4, and 6.
I separated the howto a little more and embiggened the step numbers to help delineate things.

Finally, why not include xvid support? This is a pretty common codec used by nuvexport (for MythTV), Handbrake, and others. This could be accomplished by simply adding "libxvidcore4-dev" to the list of packages to download at Step 2, and adding "--enable-xvid" to the ffmpeg "./configure" command at Step 5. After following your tutorial once as written, I went back and made only these changes, and it worked fine.
This howto focuses on x264, and ffmpeg has a native xvid/mpeg4 encoder so I removed it to reduce the number of dependencies. From the FFmpeg FAQ:

3.12 How do I encode Xvid or DivX video with ffmpeg?
Both Xvid and DivX (version 4+) are implementations of the ISO MPEG-4 standard (note that there are many other coding formats that use this same standard). Thus, use '-vcodec mpeg4' to encode in these formats. The default fourcc stored in an MPEG-4-coded file will be 'FMP4'. If you want a different fourcc, use the '-vtag' option. E.g., '-vtag xvid' will force the fourcc 'xvid' to be stored as the video fourcc rather than the default.

Thanks for the suggestions. Work has been busy and I haven't been as comprehensive with my testing lately, so it's good to get feedback.

djcrash1981
November 4th, 2008, 01:37 AM
Hi, thanks for the HOW-TO, I've tried to follow it, but I'm getting a error when i try to compile ffmpeg:
m827078@yavin4:~/ffmpeg/ffmpeg-export-2008-11-03$ ./configure --prefix=/usr --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264
ERROR: libx264 version must be >= 0.65.
If you think configure made a mistake, make sure you are using the latest
version from SVN. If the latest version fails, report the problem to the
ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.err" produced by configure as this will help
solving the problem.

I've done what you said but i don't know what I'm missing.

Can you help me???

Thanks.

FakeOutdoorsman
November 4th, 2008, 02:59 AM
Did you install x264? Do you have other x264 packages installed, such as libx264-dev? Are you using Ubuntu 8.10 or 8.04? Paste the output of:

dpkg --get-selections | grep x264

@H.264
November 4th, 2008, 05:25 AM
I'm getting the same error when i just paste comand with "enables" whole line...using 8.10 :)

andrew.46
November 4th, 2008, 08:54 AM
Hi,

Thanks for the guide Fakeoutdoorsman :-). I did not use the checkinstall option as I am not a fan, and I will admit to using a few different options, but I would just like to mention that unlike a few people using Intrepid Ibex I can report that I did not have any x264 trouble with ffmpeg using the git x264. The version I have is:


andrew@skamandros:~$ ls /usr/lib/libx264.so.*
/usr/lib/libx264.so.65


and shows as successfully available to ffmpeg as:


andrew@skamandros:~$ ffmpeg -formats | grep x264
FFmpeg version SVN-r15772, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-nonfree --enable-postproc
--enable-pthreads --enable-libamr-nb --enable-libamr-wb
--enable-libmp3lame --enable-libschroedinger --enable-libx264
--enable-libxvid
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 2. 0 / 52. 2. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Nov 4 2008 18:37:29, gcc: 4.3.2
EV libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10


This is from a fresh git pull on November 4th. Now to work out how to use ffmpeg :-).

Andrew

@H.264
November 4th, 2008, 05:18 PM
:~/ffmpeg$ ./configure --prefix=/usr --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264
ERROR: LAME not found
If you think configure made a mistake, make sure you are using the latest
version from SVN. If the latest version fails, report the problem to the
ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.err" produced by configure as this will help
solving the problem.

Any idea what's wrong?

synthaxx
November 4th, 2008, 05:43 PM
Any idea what's wrong?

Your probably trying to compile on Intrepid, in that case you need to do a:


sudo apt-get install libmp3lame-dev

That should fix it.

FakeOutdoorsman
November 5th, 2008, 12:04 AM
Hi,

Thanks for the guide Fakeoutdoorsman :-). I did not use the checkinstall option as I am not a fan, and I will admit to using a few different options, but I would just like to mention that unlike a few people using Intrepid Ibex I can report that I did not have any x264 trouble with ffmpeg using the git x264.
Thanks for the update, Andrew. Good to hear it's working for you.

HIGHLIFE
November 5th, 2008, 12:26 AM
Installation x264 in step 4 failed for me. Here is my log:

Selecting previously deselected package x264.
(Reading database ... 200661 files and directories currently installed.)
Unpacking x264 (from .../x264/x264_20081104-1_i386.deb) ...
dpkg: error processing /home/dcesiel/x264/x264_20081104-1_i386.deb (--install):
trying to overwrite `/usr/lib/libx264.a', which is also in package libx264-dev
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
/home/dcesiel/x264/x264_20081104-1_i386.deb


How could I fix this?

FakeOutdoorsman
November 5th, 2008, 01:00 AM
Installation x264 in step 4 failed for me. Here is my log:

Selecting previously deselected package x264.
(Reading database ... 200661 files and directories currently installed.)
Unpacking x264 (from .../x264/x264_20081104-1_i386.deb) ...
dpkg: error processing /home/dcesiel/x264/x264_20081104-1_i386.deb (--install):
trying to overwrite `/usr/lib/libx264.a', which is also in package libx264-dev
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
/home/dcesiel/x264/x264_20081104-1_i386.deb


How could I fix this?
Looks like you have libx264-dev installed. Remove it first before installing x264.

@H.264
November 8th, 2008, 11:18 PM
How can i setup live update on ffmpeg+x264 only from official sites?
After installation always i'm getting update from Ubuntu nad always i have old configuration...:(

nowhere@cox.net
November 9th, 2008, 07:31 PM
I also have a question about this process and updates. I just did a fresh install of Intrepid. I previously had Hardy and was encoding ipod videos all the time. I looked back in my bookmarks to see how I got it working and my bookmark pointed to this thread. I must have followed it before but updates never bothered me about updating ffmpeg or x264.

Now when I follow the intrepid howto here, I am constantly pestered to update these two. However, if I name them something else, dependencies to play videos are broken. I thought I could install both the svn and the repo versions but filenames are going to conflict since the howto instructs on how to install them in the repo locations.

Can someone give me concise advice on how to best install these two packages so they are available to other packages and I won't be bothered to update them all the time? I KNOW this has to be possible. We used to have to build all our own software before repos were around.

PS when I do sudo aptitude hold ffmpeg x264 it still bothers me to update. Do I need to reboot or something?

Thanks a ton!

Lampi
November 9th, 2008, 07:49 PM
great howto, works just fine - now I'm curious:

does anyone make a next step towards building whole xine-lib 1.2 from scratch afterwards? I checked a dozen of howtos on this one, but none would cover the problems I encounter.

nowhere@cox.net
November 9th, 2008, 08:30 PM
I see from this post

http://ubuntuforums.org/showthread.php?t=948399&highlight=ffmpeg+ipod&page=2

that Medibuntu does not have an updated ffmpeg yet. I believe you used to be able to get an x264 enabled package there, mitigating the requirement to compile yourself and thus avoid the issues with the update bothering you.

I guess I will keep checking Medibuntu...

FakeOutdoorsman
November 10th, 2008, 04:16 AM
Now when I follow the intrepid howto here, I am constantly pestered to update these two. However, if I name them something else, dependencies to play videos are broken.
I re-added a compile option to x264 (--enable-shared) so other programs, such as mplayer from the repository, can use the x264 library files.

PS when I do sudo aptitude hold ffmpeg x264 it still bothers me to update. Do I need to reboot or something?
Is aptitude still asking you to upgrade? Telling aptitude to hold the packages won't apply to apt-get, Synaptic, or the update manager thing in the toolbar. You can tell them to "hold" the package in Synaptic with "Package -> Lock Version".

FakeOutdoorsman
November 10th, 2008, 04:19 AM
I see from this post

http://ubuntuforums.org/showthread.php?t=948399&highlight=ffmpeg+ipod&page=2

that Medibuntu does not have an updated ffmpeg yet. I believe you used to be able to get an x264 enabled package there, mitigating the requirement to compile yourself and thus avoid the issues with the update bothering you.

I guess I will keep checking Medibuntu...
I read somewhere that Medibuntu won't be supplying ffmpeg for Intrepid, but I'm not sure if that is correct or not. In the link you provided, mr_pouit explains that you can get the same functionality as the Medibuntu's ffmpeg by installing the unstripped packages. I haven't tried this myself.

Re: Medibuntu ffmpeg for Intrepid Help? (http://ubuntuforums.org/showpost.php?p=6063438&postcount=19)

billhung
November 12th, 2008, 07:54 AM
I read somewhere that Medibuntu won't be supplying ffmpeg for Intrepid, but I'm not sure if that is correct or not. In the link you provided, mr_pouit explains that you can get the same functionality as the Medibuntu's ffmpeg by installing the unstripped packages. I haven't tried this myself.

Re: Medibuntu ffmpeg for Intrepid Help? (http://ubuntuforums.org/showpost.php?p=6063438&postcount=19)

From my first hand experience. I confirm that Medibuntu is not having ffmpeg for 8.10 Intrepid (at least not now), while ffmpeg was working well with x264 in 8.04 hardy.

For more detail, look here:
https://bugs.launchpad.net/bugs/291011

FakeOutdoorsman
November 12th, 2008, 08:26 PM
The subversion server for ffmpeg has been updated to the ffmpeg.org domain. If you keep your ffmpeg folder and use it to update ffmpeg, then you can tell subversion to use the new server with:

cd ~/ffmpeg
svn switch --relocate svn://svn.mplayerhq.hu/ svn://svn.ffmpeg.org/
The old address will continue to work for awhile, but it is advised to start using the new one.

More info: [FFmpeg-devel] Subversion services now available from ffmpeg.org (http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2008-November/055868.html)

Ng Oon-Ee
November 13th, 2008, 02:10 AM
Hi, just followed this guide since the ffmpeg in intrepid is borked. However, I noticed that once I've completed it the command "man ffmpeg" gives the undocumented error. Is there a reason for this/anyway to get the man page besides loading it up online? Reason being I often rely on the man page to remember what options exist and their formatting.

andrew.46
November 13th, 2008, 03:53 AM
Hi Ng:


Hi, just followed this guide since the ffmpeg in intrepid is borked. However, I noticed that once I've completed it the command "man ffmpeg" gives the undocumented error.

Hmmm.... actually I bumped into this problem myself in a different distro. I suspect that under Ubuntu you are missing the texi2html package. Try adding that with apt-get and recompiling.

If this works (he says crossing his fingers) this might be worth adding to the guide Fakeoutdoorsman?

Andrew

Ng Oon-Ee
November 13th, 2008, 06:48 AM
Hmmm.... actually I bumped into this problem myself in a different distro. I suspect that under Ubuntu you are missing the texi2html package. Try adding that with apt-get and recompiling.

If this works (he says crossing his fingers) this might be worth adding to the guide Fakeoutdoorsman?

Andrew

Thanks, that was EXACTLY the solution =). +1 for adding it to the guide. Would never have been able to figure this out, I don't think.

andrew.46
November 13th, 2008, 09:17 AM
Hi Ng:


Thanks, that was EXACTLY the solution =). +1 for adding it to the guide. Would never have been able to figure this out, I don't think.

Wooo hooooo! I know almost nothing about ffmpeg so it feels very good to successfully troubleshoot it :-). I came across this problem a few months ago with a slightly different solution in the LQ Forums (http://www.linuxquestions.org/questions/slackware-14/svn-ffmpeg-no-man-file-623007/). In that case Slackware had texi2html but it was not available to the installation script I was using.

Andrew

FakeOutdoorsman
November 15th, 2008, 02:10 AM
Hi Ng:



Hmmm.... actually I bumped into this problem myself in a different distro. I suspect that under Ubuntu you are missing the texi2html package. Try adding that with apt-get and recompiling.

If this works (he says crossing his fingers) this might be worth adding to the guide Fakeoutdoorsman?

Andrew
Thanks, Andrew. Confirmed to work with Ibex. I didn't test Hardy, but added to the guide anyway. What was once a derelict, unemployed man is now a working man.

Ng Oon-Ee
November 15th, 2008, 03:50 AM
Thanks, Andrew. Confirmed to work with Ibex. I didn't test Hardy, but added to the guide anyway. What was once a derelict, unemployed man is now a working man.

Ah... work, that scourge of enjoyment :lolflag:. Just a question for you, for times when you're NOT working (no rush). When I follow your guide, somehow ffplay isn't properly installed, shows as not installed when I try to run it, no man page (ffmpeg does), and I can see ffplay.c in the ~/ffmpeg directory but no ffplay.d or ffplay.o, which leads me to believe its a compiler problem. Except that no errors were raised. Any info you need/suggestions?

Thanks for the guide, again.


EDIT: There's a file called config.err in ~/ffmpeg, when I search for occurrences of ffplay it says that ffplay depends on SDL, could the problem be that I don't have some SDL dev files? Do you have ffplay on your install? And do you have any SDL packages installed? I have a few, but those are binaries only.

kevdog
November 15th, 2008, 04:41 AM
I think I installed this package correctly, but how do I check? -- I'm on Ibex. Any test script?

billhung
November 15th, 2008, 05:16 AM
I just did the tutorial according to the first post with 8.10 Intrepid. And when I use the ffmpeg suggested by the post, I got the following error:



billh@billaspire:~/temp/ffmpeg/ffmpeg$ ffmpeg -y -i "/media/disk/DVD/cancer/avi/001/cancer-001.avi" -pass 1 -b 512k -bt 512k -s 640x480 -vcodec libx264 -an -threads 0 -coder 1 -flags +loop -cmp +chroma -partitions -parti8x8-parti4x4-partp8x8-partp4x4-partb8x8 -me_method dia -subq 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -bf 16 -refs 1 -directpred 1 -bidir_refine 0 -trellis 0 -flags2 -bpyramid-wpred-mixed_refs-dct8x8+fastpskip -f mp4 /dev/null
FFmpeg version SVN-r15746, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264 --enable-nonfree
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 1. 0 / 52. 1. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Oct 30 2008 13:37:51, gcc: 4.3.2
Input #0, avi, from '/media/disk/DVD/cancer/avi/001/cancer-001.avi':
Duration: 01:21:32.38, start: 0.000000, bitrate: 1640 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 720x480 [PAR 1:1 DAR 3:2], 29.97 tb(r)
Stream #0.1: Audio: mp3, 48000 Hz, stereo, s16, 128 kb/s
Output #0, mp4, to '/dev/null':
Stream #0.0: Video: libx264, yuv420p, 640x480 [PAR 9:8 DAR 3:2], q=10-51, pass 1, 512 kb/s, 29.97 tb(c)
Stream mapping:
Stream #0.0 -> #0.0
[libx264 @ 0x9d515e0]no ratecontrol method specified
Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
billh@billaspire:~/temp/ffmpeg/ffmpeg$


Notice my ffmpeg install was working fine with 8.10 + x264 + ffmpeg. The following command was working fine for me:


nice -n 18 /usr/bin/ffmpeg -y -i "/media/disk/DVD/cancer/avi/001/cancer-001.avi" -threads 2 -r 29.97 -b 400kb -vcodec libx264 -s 640x480 -acodec libfaac -ab 64k -ar 48000 -ac 1 "/media/disk/DVD/cancer/avi/001/cancer.mp4"

I was just wondering why the command suggested by the post didn't work.

FakeOutdoorsman
November 15th, 2008, 06:36 AM
Ah... work, that scourge of enjoyment :lolflag:. Just a question for you, for times when you're NOT working (no rush). When I follow your guide, somehow ffplay isn't properly installed, shows as not installed when I try to run it, no man page (ffmpeg does), and I can see ffplay.c in the ~/ffmpeg directory but no ffplay.d or ffplay.o, which leads me to believe its a compiler problem. Except that no errors were raised. Any info you need/suggestions?

Thanks for the guide, again.


EDIT: There's a file called config.err in ~/ffmpeg, when I search for occurrences of ffplay it says that ffplay depends on SDL, could the problem be that I don't have some SDL dev files? Do you have ffplay on your install? And do you have any SDL packages installed? I have a few, but those are binaries only.
I've never used ffplay before, buy I believe you'll need to install libsdl1.2-dev and then recompile ffmpeg. This will bring in a good number of other packages as well, but most are small in size. You may need some other packages, but I didn't test it much. I should add this info to the guide.

The unemployed statement was referring to the man pages, not me since I'm mostly employed. That's what I get for such a lame joke.

Ng Oon-Ee
November 15th, 2008, 06:50 AM
I think I installed this package correctly, but how do I check? -- I'm on Ibex. Any test script?

Just try converting any video file you have, the easiest way is to do this:-


ffmpeg -i [type in the path to your input video here] [output name]

This should produce a video in your current directory. The type of the video will automatically be deduced from the output name (I suggest test.mpg for starters). After you know that's worked, then start playing around with the options. Bitrate, Audio sync, stuff like that.



I've never used ffplay before, buy I believe you'll need to install libsdl1.2-dev and then recompile ffmpeg. This will bring in a good number of other packages as well, but most are small in size. You may need some other packages, but I didn't test it much. I should add this info to the guide.

The unemployed statement was referring to the man pages, not me since I'm mostly employed. That's what I get for such a lame joke.

Ah, online humour not translating :), common enough thing.

I'll try it out now and post if it works, so you can add it to your guide.

FakeOutdoorsman
November 15th, 2008, 06:51 AM
I think I installed this package correctly, but how do I check? -- I'm on Ibex. Any test script?
You can just try running ffmpeg to see if it installed correctly:

ffmpeg -version
Should give you a response similar to:

FFmpeg version SVN-r15824, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264
You could also ask aptitude. I named my ffmpeg package "ffmpeg-svn":

aptitude show ffmpeg-svn
Should give you:

Package: ffmpeg-svn
New: yes
State: installed
Automatically installed: no
Version: 20081114-1
Priority: extra
Section: checkinstall
Maintainer: root@ubuntu
Uncompressed Size: 45.8M
Provides: ffmpeg
Description: ffmpeg
To test ffmpeg, just find a video and:

ffmpeg -i yourinputvideo.flv output.mpg
To test ffmpeg and x264:

ffmpeg -i yourinputvideo.ogv -vcodec libx264 output.mp4
The -vcodec option allows you to choose what video codec to use, but often ffmpeg can guess depending on the output extension, such as in the first example. Refer to "Using ffmpeg and x264" in the first post of guide for more usage examples.

FakeOutdoorsman
November 15th, 2008, 07:00 AM
I just did the tutorial according to the first post with 8.10 Intrepid. And when I use the ffmpeg suggested by the post, I got the following error:



billh@billaspire:~/temp/ffmpeg/ffmpeg$ ffmpeg -y -i "/media/disk/DVD/cancer/avi/001/cancer-001.avi" -pass 1 -b 512k -bt 512k -s 640x480 -vcodec libx264 -an -threads 0 -coder 1 -flags +loop -cmp +chroma -partitions -parti8x8-parti4x4-partp8x8-partp4x4-partb8x8 -me_method dia -subq 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -bf 16 -refs 1 -directpred 1 -bidir_refine 0 -trellis 0 -flags2 -bpyramid-wpred-mixed_refs-dct8x8+fastpskip -f mp4 /dev/null
FFmpeg version SVN-r15746, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264 --enable-nonfree
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 1. 0 / 52. 1. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Oct 30 2008 13:37:51, gcc: 4.3.2
Input #0, avi, from '/media/disk/DVD/cancer/avi/001/cancer-001.avi':
Duration: 01:21:32.38, start: 0.000000, bitrate: 1640 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 720x480 [PAR 1:1 DAR 3:2], 29.97 tb(r)
Stream #0.1: Audio: mp3, 48000 Hz, stereo, s16, 128 kb/s
Output #0, mp4, to '/dev/null':
Stream #0.0: Video: libx264, yuv420p, 640x480 [PAR 9:8 DAR 3:2], q=10-51, pass 1, 512 kb/s, 29.97 tb(c)
Stream mapping:
Stream #0.0 -> #0.0
[libx264 @ 0x9d515e0]no ratecontrol method specified
Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
billh@billaspire:~/temp/ffmpeg/ffmpeg$


Notice my ffmpeg install was working fine with 8.10 + x264 + ffmpeg. The following command was working fine for me:


nice -n 18 /usr/bin/ffmpeg -y -i "/media/disk/DVD/cancer/avi/001/cancer-001.avi" -threads 2 -r 29.97 -b 400kb -vcodec libx264 -s 640x480 -acodec libfaac -ab 64k -ar 48000 -ac 1 "/media/disk/DVD/cancer/avi/001/cancer.mp4"

I was just wondering why the command suggested by the post didn't work.
I just tested the example and it worked fine for me. Some people have been getting the rate control error when libx264-dev is installed. Also, libx264 had some major API changes not too long ago that breaks older revisions of ffmpeg. Make sure you are using the latest ffmpeg and x264 (how old is r15746?). Show the output of:

x264 --version

peerLAN
November 15th, 2008, 07:06 PM
Mates... I'm tired and I thank you for any help you could give me. I did everything as it should be but it doesn't work.

I got the latest x264 source code, compiled, got the latest ffmpeg code configured it with --enable-libx264 --enable-gpl, compiled it, but when I use:

ffmpeg -i test.mov -vcodec libx264 out.mp4

i get



FFmpeg version SVN-r15828, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --enable-libx264 --enable-gpl
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 3. 0 / 52. 3. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
built on Nov 15 2008 19:49:37, gcc: 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'madagascar2-tlr3_h1080p.mov':
Duration: 00:02:02.64, start: 0.000000, bitrate: 9183 kb/s
Stream #0.0(eng): Video: h264, yuv420p, 1920x1080, 24.00 tb(r)
Stream #0.1(eng): Audio: aac, 44100 Hz, stereo, s16
Stream #0.2(eng): Data: tmcd / 0x64636D74
Output #0, mp4, to 'out.mp4':
Stream #0.0(eng): Video: libx264, yuv420p, 1920x1080, q=2-31, 200 kb/s, 24.00 tb(c)
Stream #0.1(eng): Audio: 0x0000, 44100 Hz, stereo, s16, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
[libx264 @ 0x88717b0]no ratecontrol method specified
Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height


It's the same no matter what arguments I try. :(
Any idea what I should do next...?

x264 --version

x264 0.65.1028 83baa7f

ffmpeg -version

FFmpeg version SVN-r15828, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --enable-libx264 --enable-gpl
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 3. 0 / 52. 3. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
built on Nov 15 2008 19:49:37, gcc: 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
FFmpeg SVN-r15828
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 3. 0 / 52. 3. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0

jjaromin
November 15th, 2008, 10:46 PM
I've followed the directions in the first post. x264 compiled with no issues. ffmpeg is giving me an error during checkinstall. Here is the error.


(Reading database ... 31162 files and directories currently installed.)
Unpacking ffmpeg (from .../ffmpeg_20081115-1_i386.deb) ...
dpkg: error processing /root/ffmpeg/ffmpeg_20081115-1_i386.deb (--install):
trying to overwrite `/usr/lib/libavcodec.a', which is also in package libavcodec-dev
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Processing triggers for man-db ...
Errors were encountered while processing:
/root/ffmpeg/ffmpeg_20081115-1_i386.deb


Can anyone here help me get past this?

I'm new to linux (ubuntu 8.10) so please be gentle!

FakeOutdoorsman
November 15th, 2008, 11:02 PM
Mates... I'm tired and I thank you for any help you could give me. I did everything as it should be but it doesn't work.

I got the latest x264 source code, compiled, got the latest ffmpeg code configured it with --enable-libx264 --enable-gpl, compiled it, but when I use:

ffmpeg -i test.mov -vcodec libx264 out.mp4
...

Why did you compile ffmpeg with just --enable-libx264 and --enable-gpl? You would probably be better off with ffmpeg from the repository if you're going to use so few options. Try using the configure options from the guide, otherwise you'll also get the "Unsupported codec for output stream #0.1" error since you didn't enable libfaad and libfaac.

FakeOutdoorsman
November 15th, 2008, 11:05 PM
I've followed the directions in the first post. x264 compiled with no issues. ffmpeg is giving me an error during checkinstall. Here is the error.


(Reading database ... 31162 files and directories currently installed.)
Unpacking ffmpeg (from .../ffmpeg_20081115-1_i386.deb) ...
dpkg: error processing /root/ffmpeg/ffmpeg_20081115-1_i386.deb (--install):
trying to overwrite `/usr/lib/libavcodec.a', which is also in package libavcodec-dev
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Processing triggers for man-db ...
Errors were encountered while processing:
/root/ffmpeg/ffmpeg_20081115-1_i386.deb


Can anyone here help me get past this?

I'm new to linux (ubuntu 8.10) so please be gentle!
You have libavcodec-dev installed and checkinstall doesn't want to overwrite files from libavcodec-dev with the ffmpeg files. Try removing libavcodec-dev and running checkinstall again.

macsmith
November 15th, 2008, 11:11 PM
Help. I've installed and re-installed but still get a blank configuration, see below.

I'm running ubuntu 8.04.1, downloaded today's version of ffmpeg, yasm and x264. I updated the installation using the instructions on page 1 of this thread. There were no build errors. I've also read all 21 pages of this thread!

What can I try next?

Thanks

FFmpeg version SVN-r15821, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration:
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 3. 0 / 52. 3. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
built on Nov 14 2008 16:34:59, gcc: 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
Input #0, mpeg, from '/public/temp/guitarHero.mpg':
Duration: 00:02:03.69, start: 0.224367, bitrate: 30119 kb/s
Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 40000 kb/s, 25.00 tb(r)
Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16, 224 kb/s
Warning: not compiled with thread support, using thread emulation
Unknown encoder 'libx264'

macsmith
November 15th, 2008, 11:17 PM
aha!

funny, when you express a problem for others to understand, the answer pops out all by itself.

I did all this today but looking at the output, it's dated yesterday's build. Yesterday I installed an older version and today I installed the latest version.

When I did ./ffmpeg instead of ffmpeg, I get today's version and it works!

So, new question: why hasn't the installation utility copied the latest build into my path directory? Is there a missing step in the installation?

Thanks

peerLAN
November 15th, 2008, 11:20 PM
I managed to fix my "no ratecontrol method specified". The problem was with a x264 lib that I installed using the ubuntu repository and it didn't updated (?) when I installed the new one from git. So I removed everything x264 and installed it just using the latest version from git on clean and it works now.

FakeOutdoorsman
November 15th, 2008, 11:29 PM
Help. I've installed and re-installed but still get a blank configuration, see below.

I'm running ubuntu 8.04.1, downloaded today's version of ffmpeg, yasm and x264. I updated the installation using the instructions on page 1 of this thread. There were no build errors. I've also read all 21 pages of this thread!

What can I try next?

Thanks

FFmpeg version SVN-r15821, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration:
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 3. 0 / 52. 3. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
built on Nov 14 2008 16:34:59, gcc: 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
Input #0, mpeg, from '/public/temp/guitarHero.mpg':
Duration: 00:02:03.69, start: 0.224367, bitrate: 30119 kb/s
Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 40000 kb/s, 25.00 tb(r)
Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16, 224 kb/s
Warning: not compiled with thread support, using thread emulation
Unknown encoder 'libx264'
What do you mean by, "get a blank configuration"? Show your complete ffmpeg command and the full ffmpeg response.

Edit: Ok, ignore that. I came here straight from the email notification and failed to see your following message. Did you uninstall your old ffmpeg before updating?

FakeOutdoorsman
November 15th, 2008, 11:39 PM
I managed to fix my "no ratecontrol method specified". The problem was with a x264 lib that I installed using the ubuntu repository and it didn't updated (?) when I installed the new one from git. So I removed everything x264 and installed it just using the latest version from git on clean and it works now.
Which x264 lib from the repository was it (libx264-59, libx264-dev)? If you have those installed already before starting this guide they will conflict with your compiled x264 from git, not update.

Ng Oon-Ee
November 15th, 2008, 11:55 PM
aha!

funny, when you express a problem for others to understand, the answer pops out all by itself.

I did all this today but looking at the output, it's dated yesterday's build. Yesterday I installed an older version and today I installed the latest version.

When I did ./ffmpeg instead of ffmpeg, I get today's version and it works!

So, new question: why hasn't the installation utility copied the latest build into my path directory? Is there a missing step in the installation?

Thanks

I think you have to purge ffmpeg prior to installing :)



I've never used ffplay before, buy I believe you'll need to install libsdl1.2-dev and then recompile ffmpeg. This will bring in a good number of other packages as well, but most are small in size. You may need some other packages, but I didn't test it much. I should add this info to the guide.

Your advise was exactly correct. Simply installing libsdl1.2-dev before the ./configure and make gave me ffplay as well. Thank you very much, suggest you add that to your guide, maybe a subsection with (add this if you want/use ffplay).

macsmith
November 15th, 2008, 11:58 PM
Hi,

I thought I had uninstalled the old version but it doesn't look like it.

Should the new install process have copied ffmpeg to my bin directory? Obviously I can easily do the copy manually. Are there any other files that need to be copied?

Thanks

Ng Oon-Ee
November 16th, 2008, 12:19 AM
Hi,

I thought I had uninstalled the old version but it doesn't look like it.

Should the new install process have copied ffmpeg to my bin directory? Obviously I can easily do the copy manually. Are there any other files that need to be copied?

Thanks

The installation should obviously have copied ffmpeg to your bin directory (it did on mine). Maybe just purge ffmpeg and see if anything is left in your bin.


sudo apt-get purge ffmpeg
ls /usr/bin | grep ff

Check for ffmpeg, ffmpeg2theora, ffplay, ffserver. I have all of those from installing according to this guide. If you still have them after you run the purge, just delete them and run the guide again (or, to save time, just install the .deb the guide created for you :)).

@H.264
November 17th, 2008, 03:54 AM
Uff, i get frustrated with those updates for ffmpeg/x264 which are after install latest packages.
Someone has an idea what do i need to do to avoid those updates from Ubuntu package?:confused:

Ng Oon-Ee
November 17th, 2008, 04:01 AM
Uff, i get frustrated with those updates for ffmpeg/x264 which are after install latest packages.
Someone has an idea what do i need to do to avoid those updates from Ubuntu package?:confused:

As the guide states, you can just 'lock' your packages.

Alternatively, the way I do it is to follow Ubuntu's naming standard, so in the case that a newer ffmpeg is updated to the repos, I'll get notified of it. Anyway, currently (in Intrepid) there's only one version of ffmpeg, as Medibuntu doesn't have it yet, and may not add it. The important number is the Version Number, which is simply a string which is compared with what you have to see which is numerically/alphabetically higher. The problem is that the defaults for installing ffmpeg from source provide a version number which is totally numerical, and that is trumped by the repo's version.

So, anyway, the current version number I have is 3:0.svn20080206-12ubuntu3. I downloaded my source copy from SVN on 11th November 2008, so when I run sudo checkinstall, I select option 3 (the 4th option) and change the installed version number to 3:0.svn20081115-12ubuntu3, just replacing the date with the date of my download.

If somehow Ubuntu decides to update ffmpeg, the version number they use will be higher than this, and I'll get that version. Of course, I may not want the Intrepid version if its not from medibuntu, but at least I know somethings been updated.

For reference, the corresponding current repo versions of x264 is 1:0.svn20080408-0.0ubuntu1 and my updated version is 1:0.svn20081115-0.0ubuntu1.

@H.264
November 17th, 2008, 04:23 AM
I'll try now...

p.s. same thing for both packages ( ffmpeg+x264 )?

//Edit:

http://i33.tinypic.com/zt7yx3.png

So, what do i need to write on option 3?

@H.264
November 17th, 2008, 05:20 AM
Ok..finaly done, but after i locked App...

"6. Lock your packages. If you named your packages "x264" and "ffmpeg" then aptitude and apt/Synaptic will attempt to "upgrade" your new x264 and ffmpeg installations with the ancient official versions in the repository. If you use aptitude:
Code:

sudo aptitude hold x264 ffmpeg

or apt-get/Synaptic:
Open System -> Administration -> Synaptic Package Manager -> Choose the x264 package -> Package -> Lock Version


I'll sugest instead "sudo aptitude hold x264 ffmpeg" in guide to be only "Lock Version" for both ffmpeg and x264 before they start to install them even at the begining, so people will not be confused anymore :)

Ng Oon-Ee
November 17th, 2008, 07:21 AM
I'll try now...

p.s. same thing for both packages ( ffmpeg+x264 )?

//Edit:

http://i33.tinypic.com/zt7yx3.png

So, what do i need to write on option 3?

I see you've decided on holding :). It works, of course. In answer to the above, if you read the instructions given there, you have to type '3' to
select the option you want to change, then there would be an input prompt


>>

Then just input the appropriate version number.

billhung
November 18th, 2008, 02:21 AM
I just tested the example and it worked fine for me. Some people have been getting the rate control error when libx264-dev is installed. Also, libx264 had some major API changes not too long ago that breaks older revisions of ffmpeg. Make sure you are using the latest ffmpeg and x264 (how old is r15746?). Show the output of:

x264 --version

Here's the output of x264.


billh@billaspire:~$ x264 --version
x264 0.65.999 cc51047


I re-installed both x264 and ffmpeg that day of the post (that's nov 16, 2008 )

Here's my ffmpeg just in case you want to see


billh@billaspire:~$ ffmpeg --version
FFmpeg version SVN-r15746, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264 --enable-nonfree
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 1. 0 / 52. 1. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Oct 30 2008 13:37:51, gcc: 4.3.2
ffmpeg: missing argument for option '--version'
billh@billaspire:~$

billhung
November 18th, 2008, 02:27 AM
Ok..finaly done, but after i locked App...

"6. Lock your packages. If you named your packages "x264" and "ffmpeg" then aptitude and apt/Synaptic will attempt to "upgrade" your new x264 and ffmpeg installations with the ancient official versions in the repository. If you use aptitude:
Code:

sudo aptitude hold x264 ffmpeg

or apt-get/Synaptic:
Open System -> Administration -> Synaptic Package Manager -> Choose the x264 package -> Package -> Lock Version


I'll sugest instead "sudo aptitude hold x264 ffmpeg" in guide to be only "Lock Version" for both ffmpeg and x264 before they start to install them even at the begining, so people will not be confused anymore :)

I experienced the same thing. And after doing what @H.264 suggested, the synaptic package manager no long ask me for update. And I didn't even need a reboot.

xeddog
November 21st, 2008, 01:10 AM
Thanks for tutorial, but I am still having problems with xvid support. Whenever I specify "-vcodec xvid" when using ffmpeg I get an encoder not found msg.

To install the support, I started by using Synaptic to install libxvidcore4-dev. Then I started at the point in the instructions for updating the installation. I ran

sudo apt-get purge ffmpegx x264-git which ran ok. (these are the names I assigned when doing the initial checkinstall)

make distclean - also seemed to run ok.
git pull - already updated
then the configure, make, checkinstall, and ldconfig for x264 which ran ok too.

Did cd to ffmpeg directory and ran "make distclean" and "svn update" commands which looked ok.

Then I ran the configure command shown in the instructions but added --enable-libxvid onto the end. That also seemed to go ok as did the make and checkinstall.

But when I use ffmpeg to encode a video, if I have "-vcodec xvid" it just doesn't work due to the encoder xvid not found. output from "ffmpeg -formats" doesn't list anything with the characters "xvid" in it.

Everything looks ok to me but it still doesn't work. Sorry, but I am way too new at this to figure it out myself.

Oh, btw, this is on an Ubuntu Intrepid 32-bit installation.

TIA,

xeddog

FakeOutdoorsman
November 21st, 2008, 01:16 AM
You did the right steps, except you need to use "-vcodec libxvid". Alternatively, and for those who did not --enable-libxvid and install libxvidcore4-dev, ffmpeg can still encode to xvid with:

-vcodec mpeg4 -vtag xvid

More info: How do I encode Xvid or DivX video with ffmpeg? (http://ffmpeg.mplayerhq.hu/faq.html#SEC24)

xeddog
November 21st, 2008, 02:02 AM
Aw CRAP! I knew this was gonna happen. I spend the better part of a day trying to figure this out and it just escapes me. So I put up a post for help. THEN I decide to do some elementary diagnosis. I found an older version of ffmpeg in the my %PATH that did not have xvid enabled. When I used the full path name to execute ffmpeg that I want, it works.

xeddog

xeddog
November 21st, 2008, 02:10 AM
Sorry I neglected to mention this in my original post, but I tried using "-vcodec libxvid" too. Neither worked because of the path problem.

Regarding the -vtag option, I tried that and still had a problem playing the video. I am trying to use a D-Link DSM-520 media server for the player and it is VERY particular about the codec and options used for encoding.

When I used "-vcodec mpeg4", ffmpeg runs just fine. When I try to play the video on the D-link, it will play about 5-6 seconds of the video just fine, and then it will stop and just show about 1 frame a second or two. Also, the audio is hosed from the start and just "chirps" about once every second. This has happened using several different applications on both Linux and XP. But when I use the xvid encoder, they play just fine on the D-link, and that is why I specifically wanted the xvid encoder.

Thanks,

xeddog

andrew.46
November 21st, 2008, 07:11 AM
Hi Fakeoutdoorsman,

You may know that I work on the little brother to this guide, the svn Mplayer guide (http://ubuntuforums.org/showthread.php?t=558538). I am working on adding a checkinstall option to this thread although I am not a big fan of checkinstall :(.

In doing so I may have found the solution to the problem of having to manually create directories before using checkinstall to install ffmpeg for Intrepid Ibex. Can I suggest the following syntax:


sudo checkinstall -D --fstrans=no --install=yes \
--pkgname ffmpeg \
--pkgversion "svn-`date +%d%m%Y`" \
--backup=no --deldoc=yes \
--deldesc=yes --delspec=yes

which works on my system. All the extra options are merely useful but the solution to the missing directories seems to be the '--fstrans=no --install=yes' one.

I would love to know if this worked on your system and more than flattered if part of this appeared in your guide :-). Similar work will be appearing in my own guide soon along with a few more checkinstall options that I am working through.

All the best,

Andrew

Edit: It works so well that I have added a similar commandline for the MPlayer guide :-)

FakeOutdoorsman
November 21st, 2008, 11:48 PM
I would love to know if this worked on your system and more than flattered if part of this appeared in your guide :-). Similar work will be appearing in my own guide soon along with a few more checkinstall options that I am working through.

Hi Andrew,

How did you figure this out? This is good news because the directory making seemed that it should have been unnecessary. I tested it out on both Hardy and Intrepid and all seemed just fine.

I somewhat followed the Ubuntu versioning convention to prevent annoying updates as mentioned earlier by Ng Oon-Ee. Not sure if there is any downside to that or not, but it seems to work.

Thanks for the help and nice guide (I've subscribed to it).

andrew.46
November 22nd, 2008, 12:57 AM
Hi FakeOutdoorsman,


How did you figure this out? This is good news because the directory making seemed that it should have been unnecessary. I tested it out on both Hardy and Intrepid and all seemed just fine.

Good news :-). The problem with checkinstall was a fairly big thing with my 'other' distro (slackware) where because of this problem checkinstall was actually removed from the distro completely (ftp://ftp.slackware.com/pub/slackware/slackware-current/extra/checkinstall/README). Because I have not used checkinstall extensively on either distro it took me a little while to make the connection. I am getting a little slow in my old age :-).


I somewhat followed the Ubuntu versioning convention to prevent annoying updates as mentioned earlier by Ng Oon-Ee. Not sure if there is any downside to that or not, but it seems to work.

Actually Ng Oon-Ee's versioning info looks like better idea than the way I proposed anyway. I shall investigate the naming conventions for the repository MPlayer and make a similar change. From memory MPlayer comes as Release Candidate only so it will be a little different perhaps; great idea though!

When I read through the man page for checkinstall I saw the possibility to 'pre-fill' the checkinstall fields which I thought would be perfect for guides such as MPlayer and ffmpeg which are both complex enough.

All the best,

Andrew

seuzy13
November 22nd, 2008, 05:10 PM
I have a problem on the first step. When I try to purge all those packages, apt wants to also remove mplayer, vlc, avidemux, mencoder, ogmrip, mythtv, and a bunch of other important things. How can I remove just those several things that I wanted to?

kevdog
November 22nd, 2008, 05:49 PM
I may have said this once, but this is a really nice and well written guide. The edits are tremendous! Please keep maintaining this guide and write other guides if you get a chance

cloggie
November 22nd, 2008, 06:03 PM
Hi,

I must be the dummest fool around. I did follow your tutorial to the letter, went over my Synaptic to see if it was all deleted, and it was, so I did not have any ffmpeg or x264 stuff left, as far as I could see.
But upon installing the newly made x264 it gives me an error, saying "Failed".
The logfile tells me this:
(Reading database ... 124549 files and directories currently installed.)
Preparing to replace x264 1:0.svn20071224-0.0ubuntu1 (using .../x264_1:0.svn20081122-0.0ubuntu1-1_i386.deb) ...
Unpacking replacement x264 ...
dpkg: error processing /home/will/x264/x264_1:0.svn20081122-0.0ubuntu1-1_i386.deb (--install):
trying to overwrite `/usr/lib/pkgconfig/x264.pc', which is also in package libx264-dev
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
/home/will/x264/x264_1:0.svn20081122-0.0ubuntu1-1_i386.deb

On another note, I found that libx264 for instance was still installed, but when I wanted to uninstal it through Synaptic, I also saw that al the other stuff as mentioned by Seauzy13 was going to get deleted. So I halted this . But how further?

So, what is going wrong here, what am I missing?
Could you please help me?

Thanks, Will.

FakeOutdoorsman
November 22nd, 2008, 11:06 PM
I have a problem on the first step. When I try to purge all those packages, apt wants to also remove mplayer, vlc, avidemux, mencoder, ogmrip, mythtv, and a bunch of other important things. How can I remove just those several things that I wanted to?
This is the result of me making assumptions and not testing well enough. I thought libx264-59 (or libx264-57 in Hardy) would cause issues with the compiled x264, but it doesn't seem to as far as I can tell. It used to conflict because the shared libraries used to have the same name at one time (I think), but not anymore.

So, to summarize, you can keep libx264-59, which is what all those other programs require. Unfortunately, those other programs are probably not going to use your compiled x264 to encode with (another assumption) unless you compile them too. Alternatively, you could make a symlink to the new x264 libraries, but that's a messy way of doing things and not generally recommended and may not actually work (although I admit to doing it sometimes).


I may have said this once, but this is a really nice and well written guide. The edits are tremendous! Please keep maintaining this guide and write other guides if you get a chance
Thanks, kevdog. I have some others planned, but this one is the most interesting so far.



...
On another note, I found that libx264 for instance was still installed, but when I wanted to uninstal it through Synaptic, I also saw that al the other stuff as mentioned by Seauzy13 was going to get deleted. So I halted this . But how further?

So, what is going wrong here, what am I missing?
Could you please help me?

You did everything right, but the guide was flawed. It's updated now. It seems as if libx264-dev is installed on your machine. You could probably remove it without any issues because I don't think it has any dependent packages:

sudo apt-get remove libx264-dev
Then try x264 to install x264 again. Starting with this line:

sudo checkinstall --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`-0.0ubuntu1"

DilfATX
November 23rd, 2008, 06:12 AM
Excellent guide and I felt confident everything was going to go well..

but I got this error

libfaac doesn't support this output format!

and am not sure how to change that? when I clicked on the mp4 file it was 0 bytes after all that time going through its process.

here is the whole break down

rey@dilfATX:~$ ./264encode.sh 00060.MTS output.mp4
FFmpeg version SVN-r15908, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 3. 0 / 52. 3. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Nov 22 2008 12:41:12, gcc: 4.3.2
Input #0, mpegts, from '00060.MTS':
Duration: 00:02:43.64, start: 1.033367, bitrate: 17333 kb/s
Program 1
Stream #0.0[0x1011]: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 29.97 tb(r)
Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
Output #0, mp4, to '/dev/null':
Stream #0.0: Video: libx264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], q=10-51, pass 1, 512 kb/s, 29.97 tb(c)
Stream mapping:
Stream #0.0 -> #0.0
[libx264 @ 0xa169990]using SAR=1/1
[libx264 @ 0xa169990]using cpu capabilities: MMX2 SSE2Slow
[libx264 @ 0xa169990]profile Main, level 4.0
Press [q] to stop encoding
frame= 9808 fps= 7 q=-1.0 Lsize= 0kB time=327.23 bitrate= 0.0kbits/s .0kbits/s
video:20584kB audio:0kB global headers:1kB muxing overhead -99.999995%
[libx264 @ 0xa169990]slice I:40 Avg QP:35.23 size: 27162
[libx264 @ 0xa169990]slice P:4151 Avg QP:37.79 size: 3983
[libx264 @ 0xa169990]slice B:5617 Avg QP:39.90 size: 613
[libx264 @ 0xa169990]consecutive B-frames: 16.9% 23.6% 4.9% 25.7% 28.7% 0.2% 0.0% 0.0% 0.0% 0.0% 0.0% 0.0% 0.0% 0.0% 0.0% 0.0% 0.0%
[libx264 @ 0xa169990]mb I I16..4: 82.7% 0.0% 17.3%
[libx264 @ 0xa169990]mb P I16..4: 8.6% 0.0% 0.0% P16..4: 10.3% 0.0% 0.0% 0.0% 0.0% skip:81.1%
[libx264 @ 0xa169990]mb B I16..4: 0.3% 0.0% 0.0% B16..8: 4.1% 0.0% 0.0% direct: 0.3% skip:95.4% L0:32.6% L1:66.6% BI: 0.8%
[libx264 @ 0xa169990]final ratefactor: 38.76
[libx264 @ 0xa169990]SSIM Mean Y:0.8341146
[libx264 @ 0xa169990]kb/s:514.8
FFmpeg version SVN-r15908, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 3. 0 / 52. 3. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Nov 22 2008 12:41:12, gcc: 4.3.2
Input #0, mpegts, from '00060.MTS':
Duration: 00:02:43.64, start: 1.033367, bitrate: 17333 kb/s
Program 1
Stream #0.0[0x1011]: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 29.97 tb(r)
Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
Output #0, mp4, to 'output.mp4':
Stream #0.0: Video: libx264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], q=10-51, pass 2, 512 kb/s, 29.97 tb(c)
Stream #0.1: Audio: libfaac, stereo, s16, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
[libx264 @ 0xa40a990]using SAR=1/1
[libx264 @ 0xa40a990]using cpu capabilities: MMX2 SSE2Slow
[libx264 @ 0xa40a990]profile High, level 4.0
[libfaac @ 0xa40c6c0]libfaac doesn't support this output format!
Error while opening codec for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height
rey@dilfATX:~$



I would gladly take any suggestions :-)

FakeOutdoorsman
November 23rd, 2008, 07:34 AM
Excellent guide and I felt confident everything was going to go well..

but I got this error

libfaac doesn't support this output format!

This is a new error for me. I tried converting a 5.1 channel ac3 file and got no errors. I don't know why, but it looks like libfaac isn't getting the audio rate. Let's cut out the video and use the same audio settings as the script to see if the error can be replicated:

ffmpeg -i 00060.MTS -vn -acodec libfaac -ab 128k -ac 2 -f mp4 output.mp4

cloggie
November 23rd, 2008, 05:56 PM
I got basically the same error as DilFATX.

I used your line, but then got this:

will@will-laptop:~/Documents$ ffmpeg -i 100_2943.MOV -vn -acodec libfaac -ab 128k -ac 2 -f mp4 output.mp4
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm --enable-dc1394 --disable-debug --enable-libmp3lame --enable-libfaadbin --enable-libfaad --enable-libfaac --enable-xvid --enable-x264 --enable-liba52 --enable-amr_nb --enable-amr_wb --enable-shared --prefix=/usr
libavutil version: 1d.49.3.0
libavcodec version: 1d.51.38.0
libavformat version: 1d.51.10.0
built on Jul 29 2008 18:21:25, gcc: 4.2.3 (Ubuntu 4.2.3-2ubuntu7)

Seems stream 0 codec frame rate differs from container frame rate: 29.97 (30000/1001) -> 15.00 (3468000/231150)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '100_2943.MOV':
Duration: 00:00:57.7, start: 0.000000, bitrate: 1874 kb/s
Stream #0.0(eng): Video: h263, yuv420p, 352x288, 15.00 fps(r)
Stream #0.1(eng): Audio: pcm_mulaw, 8000 Hz, mono, 64 kb/s
Unknown codec 'libfaac'


I thought, wtf, I know libfaac is installed. Because when I do this:

will@will-laptop:~/Documents$ whereis libfaac
libfaac: /usr/lib/libfaac.la /usr/lib/libfaac.so /usr/lib/libfaac.a /usr/local/lib/libfaac.la /usr/local/lib/libfaac.so /usr/local/lib/libfaac.a
I get to see the whole thing, isn't it?
So why am I getting the same problem then? I mean, it should be possible to convert .mov into mp4 right? When I go from a mpg file to mp4 I don't get this problem, even when I do a straight conversion with ffmpeg, like this:

will@will-laptop:~/Documents$ ffmpeg -i rooftoporg.mpg rooftprogsunday.mp4
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm --enable-dc1394 --disable-debug --enable-libmp3lame --enable-libfaadbin --enable-libfaad --enable-libfaac --enable-xvid --enable-x264 --enable-liba52 --enable-amr_nb --enable-amr_wb --enable-shared --prefix=/usr
libavutil version: 1d.49.3.0
libavcodec version: 1d.51.38.0
libavformat version: 1d.51.10.0
built on Jul 29 2008 18:21:25, gcc: 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
Input #0, mpeg, from 'rooftoporg.mpg':
Duration: 00:03:21.5, start: 0.726700, bitrate: 1401 kb/s
Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 352x240, 1150 kb/s, 29.97 fps(r)
Stream #0.1[0x1c0]: Audio: mp2, 44100 Hz, stereo, 192 kb/s
Output #0, mp4, to 'rooftprogsunday.mp4':
Stream #0.0: Video: mpeg4, yuv420p, 352x240, q=2-31, 200 kb/s, 29.97 fps(c)
Stream #0.1: Audio: aac, 44100 Hz, stereo, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 6075 q=18.2 Lsize= 6860kB time=202.6 bitrate= 277.4kbits/s
video:5161kB audio:1580kB global headers:0kB muxing overhead 1.760572%
will@will-laptop:~/Documents$


So could it have something to do with the type of input file maybe?

DilfATX
November 23rd, 2008, 08:01 PM
This is a new error for me. I tried converting a 5.1 channel ac3 file and got no errors. I don't know why, but it looks like libfaac isn't getting the audio rate. Let's cut out the video and use the same audio settings as the script to see if the error can be replicated:

ffmpeg -i 00060.MTS -vn -acodec libfaac -ab 128k -ac 2 -f mp4 output.mp4

I tried that in terminal and got this


rey@dilfATX:~$ ffmpeg -i 00060.MTS -vn -acodec libfaac -ab 128k -ac 2 -f mp4 output.mp4
FFmpeg version SVN-r15908, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 3. 0 / 52. 3. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Nov 22 2008 12:41:12, gcc: 4.3.2
Input #0, mpegts, from '00060.MTS':
Duration: 00:02:43.64, start: 1.033367, bitrate: 17333 kb/s
Program 1
Stream #0.0[0x1011]: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 29.97 tb(r)
Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
Output #0, mp4, to 'output.mp4':
Stream #0.0: Audio: libfaac, stereo, s16, 128 kb/s
Stream mapping:
Stream #0.1 -> #0.0
[libfaac @ 0x8b56990]libfaac doesn't support this output format!
Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
rey@dilfATX:~$


Can I change the output format for "libfaac"? if so to what? and how? Thanks greatly for your help on this I didn't expect such a quick reply to my question :popcorn:

andrew.46
November 23rd, 2008, 09:08 PM
Hi:


Can I change the output format for "libfaac"? if so to what? and how? Thanks greatly for your help on this I didn't expect such a quick reply to my question :popcorn:

I am at the wrong computer at the moment but instead of mp4 have you tried m4a? It would be a bit fussy of ffmpeg to insist on this but worth a try.

Andrew

Edit: Not for the first time I am talking rubbish :-). I fired up my Ubuntu partition and the commandline worked fine:


andrew@skamandros:~/Desktop$ ffmpeg -i rappin.wav -vn -acodec libfaac \
-ab 128k -ac 2 -f mp4 output.mp4
FFmpeg version SVN-r15918, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-nonfree --enable-postproc
--enable-pthreads --enable-libamr-nb --enable-libamr-wb --enable-libmp3lame
--enable-libschroedinger --enable-libx264 --enable-libxvid --enable-libfaac
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 3. 0 / 52. 3. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Nov 24 2008 07:32:33, gcc: 4.3.2
Input #0, wav, from 'rappin.wav':
Duration: 00:00:19.95, bitrate: 31 kb/s
Stream #0.0: Audio: mp3, 22050 Hz, mono, s16, 32 kb/s
Output #0, mp4, to 'output.mp4':
Stream #0.0: Audio: libfaac, 22050 Hz, stereo, s16, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
size= 153kB time=19.88 bitrate= 62.9kbits/s
video:0kB audio:149kB global headers:0kB muxing overhead 2.636834%

FakeOutdoorsman
November 23rd, 2008, 11:20 PM
I got basically the same error as DilFATX.

I used your line, but then got this:

FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm --enable-dc1394 --disable-debug --enable-libmp3lame --enable-libfaadbin --enable-libfaad --enable-libfaac --enable-xvid --enable-x264 --enable-liba52 --enable-amr_nb --enable-amr_wb --enable-shared --prefix=/usr
libavutil version: 1d.49.3.0
libavcodec version: 1d.51.38.0
libavformat version: 1d.51.10.0
built on Jul 29 2008 18:21:25, gcc: 4.2.3 (Ubuntu 4.2.3-2ubuntu7)

...


This looks like ffmpeg from Medibuntu on Ubuntu Hardy. That version uses different codec names, so "-acodec libfaac" should be "-acodec aac".

I tried that in terminal and got this

...

Can I change the output format for "libfaac"? if so to what? and how? Thanks greatly for your help on this I didn't expect such a quick reply to my question :popcorn:
This is odd. Are you on Hardy or Intrepid? I can't replicate this error. Four more test commands:

ffmpeg -i 00060.MTS -vn -acodec libfaac -ar 48000 -ab 128k -ac 2 -f mp4 output.mp4

ffmpeg -i 00060.MTS -vn -acodec libfaac -ar 48000 -ab 128k -f mp4 output.mp4

ffmpeg -i 00060.MTS -vn -acodec libfaac -ar 44100 -ab 128k -ac 2 -f mp4 output.mp4

ffmpeg -i 00060.MTS output.aac

cloggie
November 24th, 2008, 06:15 AM
This looks like ffmpeg from Medibuntu on Ubuntu Hardy. That version uses different codec names, so "-acodec libfaac" should be "-acodec aac".

Fakeoutdoorsman, thanks for your quick reply every time.

I went over the install again, with a finetoothed comb, and reinstalled the whole ffmpeg again. Now the version reads :

FFmpeg version SVN-r15920, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264

And according to what I think, this should be really the latest version of ffmpeg, right?

I did a straight conversion from MOV to mp4 again, the second try I used the 2 pass method, described by you on page one, and, again, I get that same error.


[libfaac @ 0x885bb00]libfaac doesn't support this output format!
Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height


Again, from mpg to mp4 it works without a hitch, but when I try a .mov, it fails on me.
So that's what got me thinking, could it have something todo with the starting format? Am I missing a de- or en-coder or something like that?
(I know, probably a dumb question, but then again, I know nothing about this stuff)

cloggie
November 24th, 2008, 06:28 AM
Right after my reply, I used the suggestions you made to DilfATX.

The first suggestion gave me this:

will@will-laptop:~/Documents$ ffmpeg -i harvest.mov -vn -acodec libfaac -ar 48000 -ab 128k -ac 2 -f mp4 outputharvest.mp4
FFmpeg version SVN-r15920, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 3. 0 / 52. 3. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Nov 23 2008 20:30:18, gcc: 4.2.4 (Ubuntu 4.2.4-1ubuntu3)

Seems stream 0 codec frame rate differs from container frame rate: 29.97 (30000/1001) -> 15.00 (23120/1541)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'harvest.mov':
Duration: 00:00:57.78, start: 0.000000, bitrate: 1874 kb/s
Stream #0.0(eng): Video: h263, yuv420p, 352x288 [PAR 12:11 DAR 4:3], 15.00 tb(r)
Stream #0.1(eng): Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s
Output #0, mp4, to 'outputharvest.mp4':
Stream #0.0(eng): Audio: libfaac, 48000 Hz, stereo, s16, 128 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Press [q] to stop encoding
size= 546kB time=57.71 bitrate= 77.6kbits/s
video:0kB audio:525kB global headers:0kB muxing overhead 4.137723%

So that seemed to work.

The second suggestion gave this:


will@will-laptop:~/Documents$ ffmpeg -i harvest.mov -vn -acodec libfaac -ar 48000 -ab 128k -f mp4 outputharvest2.mp4
FFmpeg version SVN-r15920, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 3. 0 / 52. 3. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Nov 23 2008 20:30:18, gcc: 4.2.4 (Ubuntu 4.2.4-1ubuntu3)

Seems stream 0 codec frame rate differs from container frame rate: 29.97 (30000/1001) -> 15.00 (23120/1541)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'harvest.mov':
Duration: 00:00:57.78, start: 0.000000, bitrate: 1874 kb/s
Stream #0.0(eng): Video: h263, yuv420p, 352x288 [PAR 12:11 DAR 4:3], 15.00 tb(r)
Stream #0.1(eng): Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s
Output #0, mp4, to 'outputharvest2.mp4':
Stream #0.0(eng): Audio: libfaac, 48000 Hz, mono, s16, 128 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Press [q] to stop encoding
size= 540kB time=57.71 bitrate= 76.7kbits/s
video:0kB audio:518kB global headers:0kB muxing overhead 4.187221%


So that seems to work as well.

The third suggestion:


will@will-laptop:~/Documents$ ffmpeg -i harvest.mov -vn -acodec libfaac -ar 44100 -ab 128k -ac 2 -f mp4 outputharvest3.mp4
FFmpeg version SVN-r15920, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 3. 0 / 52. 3. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Nov 23 2008 20:30:18, gcc: 4.2.4 (Ubuntu 4.2.4-1ubuntu3)

Seems stream 0 codec frame rate differs from container frame rate: 29.97 (30000/1001) -> 15.00 (23120/1541)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'harvest.mov':
Duration: 00:00:57.78, start: 0.000000, bitrate: 1874 kb/s
Stream #0.0(eng): Video: h263, yuv420p, 352x288 [PAR 12:11 DAR 4:3], 15.00 tb(r)
Stream #0.1(eng): Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s
Output #0, mp4, to 'outputharvest3.mp4':
Stream #0.0(eng): Audio: libfaac, 44100 Hz, stereo, s16, 128 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Press [q] to stop encoding
size= 545kB time=57.70 bitrate= 77.3kbits/s
video:0kB audio:525kB global headers:0kB muxing overhead 3.810981%


Again, that worked for me, so now the last one:


will@will-laptop:~/Documents$ ffmpeg -i harvest.mov outputharvest4.aac
FFmpeg version SVN-r15920, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 3. 0 / 52. 3. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Nov 23 2008 20:30:18, gcc: 4.2.4 (Ubuntu 4.2.4-1ubuntu3)

Seems stream 0 codec frame rate differs from container frame rate: 29.97 (30000/1001) -> 15.00 (23120/1541)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'harvest.mov':
Duration: 00:00:57.78, start: 0.000000, bitrate: 1874 kb/s
Stream #0.0(eng): Video: h263, yuv420p, 352x288 [PAR 12:11 DAR 4:3], 15.00 tb(r)
Stream #0.1(eng): Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s
Output #0, adts, to 'outputharvest4.aac':
Stream #0.0(eng): Audio: libfaac, 8000 Hz, mono, s16, 64 kb/s
Stream mapping:
Stream #0.1 -> #0.0
[libfaac @ 0x885bb20]libfaac doesn't support this output format!
Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height


.....and as you can see, that's where the train stopped!

So does this tell you enough? If not, I would like to try more suggestions.

Again, thanks for the quick reply everytime.

DilfATX
November 24th, 2008, 06:30 AM
This looks like ffmpeg from Medibuntu on Ubuntu Hardy. That version uses different codec names, so "-acodec libfaac" should be "-acodec aac".

This is odd. Are you on Hardy or Intrepid? I can't replicate this error. Four more test commands:

ffmpeg -i 00060.MTS -vn -acodec libfaac -ar 48000 -ab 128k -ac 2 -f mp4 output.mp4

ffmpeg -i 00060.MTS -vn -acodec libfaac -ar 48000 -ab 128k -f mp4 output.mp4

ffmpeg -i 00060.MTS -vn -acodec libfaac -ar 44100 -ab 128k -ac 2 -f mp4 output.mp4

ffmpeg -i 00060.MTS output.aac

First like to say I sincerely appreciate the quick responses..and im going to go down this list and try them out see if one works..

BTW Im using Intrepid ubuntu 8.10

DilfATX
November 24th, 2008, 06:31 AM
Here is the output of the first command btw


rey@dilfATX:~$ ffmpeg -i 00060.MTS -vn -acodec libfaac -ar 48000 -ab 128k -ac 2 -f mp4 output.mp4
FFmpeg version SVN-r15908, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 3. 0 / 52. 3. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Nov 22 2008 12:41:12, gcc: 4.3.2
Input #0, mpegts, from '00060.MTS':
Duration: 00:02:43.64, start: 1.033367, bitrate: 17333 kb/s
Program 1
Stream #0.0[0x1011]: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 29.97 tb(r)
Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
Output #0, mp4, to 'output.mp4':
Stream #0.0: Audio: libfaac, 48000 Hz, stereo, s16, 128 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Press [q] to stop encoding
size= 2616kB time=163.61 bitrate= 131.0kbits/s
video:0kB audio:2556kB global headers:0kB muxing overhead 2.366823%
rey@dilfATX:~$


I got a 2mb file (the original .mts file is 338.2mb) and it was all audio but sounded great..

DilfATX
November 24th, 2008, 06:34 AM
This is the output of the second command


rey@dilfATX:~$ ffmpeg -i 00060.MTS -vn -acodec libfaac -ar 48000 -ab 128k -f mp4 output.mp4
FFmpeg version SVN-r15908, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 3. 0 / 52. 3. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Nov 22 2008 12:41:12, gcc: 4.3.2
Input #0, mpegts, from '00060.MTS':
Duration: 00:02:43.64, start: 1.033367, bitrate: 17333 kb/s
Program 1
Stream #0.0[0x1011]: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 29.97 tb(r)
Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
Output #0, mp4, to 'output.mp4':
Stream #0.0: Audio: libfaac, 48000 Hz, 0 channels, s16, 128 kb/s
Stream mapping:
Stream #0.1 -> #0.0
[libfaac @ 0x8d09990]encoding 0 channel(s) is not allowed
Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
rey@dilfATX:~$

DilfATX
November 24th, 2008, 06:39 AM
this is the output of the third command


rey@dilfATX:~$ ffmpeg -i 00060.MTS -vn -acodec libfaac -ar 44100 -ab 128k -ac 2 -f mp4 output.mp4
FFmpeg version SVN-r15908, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 3. 0 / 52. 3. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Nov 22 2008 12:41:12, gcc: 4.3.2
Input #0, mpegts, from '00060.MTS':
Duration: 00:02:43.64, start: 1.033367, bitrate: 17333 kb/s
Program 1
Stream #0.0[0x1011]: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 29.97 tb(r)
Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
File 'output.mp4' already exists. Overwrite ? [y/N] y
Output #0, mp4, to 'output.mp4':
Stream #0.0: Audio: libfaac, 44100 Hz, stereo, s16, 128 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Press [q] to stop encoding
size= 2612kB time=163.61 bitrate= 130.8kbits/s
video:0kB audio:2556kB global headers:0kB muxing overhead 2.175919%
rey@dilfATX:~$

this one also gave me a 2 mb audio file and also sounded good. like the other audio file there was no video.

DilfATX
November 24th, 2008, 06:39 AM
this is the output of the third command


rey@dilfATX:~$ ffmpeg -i 00060.MTS -vn -acodec libfaac -ar 44100 -ab 128k -ac 2 -f mp4 output.mp4
FFmpeg version SVN-r15908, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 3. 0 / 52. 3. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Nov 22 2008 12:41:12, gcc: 4.3.2
Input #0, mpegts, from '00060.MTS':
Duration: 00:02:43.64, start: 1.033367, bitrate: 17333 kb/s
Program 1
Stream #0.0[0x1011]: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 29.97 tb(r)
Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
File 'output.mp4' already exists. Overwrite ? [y/N] y
Output #0, mp4, to 'output.mp4':
Stream #0.0: Audio: libfaac, 44100 Hz, stereo, s16, 128 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Press [q] to stop encoding
size= 2612kB time=163.61 bitrate= 130.8kbits/s
video:0kB audio:2556kB global headers:0kB muxing overhead 2.175919%
rey@dilfATX:~$

this one also gave me a 2 mb audio file and also sounded good. like the other audio file there was no video.

DilfATX
November 24th, 2008, 06:41 AM
This is the output of the fourth command


rey@dilfATX:~$ ffmpeg -i 00060.MTS output.aac
FFmpeg version SVN-r15908, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 3. 0 / 52. 3. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Nov 22 2008 12:41:12, gcc: 4.3.2
Input #0, mpegts, from '00060.MTS':
Duration: 00:02:43.64, start: 1.033367, bitrate: 17333 kb/s
Program 1
Stream #0.0[0x1011]: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 29.97 tb(r)
Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
Output #0, adts, to 'output.aac':
Stream #0.0: Audio: libfaac, 0 channels, s16, 64 kb/s
Stream mapping:
Stream #0.1 -> #0.0
[libfaac @ 0xa0ea990]encoding 0 channel(s) is not allowed
Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
rey@dilfATX:~$

It gave me an aac file with no audio and was at 0kb

DilfATX
November 24th, 2008, 06:42 AM
This is the output of the fourth command


rey@dilfATX:~$ ffmpeg -i 00060.MTS output.aac
FFmpeg version SVN-r15908, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 3. 0 / 52. 3. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Nov 22 2008 12:41:12, gcc: 4.3.2
Input #0, mpegts, from '00060.MTS':
Duration: 00:02:43.64, start: 1.033367, bitrate: 17333 kb/s
Program 1
Stream #0.0[0x1011]: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 29.97 tb(r)
Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
Output #0, adts, to 'output.aac':
Stream #0.0: Audio: libfaac, 0 channels, s16, 64 kb/s
Stream mapping:
Stream #0.1 -> #0.0
[libfaac @ 0xa0ea990]encoding 0 channel(s) is not allowed
Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
rey@dilfATX:~$

It gave me an aac file with no audio and was at 0kb