PDA

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



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

dannyboy79
September 6th, 2010, 11:44 AM
mc4man,
thanks for trying to help but the lucid ffmpeg (with extra libs) and x264 don't work with sanub's mlt. As I tried to explian mlt needs to be built against a particular ffmpeg installed. I have tried the lucid mlt package which is .5.4 and that doesn't work either as I end up getting conflicts with dependencies of libswscale or something like that.

i have veen tried to build an older version of ffmpeg but I get compiling errors also. There must be locations of files I am not removing or something which is why I really liked the google bash script but I just wish it would do a certain revision of svn.

as a side note I get this error at the end when trying to make ffmpeg r24084, do I just continue and do the checkinstall anyway?

libswscale/rgb2rgb.c: In function ‘palette8tobgr16’:
libswscale/rgb2rgb.c:234: error: implicit declaration of function ‘av_bswap16’
make: *** [libswscale/rgb2rgb.o] Error 1

checkinstall also fails:
========================= Installation results ===========================
INSTALL libavdevice/libavdevice.a
INSTALL libavfilter/libavfilter.a
INSTALL libavformat/libavformat.a
INSTALL libavcodec/libavcodec.a
INSTALL libpostproc/libpostproc.a
CC libswscale/rgb2rgb.o
libswscale/rgb2rgb.c: In function ‘palette8tobgr16’:
libswscale/rgb2rgb.c:234: error: implicit declaration of function ‘av_bswap16’
make: *** [libswscale/rgb2rgb.o] Error 1

**** Installation failed. Aborting package creation.

Cleaning up...OK

Bye.

andrew.46
September 6th, 2010, 12:23 PM
Hmmmm.... it will be of little help in this situation but in fact mlt 0.5.4 does compile against an up to date system svn FFmpeg and in fact I have just done this. The catch being that I compiled it on Slackware (http://slackbuilds.org/repository/13.1/multimedia/mlt/), perhaps there are a few hints in this build script? I will have a shot at kdenlive in the morning and see if it all hangs together, some monster dependencies in there though....

Andrew

dannyboy79
September 6th, 2010, 12:25 PM
Hmmmm.... it will be of little help in this situation but in fact mlt 0.5.4 does compile against an up to date system svn FFmpeg and in fact I have just done this. The catch being that I compiled it on Slackware (http://slackbuilds.org/repository/13.1/multimedia/mlt/), perhaps there are a few hints in this build script? I will have a shot at kdenlive in the morning and see if it all hangs together, some monster dependencies in there though....

Andrew

i was trying to build mlt .5.6 not .5.4. I just didn't know what to use for ./configure options. i will check out the link you provided thanks. this is driving me nuts.

andrew.46
September 6th, 2010, 12:31 PM
I note in ./configure --help for mlt 5.4:


NOTE: The recommended version of FFmpeg is SVN-r21322.

There will no doubt be a similar recommendation in ./configure --help for mlt 5.6?

Edit: For mlt 5.6:



andrew@skamandros~/Desktop/mlt-0.5.6$ ./configure --help | grep 'recommended version'
NOTE: The recommended version of FFmpeg is 0.6.


Andrew

Linuxforall
September 6th, 2010, 04:19 PM
I have sunab's ppa added for KDENLIVE and I use x264 and ffmpeg as well as Mplayer via FO's and Andrew's instructions. I just applied effects via KDENLIVE to few movies and then saved them under various formats using x264 or ffmpeg and all of then worked out fine here.

dannyboy79
September 6th, 2010, 06:07 PM
I have sunab's ppa added for KDENLIVE and I use x264 and ffmpeg as well as Mplayer via FO's and Andrew's instructions. I just applied effects via KDENLIVE to few movies and then saved them under various formats using x264 or ffmpeg and all of then worked out fine here.
weird, his ffmpeg-trunk and sanub2 repos say they are for intrepid and older releases not lucid. I have tried to do it and I got a dependency error with

The following packages have unmet dependencies:
kdenlive: Depends: libavfilter-extra-0 but it is not going to be installed
E: Broken packages

what version of melt are you using? if I could see your sources.list that would be cool. I am really stuck and irritated that this isn't working anymore. Could you please let me know what version of ffmpeg you're using all libraries? Everytime I try I get a zero length file if I try to encode to xvid or x264.

mc4man
September 6th, 2010, 07:16 PM
The lucid ffmpeg (with extra libs) and x264 don't work with sanub's mlt.
Interesting because than why would he be publishing lucid packages built off of the lucid ffmpeg source. (without providing an updated ffmeg and libs.

There are 2 sunab ppa's, one just provides a mlt package and uses the lucid kdenlive version
https://launchpad.net/~sunab/+archive/ppa?field.series_filter=lucid

The other (sunab2) provides both a kdenlive and mlt package
https://launchpad.net/~sunab/+archive/sunab2/+packages?field.name_filter=&field.status_filter=published&field.series_filter=lucid

You've stated you're using the lucid kdenlive, if that's the case you should be using the stable ppa

kdenlive = 7.7.1 (from ubuntu repos)

If you're using sunab2 then you should be using his kdenlive package, not lucid's.

It's quite likely the kdenlive and mlt packakes from sunab2 will work with newer ffmpeg sources in addition to the default lucid versions

Linuxforall
September 7th, 2010, 03:31 AM
weird, his ffmpeg-trunk and sanub2 repos say they are for intrepid and older releases not lucid. I have tried to do it and I got a dependency error with

The following packages have unmet dependencies:
kdenlive: Depends: libavfilter-extra-0 but it is not going to be installed
E: Broken packages

what version of melt are you using? if I could see your sources.list that would be cool. I am really stuck and irritated that this isn't working anymore. Could you please let me know what version of ffmpeg you're using all libraries? Everytime I try I get a zero length file if I try to encode to xvid or x264.




FFmpeg version SVN-r25050, Copyright (c) 2000-2010 the FFmpeg developers
built on Sep 6 2010 23:40:30 with gcc 4.4.3
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
libavutil 50.25. 0 / 50.25. 0
libavcore 0. 6. 0 / 0. 6. 0
libavcodec 52.87. 1 / 52.87. 1
libavformat 52.78. 3 / 52.78. 3
libavdevice 52. 2. 1 / 52. 2. 1
libavfilter 1.38. 1 / 1.38. 1
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0


kdenlive installed from https://launchpad.net/~sunab/+archive/ppa

dannyboy79
September 7th, 2010, 04:19 PM
FFmpeg version SVN-r25050, Copyright (c) 2000-2010 the FFmpeg developers
built on Sep 6 2010 23:40:30 with gcc 4.4.3
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab
libavutil 50.25. 0 / 50.25. 0
libavcore 0. 6. 0 / 0. 6. 0
libavcodec 52.87. 1 / 52.87. 1
libavformat 52.78. 3 / 52.78. 3
libavdevice 52. 2. 1 / 52. 2. 1
libavfilter 1.38. 1 / 1.38. 1
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0


kdenlive installed from https://launchpad.net/~sunab/+archive/ppa
something is very different between your setup and mine then. I already tried ffmpeg from svn r25042 along with kdenlive from lucid repo an mlt from sanub repo. U say u get kdenlive from sanub repo but that ppa doesn't have kdenlive, only mlt .5.6 for lucid. There's an option to encode to h264 and aac but the file I get is zero an when I run mediainfo on it there is no info. It contains no audio or video streams.

I never checked to make sure my location I'm writing to is full but I would have thought kdenlive wouldve thru an error saying it couldn't write to that location. Will be checking that first thing when I get home from today. On my iPhone currently. Thanks for telling me that works it's just very strange it doesn't for me not to mention dan from kdenlive and sanub both have told me due to ffmpeg API freequent changes it's not smart to run ffmpeg from svn with packages from lucid repo (kdenlive) and a ppa (mlt)

mc4man
September 7th, 2010, 08:11 PM
with packages from lucid repo (kdenlive) and a ppa (mlt)
use the kdenlive from the ppa - sanab2 (linked above

dannyboy79
September 8th, 2010, 01:13 AM
use the kdenlive from the ppa - sanab2 (linked aboveyou're right, thanks

ok. i had a major brain fart and apparently kdenlive was writing zero size files because my hard drive that kdenlive was trying to save the rendered file to was full. Now I am all good. I ended up with this combination of software.

ffmpeg = medibuntu repo (SVN-r0.5.1-4:0.5.1-1ubuntu1)
libavcodec-extra-52 and all other ffmpeg libraries (4:0.5.1-1ubuntu1+medibuntu1)
mlt = sanub2 PPA (0.5.7+git20100907.c8b11129-0ubuntu0~sunab~lucid1)
kdenlive = sanub2 PPA (0.7.7.1+svn20100907.r4857-0ubuntu0~sunab~lucid1 )

I will say the new kdenlive has a slicker look and I can now see the audio wave pictoral within the timeline so I know where to cut if I am looking for a no audio point. I can now encode to x264 and aac again. I love it!!!

Peter Goldstein
September 16th, 2010, 07:39 AM
I'm running into an issue on the configure step of the ffmpeg library install. I'm on a relatively vanilla Ubuntu 10.04 install and I've confirmed that the libmp3lame-dev package is installed. When I run configure with the suggested flags I get:

ERROR: libmp3lame not found

Any thoughts?

Any help would be appreciated. Thanks.

FakeOutdoorsman
September 16th, 2010, 09:45 AM
After being throughly flamed by some developers I found out that revision 25128 (http://git.ffmpeg.org/?p=ffmpeg;a=commit;h=4cf73bf5f2ffdd3a6d72db2750fbd c623ddfc93e) caused FFmpeg to now require LAME ≥ 3.98.3 (I know better...I should have more throughly checked the commitdiff). I will update the guide tomorrow with a LAME compilation section. Until then you can omit --enable-libmp3lame. If you require mp3 audio encoding, then you can use a pipe as in:

ffmpeg -i input.foo -f wav - | lame -V5 - output.mp3

andrew.46
September 16th, 2010, 09:55 AM
Hi FakeOutdoorsman,


I will update the guide tomorrow with a LAME compilation section.

That 'rolling release' model for your guide must be looking good round about now :).

Andrew

FakeOutdoorsman
September 16th, 2010, 10:11 AM
Hi FakeOutdoorsman,

That 'rolling release' model for your guide must be looking good round about now :).

Andrew

Hi Andrew,

Yes, definitely. As you've probably noticed a few of my Lucid updates never made it to the earlier guides.

Perhaps starting with 10.10 I will begin the 'rolling release' model. Thoughts?

For those wondering what Andrew and I are talking about see Howto: Build the svn MPlayer under the latest release version of Ubuntu (http://ubuntuforums.org/showthread.php?t=1542240) for an example.

andrew.46
September 16th, 2010, 11:00 AM
Hi FakeOutdoorsman,


Perhaps starting with 10.10 I will begin the 'rolling release' model. Thoughts?

It is a difficult question. I admire the way that you have covered so many releases of Ubuntu in a single guide and I am sure that this is at least part of the reason that your guide is so successful. Having said that I am sure there is a significant workload involved in keeping so many Ubuntu releases covered, the change in the rules with lame being a perfect example.

I will be interested to hear the thoughts of others who use your guide :).

Andrew

verb3k
September 16th, 2010, 04:56 PM
I will be interested to hear the thoughts of others who use your guide :).

Andrew

FakeOutdoorsman should be in the FFmpeg Hall of Fame by now :)
He really contributed a lot to uplift the state of multimedia handling/encoding for users of ubuntu and other distros. He's always provided support to people on the forums, mailing list and IRC.

I personally am very grateful to FakeOutdoorsman, and would like to thank him very warmly for everything.

FakeOutdoorsman
September 16th, 2010, 08:11 PM
I will update the guide tomorrow
Updated with a new LAME section. I took a slightly different approach to this package since so many repository packages depend on LAME. It will probably work fine alongside the repository LAME, but I didn't test that very much. I'm not sure if the method I used is the best way to go, but I think it will work for now. Perhaps Andrew's method in Howto: Build the development version of vlc under Ubuntu (http://ubuntuforums.org/showthread.php?t=1398119) is the best way to provide external libraries for FFmpeg while not replacing any official repository packages. Ahhh...package management. So boring. Let's just get to the encoding already.


FakeOutdoorsman should be in the FFmpeg Hall of Fame by now :)
He really contributed a lot to uplift the state of multimedia handling/encoding for users of ubuntu and other distros. He's always provided support to people on the forums, mailing list and IRC.

I personally am very grateful to FakeOutdoorsman, and would like to thank him very warmly for everything.
Thanks! Much appreciated.

DragGon7601
September 16th, 2010, 08:30 PM
The FFMpeg from the repository don't read some of the files I have (encoded in a newer x264 codec, I think).

The FFMpeg I get from this has trouble with the commands I give it. E.g it complains about not knowing what todo with the '-title "Movie name"' I was using, tried '-metadata title="my title"' but then all I got was the file name on my PSP (not the title I had given it).

If I change the '--pkgname=ffmpeg' part of the checkinstall command to '--pkgname=ffmpeg2' would it change the command line I use? Would I be able to use the Repository one with 'FFMpeg -i input.avi something.mp4' and the one I get from this guide with 'FFMpeg2 -i input.avi something.mp4'... Would they have some other conflict?

FakeOutdoorsman
September 17th, 2010, 02:38 AM
The FFMpeg from the repository don't read some of the files I have (encoded in a newer x264 codec, I think).
An older FFmpeg could be able to decode video form a newer x264. Can you show your command and the complete output?


The FFMpeg I get from this has trouble with the commands I give it. E.g it complains about not knowing what todo with the '-title "Movie name"'
This option was basically renamed to what you're using below.


I was using, tried '-metadata title="my title"' but then all I got was the file name on my PSP (not the title I had given it).
Can you show your command and the complete output? I don't own a PSP, so I'm not sure why it won't accept the title.


If I change the '--pkgname=ffmpeg' part of the checkinstall command to '--pkgname=ffmpeg2' would it change the command line I use?
Sorry. I don't understand what you are asking.


Would I be able to use the Repository one with 'FFMpeg -i input.avi something.mp4' and the one I get from this guide with 'FFMpeg2 -i input.avi something.mp4'... Would they have some other conflict?
You can probably have both the repository version and a compiled FFmpeg on the same system. Just change the pkgname to something else like ffmpeg-svn (you'll probably want to do the same for x264, as in x264-git). By default, the ffmpeg command in your terminal will use the compiled ffmpeg in /usr/local/bin, but you can use an absolute path if you want to access the repository ffmpeg. Example:

/usr/bin/ffmpeg -i input ...

ron999
September 17th, 2010, 04:23 PM
Hi fakeoutdoorsman

I saw your reply at post #1263 above.
Today when I tried to update ffmpeg from version SVN-r24802 I had the same config error libmp3lame >=3.98 not found.

I went back to the beginning of the thread and installed lame-ffmpeg v3.98.4 following step 5.
This has definitely installed lame-ffmpeg in Synaptic, but I still got the config error.
I don't really understand what good this has done.

Since then I've downloaded and installed libmp3lame0_3.98.4-0.0_i386.deb and libmp3lame-dev_3.98.4-0.0_i386.deb
From here:-http://debian-multimedia.org/pool/main/l/lame/lame.php"]http://debian-multimedia.org/pool/main/l/lame/lame.php

Now ffmpeg has compiled OK.:D

Please will you explain about step 5.:confused:


ron@ubuntu:~$ ffmpeg -h
FFmpeg version SVN-r25140, Copyright (c) 2000-2010 the FFmpeg developers
built on Sep 17 2010 16:11:20 with gcc 4.4.1
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --disable-encoder=vorbis

mc4man
September 17th, 2010, 05:01 PM
This has definitely installed lame-ffmpeg in Synaptic, but I still got the config error.

Even though /usr/local usually trumps /usr. in this case make sure the you've uninstalled the previous libmp3lame-dev package

ron999
September 17th, 2010, 05:42 PM
OK mc4man

But now I have got installed:-
lame-3.98.4-0
lame-ffmpeg-3.98.4-1
libmp3lame0-3.98.4-0
libmp3lame-dev-3.98.4-0

So is that package lame-ffmpeg-3.98.4-1 now redundant?
If I un-install it will ffmpeg work OK using those other packages instead?

FakeOutdoorsman
September 17th, 2010, 06:30 PM
Please will you explain about step 5.:confused:
I needed to add LAME compilation because a recent FFmpeg revision requires a LAME that is newer than what is available in the repository. Note that I have not tested anything on Karmic yet, but I doubt it would be much different. I'm not sure why it did not work for you, but I'll fire up the Karmic VM and try it there too.

I'd be careful using stuff from debian-multimedia. Just keep in mind that you have packages from there if things go wrong.


Even though /usr/local usually trumps /usr. in this case make sure the you've uninstalled the previous libmp3lame-dev package
For Lucid, I made sure that I left the previous libmp3lame-dev from the repository to see if it would interfere with the installation, but it did not seem to, so I didn't add any note to remove it although it's probably a good idea. I'll add that to the guide.

FakeOutdoorsman
September 17th, 2010, 07:09 PM
Karmic guide updated. There are a few differences with Karmic compared to Lucid:
I had to remove --enable-nasm from the LAME ./configure or I would encounter make errors.
libmp3lame-dev interferes with LAME detection when running ./configure in FFmpeg.

mc4man
September 17th, 2010, 07:14 PM
There are a few differences with Karmic

That's what I also noticed, had tried the lame deal on karmic to match what what Ron was using.


I'd be careful using stuff from debian-multimedia...

Extremely good advice, the lame packages (at current builds) are probably ok, if they're updated I'd be wary.

ron999
September 17th, 2010, 07:25 PM
Right thanks.
I'll stay with these Debian packages for now then.
If I hit any problems I'll revert to the repo versions and lame-ffmpeg.
:D

spacechampion
September 17th, 2010, 09:28 PM
I seemed to install the qt-faststart fine, but I get an error when I try to run it:

sh: qt-faststart: not found

I'm sure it is simple issue, but I don't know what to do about it. Is the installation instructions assuming we know how to make qt-faststart executable from any directory? Or does it assume I am in a particular directory? How do I get it to know where to find it?

FakeOutdoorsman
September 17th, 2010, 09:34 PM
The old libx264 presets have been removed today from FFmpeg SVN which include: default, fastfirstpass, hq, max, normal, and slowfirstpass.

If you were using one of these presets and want to update FFmpeg, then you will need to use one of the newer presets that are modeled after the official x264 presets.

You can see what presets that are available to you in the /usr/local/share/ffmpeg directory.

FakeOutdoorsman
September 17th, 2010, 09:49 PM
I seemed to install the qt-faststart fine, but I get an error when I try to run it:

sh: qt-faststart: not found

I'm sure it is simple issue, but I don't know what to do about it. Is the installation instructions assuming we know how to make qt-faststart executable from any directory? Or does it assume I am in a particular directory? How do I get it to know where to find it?

Are you using Ubuntu? If yes, what version are you using? I would expect to see bash, not sh. qt-faststart should be executable from any directory if it installed correctly.

$ whereis qt-faststart
qt-faststart: /usr/local/bin/qt-faststart

spacechampion
September 18th, 2010, 04:55 AM
Are you using Ubuntu? If yes, what version are you using? I would expect to see bash, not sh. qt-faststart should be executable from any directory if it installed correctly.

$ whereis qt-faststart
qt-faststart: /usr/local/bin/qt-faststart


Yes, Ubuntu 10.04.

I did the whereis command and only received the following


$ whereis qt-faststart
qt-faststart:So I guess it is not installed.

By the way, when I was using your terrific guide at the top of this thread for Lucid, I would get an error saying something like "y is not a valid something something for deldoc" (sorry, I can't remember the exact error and it was several hours ago). I didn't use "--deldoc=y" I used "--deldoc=yes" as you have it, so I don't understand that error.

I tried to install ffmpeg and qt-faststart without the --deldoc=yes switch. ffmpeg works for me, it's just qt-faststart that doesn't.

Edit to add: figured it out -- I cut off the end of the checkinstall line when I pasted it, thinking the "> >" printed needed to be deleted. Same issue with what I did with the qt-faststart below.

spacechampion
September 18th, 2010, 05:30 AM
edited this post to remove my install log since below I figured out what happened.

spacechampion
September 18th, 2010, 05:34 AM
Arg. Now I see what happened. Apparently the file was misnamed somehow -- once just now, and again earlier today.

In /usr/local/bin

-rwxr-xr-x 1 root root 10472 2010-09-18 00:27 qt-fasts
-rwxr-xr-x 1 root root 20310 2010-09-17 15:51 qt-faststa


Dumb mistake, I cut off the end of the line when pasting.

andrew.46
September 18th, 2010, 12:33 PM
Hi FakeOutdoorsman,

Congratulations on your work again appearing in the FFmpeg source:



andrew@skamandros~$ svn log -r 25142 svn://svn.mplayerhq.hu/ffmpeg/trunk
------------------------------------------------------------------------
r25142 | darkshikari | 2010-09-18 06:14:24 +1000 (Sat, 18 Sep 2010) | 7 lines

Remove legacy x264 presets

Since we now have the official x264 presets in ffmpeg, there's no reason to
keep around the old ones.

Patch by Lou Logan <lou AT fakeoutdoorsman DOT com>.

------------------------------------------------------------------------


All the best,

Andrew

FakeOutdoorsman
September 18th, 2010, 06:14 PM
Thanks, but my patches are incredibly simple. This one deleted some files. You can always find something interesting when trawling the logs.

Henrikx
September 19th, 2010, 01:53 PM
FFmpeg version SVN-r25146 needs > lame-3.98.2

deinstall - libmp3lame0-dev_3.98.2+debian-0ubuntu3_i386.deb

Download Lame ( (http://lame.sourceforge.net/)lame-3.98.4.tar.gz)

Unpack lame-3.98.4.tar.gz
edit /lame-3.98.4/debian/changlog

first line
lame (3.98.4+debian-0ubuntu3) unstable; urgency=low
save changelog

Open Terminal
cd /lame-3.98.4
dpkg-buildpackage -b


After compiling the three packages are to be installed.

libmp3lame0_3.98.4+debian-0ubuntu3_i386.deb
lame_3.98.4+debian-0ubuntu3_i386.deb
libmp3lame0-dev_3.98.4+debian-0ubuntu3_i386.deb


Install with sudo dpkg -i *.deb

ron999
September 19th, 2010, 03:01 PM
Hi Hendrikx
I followed your instructions.

When I tried to compile there was an error:-


ron@ubuntu:~$ cd /home/ron/Downloads/lame-3.98.4
ron@ubuntu:~/Downloads/lame-3.98.4$ dpkg-buildpackage -b
dpkg-buildpackage: set CFLAGS to default value: -g -O2
dpkg-buildpackage: set CPPFLAGS to default value:
dpkg-buildpackage: set LDFLAGS to default value: -Wl,-Bsymbolic-functions
dpkg-buildpackage: set FFLAGS to default value: -g -O2
dpkg-buildpackage: set CXXFLAGS to default value: -g -O2
dpkg-buildpackage: source package lame
dpkg-buildpackage: source version 3.98.4+debian-0ubuntu3
dpkg-buildpackage: source changed by Rogério Brito <rbrito@users.sf.net>
dpkg-buildpackage: host architecture i386
dpkg-checkbuilddeps: Unmet build dependencies: libsndfile1-dev
dpkg-buildpackage: warning: Build dependencies/conflicts unsatisfied; aborting.

So I went into Synaptic and installed libsndfile1-dev.

After that, everything went OK.

Thanks
:guitar:

karmila
September 20th, 2010, 08:27 AM
Is this guide applicable to maverick?

FakeOutdoorsman
September 20th, 2010, 06:11 PM
This guide has moved to the official FFmpeg wiki:

How to Compile FFmpeg and x264 on Ubuntu Lucid Lynx 10.04 (https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuideLucid)

FakeOutdoorsman
September 20th, 2010, 06:26 PM
Is this guide applicable to maverick?

Yes. Fortunately Maverick is easier and has fewer steps than Lucid because it has newer packages in the repository. The first page of this thread has been changed to Maverick and Lucid has been "archived".

I suppose I'll continue to create a page for each Ubuntu release, but I can't guarantee support for all of them...but the rolling release model is still tempting (just like the distros).

karmila
September 20th, 2010, 08:14 PM
Yes. Fortunately Maverick is easier and has fewer steps than Lucid because it has newer packages in the repository. The first page of this thread has been changed to Maverick and Lucid has been "archived".

I suppose I'll continue to create a page for each Ubuntu release, but I can't guarantee support for all of them...but the rolling release model is still tempting (just like the distros).

Thanks :P

Yes, I hope ubuntu has rolling release too. No need to hassle every 6 months to get newer features.

karmila
September 20th, 2010, 11:00 PM
OOOps.. :P

Installing it on Maverick, and done with no error.

It's a really handy guide!

Cavsfan
September 20th, 2010, 11:06 PM
I probably should have left well enough alone, but I tried re-installing it and am getting this error:


cavsfan@cavsfan-desktop:~$ cd ffmpeg
cavsfan@cavsfan-desktop:~/ffmpeg$ ./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc \
> --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb \
> --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid \
> --enable-x11grab --enable-libmp3lame --enable-libvpx
ERROR: libmp3lame >= 3.98.3 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.log" produced by configure as this will help
solving the problem.
cavsfan@cavsfan-desktop:~/ffmpeg$
And I cannot figure out Henrikx's way of fixing it. It doesn't work for me.
Much appreciation!

FakeOutdoorsman
September 20th, 2010, 11:42 PM
Are you using Lucid? I just moved the Lucid version of the guide to it's own page here:

Install FFmpeg and x264 on Ubuntu Lucid Lynx 10.04 (http://ubuntuforums.org/showpost.php?p=9868359&postcount=1289)

The first page of this guide is now for Ubuntu Maverick Meerkat 10.10.

Henrikx
September 21st, 2010, 07:25 AM
sudo apt-get remove libmp3lame-dev sudo apt-get install nasm cd wget http://downloads.sourceforge.net/project/lame/lame/3.98.4/lame-3.98.4.tar.gz tar xzvf lame-3.98.4.tar.gz cd lame-3.98.4 ./configure --enable-nasm --disable-shared make sudo checkinstall --pkgname=lame-ffmpeg --pkgversion="3.98.4" --backup=no --default \ --deldoc=yesBut for mplayer you need the dev again, the same with x264.

Why not dpkg-buildpackage -b

libmp3lame0_3.98.4+debian-0ubuntu3_i386.deb
lame_3.98.4+debian-0ubuntu3_i386.deb
libmp3lame0-dev_3.98.4+debian-0ubuntu3_i386.deb

andrew.46
September 21st, 2010, 08:33 AM
Hi Henrikx,


But for mplayer you need the [lame] dev again, the same with x264.

It is a little aside from your main point but libmp3lame-dev and the x264 -dev files are only required if you plan to build MEncoder as well as MPlayer. My apologies for nitpicking...

Andrew

Henrikx
September 21st, 2010, 08:50 AM
Maybe we could work all together, to find out how to debianize (so written?) ffmpeg, x264, etc...

Cavsfan
September 21st, 2010, 05:54 PM
Are you using Lucid? I just moved the Lucid version of the guide to it's own page here:

Install FFmpeg and x264 on Ubuntu Lucid Lynx 10.04 (http://ubuntuforums.org/showpost.php?p=9868359&postcount=1289)

The first page of this guide is now for Ubuntu Maverick Meerkat 10.10.

Yes, I am on Lucid 64 bit, and I did go by the instructions on the Lucid page.
Right now I do not even have ffmpeg or x264 or any of that installed. I think the
process stopped when I hit the above error.
I should probably not have un-installed and tried to reinstall, but now that I did,
I hope I can get it back per your How To. Maybe I can work out any bugs on the
Lucid 64 bit aspect of it.
Thanks for putting out this great How to! :)
And thanks for tolerating my noobishness in this matter!

PS I was also trying to install all options including the 2 optional ones.

FakeOutdoorsman
September 21st, 2010, 07:13 PM
Include the log file "config.log" produced by configure as this will help solving the problem.

Do you see any useful information in "config.log"? Usually the tail end of the file contains the errors.

Cavsfan
September 21st, 2010, 08:45 PM
Do you see any useful information in "config.log"? Usually the tail end of the file contains the errors.

The stuff at the end of /home/cavsfan/ffmpeg/config.log


BEGIN /tmp/ffconf.2bKa1JbZ.c
1
2 #include <stdint.h>
3 #include <faac.h>
4 int main(int argc, char **argv){
5 return (long) faacEncGetVersion;
6 }
END /tmp/ffconf.2bKa1JbZ.c
gcc -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -std=c99 -fomit-frame-pointer -pthread -c -o /tmp/ffconf.1n7REKLU.o /tmp/ffconf.2bKa1JbZ.c
gcc -o /tmp/ffconf.MlOnm92N /tmp/ffconf.1n7REKLU.o -lm -pthread -lz -lfaac
check_lib lame/lame.h hip_decode_init -lmp3lame
check_header lame/lame.h
check_cpp
BEGIN /tmp/ffconf.2bKa1JbZ.c
1 #include <lame/lame.h>
2 int x;
END /tmp/ffconf.2bKa1JbZ.c
gcc -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -std=c99 -fomit-frame-pointer -pthread -E -o /tmp/ffconf.1n7REKLU.o /tmp/ffconf.2bKa1JbZ.c
/tmp/ffconf.2bKa1JbZ.c:1:23: error: lame/lame.h: No such file or directory
ERROR: libmp3lame >= 3.98.3 not foundAnd the contents of /home/cavsfan/x264/config.log as it was new I believe

x264 configure script

checking whether gcc works... yes
checking for -std=gnu99... yes
checking whether yasm supports lzcnt eax, eax... yes
checking whether gcc supports __asm__("pabsw %xmm0, %xmm0");... yes
checking for pthread.h... yes
checking for return log2f(2); in math.h... yes
checking for sws_getContext(0,0,0,0,0,0,0,0,0,0); in libswscale/swscale.h... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -Wall -I. -std=gnu99 -lswscale -lavutil -lm -lpthread
conftest.c:1:32: error: libswscale/swscale.h: No such file or directory
conftest.c: In function ‘main’:
conftest.c:2: warning: implicit declaration of function ‘sws_getContext’
--------------------------------------------------
checking for -lpostproc... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -Wall -I. -std=gnu99 -lpostproc -lm -lpthread
/usr/bin/ld: cannot find -lpostproc
collect2: ld returned 1 exit status
--------------------------------------------------
checking for -lavcodec... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -Wall -I. -std=gnu99 -lavcodec -lm -lpthread
/usr/bin/ld: cannot find -lavcodec
collect2: ld returned 1 exit status
--------------------------------------------------
checking for -lavcore... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -Wall -I. -std=gnu99 -lavcore -lm -lpthread
/usr/bin/ld: cannot find -lavcore
collect2: ld returned 1 exit status
--------------------------------------------------
checking for -lswscale... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -Wall -I. -std=gnu99 -lswscale -lm -lpthread
/usr/bin/ld: cannot find -lswscale
collect2: ld returned 1 exit status
--------------------------------------------------
checking for -lavutil... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -Wall -I. -std=gnu99 -lavutil -lm -lpthread
/usr/bin/ld: cannot find -lavutil
collect2: ld returned 1 exit status
--------------------------------------------------
checking for -lm... yes
checking for -lz... yes
checking for -lbz2... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -Wall -I. -std=gnu99 -lbz2 -lm -lpthread
/usr/bin/ld: cannot find -lbz2
collect2: ld returned 1 exit status
--------------------------------------------------
checking for -lpthread... yes
checking for -lavifil32... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -Wall -I. -std=gnu99 -lavifil32 -lm -lpthread
/usr/bin/ld: cannot find -lavifil32
collect2: ld returned 1 exit status
--------------------------------------------------
checking for avcodec_decode_video2(0,0,0,0); in libavformat/avformat.h... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -Wall -I. -std=gnu99 -L. -lavformat -lm -lz -lpthread -lm -lpthread
conftest.c:1:34: error: libavformat/avformat.h: No such file or directory
conftest.c: In function ‘main’:
conftest.c:2: warning: implicit declaration of function ‘avcodec_decode_video2’
--------------------------------------------------
checking for FFMS_DestroyVideoSource(0); in ffms.h... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -Wall -I. -std=gnu99 -lffms2 -lm -lpthread
conftest.c:1:18: error: ffms.h: No such file or directory
conftest.c: In function ‘main’:
conftest.c:2: warning: implicit declaration of function ‘FFMS_DestroyVideoSource’
--------------------------------------------------
checking for FFMS_DestroyVideoSource(0); in ffms.h... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -Wall -I. -std=gnu99 -lffms2 -lstdc++ -L. -lavformat -lm -lz -lpthread -lm -lpthread
conftest.c:1:18: error: ffms.h: No such file or directory
conftest.c: In function ‘main’:
conftest.c:2: warning: implicit declaration of function ‘FFMS_DestroyVideoSource’
--------------------------------------------------
checking for gpac/isomedia.h... no
Failed commandline was:
--------------------------------------------------
gcc conftest.c -Wall -I. -std=gnu99 -lgpac_static -lm -lpthread
conftest.c:1:27: error: gpac/isomedia.h: No such file or directory
--------------------------------------------------
checking for -fno-tree-vectorize... yes
checking for fseeko(stdin,0,0); in stdio.h... yes
checking for -Wshadow... yes

Platform: X86_64
System: LINUX
asm: yes
avs: no
lavf: no
ffms: no
gpac: no
pthread: yes
filters: crop select_every
debug: no
gprof: no
PIC: no
shared: no
visualize: no
bit depth: 8
I think it stopped at this error and nothing got installed "ERROR: libmp3lame >= 3.98.3 not found"
Thanks!

FakeOutdoorsman
September 21st, 2010, 11:21 PM
x264 should install fine without any lame packages. As for FFmpeg, you should make sure lame installed properly. Did the Install LAME (optional) step fail for you?

Also, don't forget to make distclean when performing an update as shown in the Updating FFmpeg and x264 section.

Cavsfan
September 22nd, 2010, 03:00 PM
x264 should install fine without any lame packages. As for FFmpeg, you should make sure lame installed properly. Did the Install LAME (optional) step fail for you?

Also, don't forget to make distclean when performing an update as shown in the Updating FFmpeg and x264 section.

I guess x264 is installed, but not ffmpeg. Let me take a look at what you're suggesting.
Thanks!

Cavsfan
September 22nd, 2010, 03:33 PM
Everything went well that time! Thanks a lot! :guitar:

FakeOutdoorsman
September 23rd, 2010, 01:28 AM
Why not dpkg-buildpackage -b

I've never used this myself. Why do you prefer this over checkinstall? Checkinstall has it's annoyances, but it seems to work fine for packages that aren't going to be re-distributed (like the ones from this guide) and doesn't require editing of a changelog. I suppose sed would be useful in this case, but I don't have much experience there.

mc4man
September 23rd, 2010, 04:41 AM
I've never used this myself. Why do you prefer this over checkinstall? Checkinstall has it's annoyances, but it seems to work fine for packages that aren't going to be re-distributed (like the ones from this guide)

There can be some small advantages though for the most part nothing that would be 'generally' better.
I do a set of certain sources once or twice an install as .debs but again some of the reasons are of low use for most
(like keeping a local repo which again has some advantages and makes a re-install, if needed, quite simple and quick.

Certainly with ffmpeg at some point some users will create issues if continually built as shared.

I'd think things are good as currently done (w/checkinstall



and doesn't require editing of a changelog. I suppose sed would be useful in this case, but I don't have much experience there.

There are some interesting ways there though a manual edit is also quite easy.
(though in this case (current lame), there is actually no need to to have the package named ..4 for karmic or lucid, the .3 will do and the lib is ...4 anyway
Also if there is a suggestion to do as .debs much better to have the user create a build folder, otherwise could be confusing w/ stuff loose in home.

As an ex. - only if one had devscripts installed -
(and installing devscripts may be confusing to some, nothing actually needs to be entered, just navigating thru
(blue can stay as is or be made legit, add. "<whatever>" can be added to debchange when desired, each is new line in changelog


mkdir lame && cd lame && \
wget http://downloads.sourceforge.net/project/lame/lame/3.98.4/lame-3.98.4.tar.gz && \
tar xzvf lame-3.98.4.tar.gz && cd lame-3.98.4 && \
export DEBEMAIL="noone@nowhere.com" && \
debchange -v 3.98.4+nmu1 "new upstream release" && \
debuild -us -uc && cd .. && \
sudo dpkg -i *.deb

camslaz
September 23rd, 2010, 11:06 PM
Hi all, I am not sure if this is the right place to post this issue but here it is...

Basically I am running a php script that encodes a 250Mb MOV file into 14 videos of different frame sizes and formats. The script takes over 10mins to run and after a period of time FFMPEG crashes with a "av_interleaved_write_frame(): Operation not permitted" error on one of the videos.

From all the investigation I have done with this issue, the error is normally accompanied with a reason of something like "error, non monotone timestamps xxxxxx >= yyyyy". In my case it is not... it actually starts to encode the file and then crashes after a period of time with "av_interleaved_write_frame(): Operation not permitted". The other thing to mention is that If I encode the individual file via the command line or even via a php script it does not error and encodes with no problems.

It always crashes around the 10min mark so I don't know if it is related to timestamps, a server config issue or an FFMPEG bug. It will encode 10 videos or more up to the point it crashes with no issue... from there the script will continue through the remaining videos to be encoded but all remaining videos have the 'av_interleaved_write_frame(): Operation not permitted' error.

Has anyone experienced an issue similar to this or have any idea why I might be experiencing it. Thanks in advance.



0 => 'FFmpeg version SVN-r24545, Copyright (c) 2000-2010 the FFmpeg developers',
1 => ' built on Aug 20 2010 23:32:02 with gcc 4.1.2 20080704 (Red Hat 4.1.2-48)',
2 => ' configuration: --enable-shared --enable-gpl --enable-pthreads --enable-nonfree --cpu=opteron --extra-cflags=\'-O3 -march=opteron -mtune=opteron\' --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-avfilter --enable-filter=movie --enable-avfilter-lavf --enable-swscale',
3 => ' libavutil 50.23. 0 / 50.23. 0',
4 => ' libavcore 0. 1. 0 / 0. 1. 0',
5 => ' libavcodec 52.84. 1 / 52.84. 1',
6 => ' libavformat 52.77. 0 / 52.77. 0',
7 => ' libavdevice 52. 2. 0 / 52. 2. 0',
8 => ' libavfilter 1.26. 1 / 1.26. 1',
9 => ' libswscale 0.11. 0 / 0.11. 0',
10 => 'Input #0, mov,mp4,m4a,3gp,3g2,mj2, from \'/home/hdfootage/public_html/process/VideoEncode/_tmpfiles/GVowbt3vsrXL/GVowbt3vsrXL.mov\':',
11 => ' Metadata:',
12 => ' major_brand : qt',
13 => ' minor_version : 537199360',
14 => ' compatible_brands: qt',
15 => ' Duration: 00:00:20.00, start: 0.000000, bitrate: 110802 kb/s',
16 => ' Stream #0.0(eng): Video: mjpeg, yuvj422p, 1920x1080 [PAR 72:72 DAR 16:9], 109386 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc',
17 => ' Stream #0.1(eng): Audio: pcm_s16be, 44100 Hz, 2 channels, s16, 1411 kb/s',
18 => '[buffer @ 0x1db8ed0] w:1920 h:1080 pixfmt:yuvj422p',
19 => '[unsharp @ 0x1de63e0] auto-inserting filter \'auto-inserted scaler 0\' between the filter \'src\' and the filter \'Filter 0 unsharp\'',
20 => '[scale @ 0x1de3860] w:1920 h:1080 fmt:yuvj422p -> w:1920 h:1080 fmt:yuv420p flags:0xa0000004',
21 => '[unsharp @ 0x1de63e0] effect:sharpen type:luma msize_x:5 msize_y:5 amount:1.00',
22 => '[unsharp @ 0x1de63e0] effect:none type:chroma msize_x:0 msize_y:0 amount:0.00',
23 => 'Output #0, mp4, to \'/home/hdfootage/public_html/process/VideoEncode/_tmpfiles/GVowbt3vsrXL/GVowbt3vsrXL_4.mp4\':',
24 => ' Metadata:',
25 => ' encoder : Lavf52.77.0',
26 => ' Stream #0.0(eng): Video: mpeg4, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 tbn, 25 tbc',
27 => ' Stream #0.1(eng): Audio: aac, 44100 Hz, 2 channels, s16, 64 kb/s',
28 => 'Stream mapping:',
29 => ' Stream #0.0 -> #0.0',
30 => ' Stream #0.1 -> #0.1',
31 => 'Press [q] to stop encoding',
32 => 'frame= 3 fps= 0 q=1.0 size= 595kB time=0.12 bitrate=40602.0kbits'
33 => 'frame= 6 fps= 6 q=1.0 size= 1060kB time=0.24 bitrate=36190.5kbits'
34 => 'frame= 9 fps= 6 q=1.0 size= 1554kB time=0.36 bitrate=35354.9kbits'
35 => 'frame= 12 fps= 6 q=1.0 size= 2071kB time=0.48 bitrate=35349.8kbits'
36 => 'frame= 15 fps= 6 q=1.0 size= 2721kB time=0.60 bitrate=37149.7kbits'
37 => 'frame= 18 fps= 6 q=1.0 size= 3224kB time=0.72 bitrate=36683.2kbits'
38 => 'frame= 21 fps= 6 q=1.0 size= 3722kB time=0.84 bitrate=36298.9kbits'
39 => 'frame= 24 fps= 6 q=1.0 size= 4219kB time=0.96 bitrate=36004.3kbits'
40 => 'frame= 27 fps= 6 q=1.0 size= 4882kB time=1.08 bitrate=37033.4kbits'
41 => 'frame= 30 fps= 6 q=1.0 size= 5342kB time=1.20 bitrate=36467.2kbits'
42 => 'frame= 33 fps= 6 q=1.0 size= 5803kB time=1.32 bitrate=36015.0kbits'
43 => 'frame= 36 fps= 6 q=1.0 size= 6294kB time=1.44 bitrate=35804.1kbits'

croped

210 => 'frame= 452 fps= 6 q=1.0 size= 77197kB time=18.08 bitrate=34977.8kbits'
211 => 'frame= 455 fps= 6 q=1.0 size= 77690kB time=18.20 bitrate=34969.3kbits'
212 => 'frame= 458 fps= 6 q=1.0 size= 78328kB time=18.32 bitrate=35025.3kbits'
213 => 'frame= 461 fps= 6 q=1.0 size= 78832kB time=18.44 bitrate=35021.1kbits'
214 => 'frame= 464 fps= 6 q=1.0 size= 79348kB time=18.56 bitrate=35022.7kbits'
215 => 'frame= 467 fps= 6 q=1.0 size= 79802kB time=18.68 bitrate=34996.6kbits'
216 => 'frame= 470 fps= 6 q=1.0 size= 80424kB time=18.80 bitrate=35044.4kbits'
217 => 'frame= 473 fps= 6 q=1.0 size= 80944kB time=18.92 bitrate=35047.2kbits'
218 => 'frame= 476 fps= 6 q=1.0 size= 81534kB time=19.04 bitrate=35080.0kbits'
219 => 'frame= 479 fps= 6 q=1.0 size= 82078kB time=19.16 bitrate=35093.2kbits'
220 => 'av_interleaved_write_frame(): Operation not permitted'

FakeOutdoorsman
September 24th, 2010, 12:15 AM
It appears to me that FFmpeg is not the culprit, but it will be easier to guess what is going on if you provide the PHP script or a sample command at the very least. Does the error occur consistently? Have you tried it on another machine? Do you encounter the error with certain input/output formats?

You can increase the output verbosity of FFmpeg with:

ffmpeg -v 9 -loglevel 99 -i foo ...
This may provide additional clues.

camslaz
September 24th, 2010, 08:05 AM
Sorry about that... I thought I had included the command. This is an example of one of the commands. It just loops through the script for 4 different frame sizes with 3 different output formats (mov, mp4 and wmv). This is an example of the mp4 version, the others just have different frame sizes and output type.

/usr/local/bin/ffmpeg -i GVowbt3vsrXL.mov -s 1920x1080 -sameq -vf "unsharp" -y GVowbt3vsrXL_4.mp4

Yes it consistently fails on the same encoding video when running the script but not always on exactly the same frame... although always fairly close. It also depends on the size of the input video as to which encoding video it will fail on. But regardless if I run the script again using the same input file it was always fails at almost the same point each time for that input video. Note that this only happens for larger files... I do not have a problem when encoding < 200mb files. If I try with larger files it consistently fails.

I haven't tried it on another machine... I have numerous RS cloud servers all set up with centos so I would assume they would react the same. It is something I can try though.

I encounter the error at any point in the encoding... so it will be mp4, wmv, thumbnails or flv files... it just seems to be when ever the script hits a certain limit it crashes.

Increasing the verbosity of FFMPEG command didn't really point to any real issue... maybe you will see differently. This is an extract of the output just before the crash


15675 => '[mjpeg @ 0x1d86950] qscale[0]: 1',
15676 => '[mjpeg @ 0x1d86950] index=1',
15677 => '[mjpeg @ 0x1d86950] qscale[1]: 1',
15678 => '[mjpeg @ 0x1d86950] marker parser used 132 bytes (1056 bits)',
15679 => '[mjpeg @ 0x1d86950] marker=c4 avail_size_in_buf=536289',
15680 => '[mjpeg @ 0x1d86950] class=0 index=0 nb_codes=12',
15681 => '[mjpeg @ 0x1d86950] class=0 index=1 nb_codes=12',
15682 => '[mjpeg @ 0x1d86950] class=1 index=0 nb_codes=251',
15683 => '[mjpeg @ 0x1d86950] class=1 index=1 nb_codes=251',
15684 => '[mjpeg @ 0x1d86950] marker parser used 418 bytes (3344 bits)',
15685 => '[mjpeg @ 0x1d86950] marker=c0 avail_size_in_buf=535869',
15686 => '[mjpeg @ 0x1d86950] sof0: picture: 1920x1080',
15687 => '[mjpeg @ 0x1d86950] component 0 2:1 id: 0 quant:0',
15688 => '[mjpeg @ 0x1d86950] component 1 1:1 id: 1 quant:1',
15689 => '[mjpeg @ 0x1d86950] component 2 1:1 id: 2 quant:1',
15690 => '[mjpeg @ 0x1d86950] pix fmt id 21111100',
15691 => '[mjpeg @ 0x1d86950] marker parser used 17 bytes (136 bits)',
15692 => '[mjpeg @ 0x1d86950] marker=da avail_size_in_buf=535850',
15693 => '[mjpeg @ 0x1d86950] escaping removed 2482 bytes',
15694 => '[mjpeg @ 0x1d86950] component: 0',
15695 => '[mjpeg @ 0x1d86950] component: 1',
15696 => '[mjpeg @ 0x1d86950] component: 2',
15697 => '[mjpeg @ 0x1d86950] marker parser used 533367 bytes (4266935 bits)',
15698 => '[mjpeg @ 0x1d86950] marker=d9 avail_size_in_buf=0',
15699 => '[mjpeg @ 0x1d86950] mjpeg decode frame unused 0 bytes',
15700 => '[mjpeg @ 0x1d86950] marker=d8 avail_size_in_buf=535298',
15701 => '[mjpeg @ 0x1d86950] marker parser used 0 bytes (0 bits)',
15702 => '[mjpeg @ 0x1d86950] marker=e0 avail_size_in_buf=535296',
15703 => '[mjpeg @ 0x1d86950] marker parser used 16 bytes (128 bits)',
15704 => '[mjpeg @ 0x1d86950] marker=fe avail_size_in_buf=535278',
15705 => '[mjpeg @ 0x1d86950] marker parser used 12 bytes (96 bits)',
15706 => '[mjpeg @ 0x1d86950] marker=db avail_size_in_buf=535264',
15707 => '[mjpeg @ 0x1d86950] index=0',
15708 => '[mjpeg @ 0x1d86950] qscale[0]: 1',
15709 => '[mjpeg @ 0x1d86950] index=1',
15710 => '[mjpeg @ 0x1d86950] qscale[1]: 1',
15711 => '[mjpeg @ 0x1d86950] marker parser used 132 bytes (1056 bits)',
15712 => '[mjpeg @ 0x1d86950] marker=c4 avail_size_in_buf=535130',
15713 => '[mjpeg @ 0x1d86950] class=0 index=0 nb_codes=12',
15714 => '[mjpeg @ 0x1d86950] class=0 index=1 nb_codes=12',
15715 => '[mjpeg @ 0x1d86950] class=1 index=0 nb_codes=251',
15716 => '[mjpeg @ 0x1d86950] class=1 index=1 nb_codes=251',
15717 => '[mjpeg @ 0x1d86950] marker parser used 418 bytes (3344 bits)',
15718 => '[mjpeg @ 0x1d86950] marker=c0 avail_size_in_buf=534710',
15719 => '[mjpeg @ 0x1d86950] sof0: picture: 1920x1080',
15720 => '[mjpeg @ 0x1d86950] component 0 2:1 id: 0 quant:0',
15721 => '[mjpeg @ 0x1d86950] component 1 1:1 id: 1 quant:1',
15722 => '[mjpeg @ 0x1d86950] component 2 1:1 id: 2 quant:1',
15723 => '[mjpeg @ 0x1d86950] pix fmt id 21111100',
15724 => '[mjpeg @ 0x1d86950] marker parser used 17 bytes (136 bits)',
15725 => '[mjpeg @ 0x1d86950] marker=da avail_size_in_buf=534691',
15726 => '[mjpeg @ 0x1d86950] escaping removed 2530 bytes',
15727 => '[mjpeg @ 0x1d86950] component: 0',
15728 => '[mjpeg @ 0x1d86950] component: 1',
15729 => '[mjpeg @ 0x1d86950] component: 2',
15730 => '[mjpeg @ 0x1d86950] marker parser used 532160 bytes (4257280 bits)',
15731 => '[mjpeg @ 0x1d86950] marker=d9 avail_size_in_buf=0',
15732 => '[mjpeg @ 0x1d86950] mjpeg decode frame unused 0 bytes',
15733 => 'av_interleaved_write_frame(): Operation not permitted',Interestingly, the script is run via cron which is when I get the issues. If I run the script via a browser there is no error and it will complete with no problem. Cron logs don't log anything suspicious. So that leads me to think that you are correct in saying that FFMPEG is not the culprit... although the error returned leads you to think otherwise. It is like some limits are reached or some setting causes it to crash after a certain period.

Are there any limits to cron or running FFMPEG via cron?

qyot27
September 24th, 2010, 08:56 AM
Have you tried compiling ffmpeg with a newer version of GCC? I say this because, I'm not sure about GCC 4.1.2 (as the log post indicated), but 3.4.5 would do something with ffmpeg that caused it to throw errors over MJPEG (also in the logs) and say it was miscompiled. Perhaps that issue - or something like it - was still present in 4.1.x, which would mean you need to use a more recent version of GCC.

camslaz
September 24th, 2010, 10:55 PM
Thanks for the responses guys... I have solved the problem. I was running the cron under the owner of the domain rather then root... when I switch it to root, voila, it ran all the way through with no issues.

I still don't know why it would fail for larger videos when run under the owner of the domain... probably some limitation or configuration. Something to keep in mind if you are experiencing similar issues.

vishant7
September 25th, 2010, 06:47 AM
FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --extra-version=4:0.5.1-1ubuntu1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 1 / 52.20. 1
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 4. 0 / 0. 4. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Mar 4 2010 12:35:30, gcc: 4.4.3

Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1) -> 25.00 (25/1)
Input #0, matroska, from '/home/vishant/Videos/Movies/Ong Bak 3 .mkv':
Duration: 01:29:01.05, start: 0.000000, bitrate: N/A
Stream #0.0: Video: h264, yuv420p, 720x304, PAR 1:1 DAR 45:19, 25 tbr, 1k tbn, 50 tbc
Stream #0.1: Audio: aac, 24000 Hz, 5.1, s16
Stream #0.2(eng): Subtitle: 0x0000
File '/home/vishant/Ong Bak 3 .mpg' already exists. Overwrite ? [y/N] y
Output #0, dvd, to '/home/vishant/Ong Bak 3 .mpg':
Stream #0.0: Video: mpeg2video (hq), yuv420p, 352x576 [PAR 24:11 DAR 4:3], q=2-31, 4000 kb/s, 90k tbn, 25 tbc
Stream #0.1: Audio: mp2, 48000 Hz, stereo, s16, 192 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
[aac @ 0x95c31b0]SBR not implemented. Update your FFmpeg version to the newest one from SVN. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x95c31b0]SBR not implemented. Update your FFmpeg version to the newest one from SVN. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x95c31b0]SBR not implemented. Update your FFmpeg version to the newest one from SVN. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x95c31b0]SBR not implemented. Update your FFmpeg version to the newest one from SVN. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x95c31b0]SBR not implemented. Update your FFmpeg version to the newest one from SVN. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x95c31b0]SBR not implemented. Update your FFmpeg version to the newest one from SVN. If the problem still occurs, it means that your file has a feature which has not been implemented.
Resampling with input channels greater than 2 unsupported.
Can not resample 6 channels @ 24000 Hz to 2 channels @ 48000 Hz
Press Enter to Continue

ron999
September 25th, 2010, 03:50 PM
...

FakeOutdoorsman
September 25th, 2010, 06:53 PM
The yadif deinterlacing filter has been added to FFmpeg (http://git.ffmpeg.org/?p=ffmpeg;a=commit;h=76503274bc38962453e0760bb2cb4 ee308b8985f). This is good news for me because I was using yadif via MPlayer for a project and can now simplify the script.

verb3k
September 25th, 2010, 08:11 PM
Frei0r filters integration has also been added. To enable it, you need to install the packages frei0r-plugins and frei0r-plugins-dev and build ffmpeg with --enable-frei0r.

andrew.46
September 26th, 2010, 08:15 AM
In yet another welcome to the filter system is this a small change in the syntax of the crop filter (http://git.ffmpeg.org/?p=ffmpeg;a=commit;h=37f0253489b2c96699ed554e036b5 ceafab4c870) which means it now matches exactly the syntax produced by the MPlayer cropdetect and rectangle filters. It is a small change but it has made my life a little easier :).

Andrew

omkrasu
September 26th, 2010, 08:31 PM
Hi!

Thanks for the x264 how to's. On my laptop everything went fine.

Unfortunatly i missed a few steps o my desktop because i wanted really badly those frei0r-plugins right out of the repos.

The conclusion to make them work was -- though i'm uncertain, so that's why i'm writing:

Uninstalled the Reinhard ppa's packages and Kdenlive.
Then uninstalled all the connected stuff.
And if something was left out, i checked in Synaptic to remove some other dependencies.
Then did how to form source (everything removed of course first).
Then added Mediubuntu and installed mencoder.
That step fixed the libfaad0 thing.
Melt got reinstalled, like frei0r-plugins.
Reinstalled (because they all lost dependencies) Vlc, Blender, Openshot etc.

On the laptop i was luckier, thinking that was because i had Mediubuntu already enabled and mplayer installed, and prior removed other sources.

The Lame and Vpx install went alright everywhere.

And there was one more thing: gstreamer-ffmpeg install for thumnailing nautilus.

So had to ran a few circles on the desktop.

It fixed the Openshot freezing too.

The Reinhard ppa originally was a kind of solution, but frei0r didn't work.

Cleanse my brain! Please. What was the original problem? It works now, but i'm lost.

Is mediubuntu's mencoder and mplayer necessary?

arrrghhh
September 27th, 2010, 03:53 AM
Hey, this is an amazing guide... can you do one favor to us mutli-core guys and add some caveats of basically what is needed to get ffmpeg to be compiled with multicore support? That would be awesome, thanks!

FakeOutdoorsman
September 27th, 2010, 07:14 AM
Cleanse my brain! Please. What was the original problem? It works now, but i'm lost.
I'm sorry, but I'm not sure what the original problem was and I've never used (or heard of) the Reinhard PPA, but it's good that you seemed to have figured things out. I'll add instructions to enable frei0r video filtering for FFmpeg within a few days.


Is mediubuntu's mencoder and mplayer necessary?
These are not necessary to get the frei0r filter working in FFmpeg.



Hey, this is an amazing guide... can you do one favor to us mutli-core guys and add some caveats of basically what is needed to get ffmpeg to be compiled with multicore support? That would be awesome, thanks!

FFmpeg already supports multithreading for some encoders. If you are interested in multithreaded decoding you can try ffmpeg-mt (http://gitorious.org/ffmpeg/ffmpeg-mt). I have no experience with it and probably won't try it out because FFmpeg supports some hardware GPU decoding accelerators.

arrrghhh
September 27th, 2010, 02:11 PM
FFmpeg already supports multithreading for some encoders. If you are interested in multithreaded decoding you can try ffmpeg-mt (http://gitorious.org/ffmpeg/ffmpeg-mt). I have no experience with it and probably won't try it out because FFmpeg supports some hardware GPU decoding accelerators.

Yes, that's the exact package I'm trying to get installed/compiled. I'd like to be able to transcode on-the-fly 1080p video. 720p works fine, but 1080p doesn't work so well - and I found that it only maxes out one core at a time, so I know that it's not setup correctly.

You just made such a complete guide, I was hoping you could add what needs to be changed to get multi-threaded decoding working, but I understand if you've never done it before that you can't really document it... Just struggling with it myself. Not sure why this isn't the default!

FakeOutdoorsman
September 27th, 2010, 07:47 PM
Yes, that's the exact package I'm trying to get installed/compiled. I'd like to be able to transcode on-the-fly 1080p video. 720p works fine, but 1080p doesn't work so well - and I found that it only maxes out one core at a time, so I know that it's not setup correctly.

Can you show an example command and the complete FFmpeg output? Perhaps you should ask the #ffmpeg IRC channel (have your command and output ready with pastebin.com). There are some people there who are more familiar with CPU capabilities and limitations and will know if your hardware can handle what you are attempting to do.

FakeOutdoorsman
September 27th, 2010, 08:27 PM
Frei0r filters integration has also been added. To enable it, you need to install the packages frei0r-plugins and frei0r-plugins-dev and build ffmpeg with --enable-frei0r.

Anyone wanting to use the frei0r filters can just follow verbek's instructions to get it working. Unfortunately figuring out the right parameters seem somewhat cryptic to me after reading the frei0r section of man ffmpeg. Perhaps there is an easier way, but I looked at the source code of a few frei0r filters:

glow filter (http://frei0r.dyne.org/gallery?filter=glow):

switch ( param_index ) {
case 0:
info->name = "Blur";
info->type = F0R_PARAM_DOUBLE;
info->explanation = "Blur of the glow";
break;
}
So it appears to take a double as a value:

ffmpeg -i input.foo -an -vcodec libx264 -vpre medium -crf 22 -threads 0 \
-vf scale=640:-1,frei0r=glow:0.5 output.mp4
I added scale to show that there can be multiple filters. The order matters and the first filter will be applied first.

You can see your available filters in /usr/lib/frei0r-1.

qyot27
September 27th, 2010, 09:14 PM
Yes, that's the exact package I'm trying to get installed/compiled. I'd like to be able to transcode on-the-fly 1080p video. 720p works fine, but 1080p doesn't work so well - and I found that it only maxes out one core at a time, so I know that it's not setup correctly.

You just made such a complete guide, I was hoping you could add what needs to be changed to get multi-threaded decoding working, but I understand if you've never done it before that you can't really document it... Just struggling with it myself. Not sure why this isn't the default!

Can you show an example command and the complete FFmpeg output? Perhaps you should ask the #ffmpeg IRC channel (have your command and output ready with pastebin.com). There are some people there who are more familiar with CPU capabilities and limitations and will know if your hardware can handle what you are attempting to do.
Yeah, posting the command will help. Do be aware that ffmpeg organizes the options for any input or output video before the actual video itself is called. In other words,

ffmpeg -i [input video] [output options] [output video]




There was nothing in ffmpeg-mt's configure to make it 'different' to compile than standard ffmpeg. So more than likely the issue being seen is perhaps a lack of using the -threads X parameter (where X is the # of cores) prior to the input. Of course, I would think that it should be intelligent enough to automatically use the proper number of threads for the detected cores, but since the -threads parameter still - AFAIK - needs to be used on the [i]encoder side to work, it probably needs it on the decoding side as well, like so:

ffmpeg -threads 4 -i example_h264_1080p.mkv -vcodec ffvhuff -context 1 -strict -1 -pred 2 -threads 4 output.avi

Notes:
I used ffvhuff in the example because I don't bother encoding with libx264 through ffmpeg, and I remember those commands offhand. Neither do I know for sure if ffvhuff is a multithreaded encoder, but whatever.

And furthermore, I have nearly zero experience with ffmpeg-mt because the only time I've ever used it is through ffdshow on my mom's laptop (in which case, it seems to handle 1080p just fine) - I'm just guessing at what seems to be the most logical syntactical reason for it restricting itself to a single core.

cthlhu1987
September 28th, 2010, 06:19 PM
All goes well until step 7:

baruch@baruch-laptop:~/progs/webm/ffmpeg$ sudo checkinstall --pkgname=ffmpeg --pkgversion "4:SVN-r`LANG=C svn info | \
> grep Revision | awk '{ print $NF }'`" --backup=no --deldoc=yes --fstrans=no \
> --default


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



*****************************************
**** Debian package creation selected ***
*****************************************

This package will be built according to these values:

0 - Maintainer: [ root@baruch-laptop ]
1 - Summary: [ Package created with checkinstall 1.6.1 ]
2 - Name: [ ffmpeg ]
3 - Version: [ 4:SVN-r25249 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ checkinstall ]
7 - Architecture: [ i386 ]
8 - Source location: [ ffmpeg ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ ffmpeg ]

Enter a number to change any of them or press ENTER to continue:

Installing with make...Installing with install...

========================= Installation results ===========================
INSTALL libavdevice/libavdevice.a
INSTALL libavfilter/libavfilter.a
INSTALL libavformat/libavformat.a
INSTALL libavcodec/libavcodec.a
INSTALL libpostproc/libpostproc.a
INSTALL libswscale/libswscale.a
INSTALL libavcore/libavcore.a
INSTALL libavutil/libavutil.a
INSTALL libavdevice/avdevice.h
INSTALL libavdevice/libavdevice.pc
INSTALL libavfilter/avfilter.h
INSTALL libavfilter/libavfilter.pc
INSTALL libavformat/avformat.h
INSTALL libavformat/avio.h
INSTALL libavformat/libavformat.pc
INSTALL libavcodec/avcodec.h
INSTALL libavcodec/avfft.h
INSTALL libavcodec/dxva2.h
INSTALL libavcodec/opt.h
INSTALL libavcodec/vaapi.h
INSTALL libavcodec/vdpau.h
INSTALL libavcodec/xvmc.h
INSTALL libavcodec/libavcodec.pc
INSTALL libpostproc/postprocess.h
INSTALL libpostproc/libpostproc.pc
INSTALL libswscale/swscale.h
INSTALL libswscale/libswscale.pc
INSTALL libavcore/avcore.h
INSTALL libavcore/imgutils.h
INSTALL libavcore/parseutils.h
INSTALL libavcore/libavcore.pc
INSTALL libavutil/adler32.h
INSTALL libavutil/attributes.h
INSTALL libavutil/avstring.h
INSTALL libavutil/avutil.h
INSTALL libavutil/base64.h
INSTALL libavutil/bswap.h
INSTALL libavutil/common.h
INSTALL libavutil/cpu.h
INSTALL libavutil/crc.h
INSTALL libavutil/error.h
INSTALL libavutil/eval.h
INSTALL libavutil/fifo.h
INSTALL libavutil/intfloat_readwrite.h
INSTALL libavutil/intreadwrite.h
INSTALL libavutil/lfg.h
INSTALL libavutil/log.h
INSTALL libavutil/lzo.h
INSTALL libavutil/mathematics.h
INSTALL libavutil/md5.h
INSTALL libavutil/mem.h
INSTALL libavutil/pixdesc.h
INSTALL libavutil/pixfmt.h
INSTALL libavutil/random_seed.h
INSTALL libavutil/rational.h
INSTALL libavutil/sha1.h
INSTALL libavutil/avconfig.h
INSTALL libavutil/libavutil.pc
INSTALL ffmpeg
INSTALL ffplay
INSTALL ffprobe
INSTALL ffserver
INSTALL ffpresets/libx264-baseline.ffpreset
INSTALL ffpresets/libx264-faster.ffpreset
INSTALL ffpresets/libx264-faster_firstpass.ffpreset
INSTALL ffpresets/libx264-fast.ffpreset
INSTALL ffpresets/libx264-fast_firstpass.ffpreset
INSTALL ffpresets/libx264-ipod320.ffpreset
INSTALL ffpresets/libx264-ipod640.ffpreset
INSTALL ffpresets/libx264-lossless_fast.ffpreset
INSTALL ffpresets/libx264-lossless_max.ffpreset
INSTALL ffpresets/libx264-lossless_medium.ffpreset
INSTALL ffpresets/libx264-lossless_slower.ffpreset
INSTALL ffpresets/libx264-lossless_slow.ffpreset
INSTALL ffpresets/libx264-lossless_ultrafast.ffpreset
INSTALL ffpresets/libx264-main.ffpreset
INSTALL ffpresets/libx264-medium.ffpreset
INSTALL ffpresets/libx264-medium_firstpass.ffpreset
INSTALL ffpresets/libx264-placebo.ffpreset
INSTALL ffpresets/libx264-placebo_firstpass.ffpreset
INSTALL ffpresets/libx264-slower.ffpreset
INSTALL ffpresets/libx264-slower_firstpass.ffpreset
INSTALL ffpresets/libx264-slow.ffpreset
INSTALL ffpresets/libx264-slow_firstpass.ffpreset
INSTALL ffpresets/libx264-superfast.ffpreset
INSTALL ffpresets/libx264-superfast_firstpass.ffpreset
INSTALL ffpresets/libx264-ultrafast.ffpreset
INSTALL ffpresets/libx264-ultrafast_firstpass.ffpreset
INSTALL ffpresets/libx264-veryfast.ffpreset
INSTALL ffpresets/libx264-veryfast_firstpass.ffpreset
INSTALL ffpresets/libx264-veryslow.ffpreset
INSTALL ffpresets/libx264-veryslow_firstpass.ffpreset
mkdir: cannot create directory `/usr/local/share/man/man1': File exists
make: *** [install-man] Error 1

**** Installation failed. Aborting package creation.

Cleaning up...OK

Bye.


Does anyone know how to solve this problem?

dannyboy79
September 28th, 2010, 07:22 PM
well the error stats, "mkdir: cannot create directory `/usr/local/share/man/man1': File exists"
i would say temporarily rename that man1 file located where it says and see if you can compile it then. not sure why that file is already there but if it's on for a man entry can't imagine is super important. good luck

FakeOutdoorsman
September 28th, 2010, 07:36 PM
Does anyone know how to solve this problem?
I've never experienced this issue before and have been unsuccessful in attempting to duplicate it in Ubuntu Lucid Lynx. What version of Ubuntu are you using? Can you show the output of:

ls -alh /usr/local/share/man/man1

cthlhu1987
September 28th, 2010, 08:02 PM
I've never experienced this issue before and have been unsuccessful in attempting to duplicate it in Ubuntu Lucid Lynx. What version of Ubuntu are you using?

baruch@baruch-laptop:~$ cat /proc/version
Linux version 2.6.32-25-generic (buildd@rothera) (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) ) #44-Ubuntu SMP Fri Sep 17 20:26:08 UTC 2010
baruch@baruch-laptop:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.1 LTS
Release: 10.04
Codename: lucid

Can you show the output of:

ls -alh /usr/local/share/man/man1

baruch@baruch-laptop:~$ ls -alh /usr/local/share/man/man1
-rw-r--r-- 1 root root 2.7K 2010-05-23 23:09 /usr/local/share/man/man1
Thx in advance :)

FakeOutdoorsman
September 28th, 2010, 08:34 PM
It appears that /usr/local/share/man/man1 is a file instead of a directory. Mine shows:

$ ls -alh /usr/local/share/man/man1
total 84K
drwxr-xr-x 2 root root 4.0K 2010-09-28 10:29 .
drwxr-xr-x 3 root root 4.0K 2010-09-13 10:02 ..
-rw-r--r-- 1 root root 1.2K 2010-09-13 10:02 faac.1.gz
-rw-r--r-- 1 root root 23K 2010-09-28 10:28 ffmpeg.1.gz
-rw-r--r-- 1 root root 14K 2010-09-28 10:28 ffplay.1.gz
-rw-r--r-- 1 root root 8.3K 2010-09-28 10:28 ffprobe.1.gz
-rw-r--r-- 1 root root 6.9K 2010-09-28 10:28 ffserver.1.gz
-rw-r--r-- 1 root root 9.5K 2010-09-24 10:07 lame.1.gz

Let's see what package claims ownership to this oddball:

dpkg -S /usr/local/share/man/man1
Mine shows:

$ dpkg -S /usr/local/share/man/man1
faac, ffmpeg, lame-ffmpeg: /usr/local/share/man/man1
If nothing useful comes from that command, then I would probably rename the file as dannyboy79 has suggessted and then re-run the FFmpeg checkinstall command.

cthlhu1987
September 28th, 2010, 08:39 PM
It appears that /usr/local/share/man/man1 is a file instead of a directory. Mine shows:

$ ls -alh /usr/local/share/man/man1
total 84K
drwxr-xr-x 2 root root 4.0K 2010-09-28 10:29 .
drwxr-xr-x 3 root root 4.0K 2010-09-13 10:02 ..
-rw-r--r-- 1 root root 1.2K 2010-09-13 10:02 faac.1.gz
-rw-r--r-- 1 root root 23K 2010-09-28 10:28 ffmpeg.1.gz
-rw-r--r-- 1 root root 14K 2010-09-28 10:28 ffplay.1.gz
-rw-r--r-- 1 root root 8.3K 2010-09-28 10:28 ffprobe.1.gz
-rw-r--r-- 1 root root 6.9K 2010-09-28 10:28 ffserver.1.gz
-rw-r--r-- 1 root root 9.5K 2010-09-24 10:07 lame.1.gz

Let's see what package claims ownership to this oddball:

dpkg -S /usr/local/share/man/man1
Mine shows:

$ dpkg -S /usr/local/share/man/man1
faac, ffmpeg, lame-ffmpeg: /usr/local/share/man/man1
If nothing useful comes from that command, then I would probably rename the file as dannyboy79 has suggessted and then re-run the FFmpeg checkinstall command.
Holy skit, IT WORKED!!!1 THANKS FakeOutdoorsman and THANKS dannyboy79!!!!:guitar::guitar::guitar::guitar::gui tar::guitar::guitar:

omkrasu
September 29th, 2010, 12:30 PM
Thanks for all the infos.

Well, the PPA's name was siretart which i used. Had to remove that one, because that one had problems with the frei0r stuff.

The orginal idea was to get h264 and frei0r working in kdenlive, and the steps i took - thanks for the explanation - at the end sorted the whole thing out.

After i wrote to the forum, still things were broken, and was patching it up, clean installing multimedia applications, like kdenlive, blender, frei0r (now working from the repos straight away).

So it works.

In Kdenlive i had to run the config wizard a few times to get everything in order.

Bye!

excetara2
October 2nd, 2010, 06:55 AM
Differences between lossless_medium and medium in the profile settings??

I had previously never really had to convert videos but most people have issues with .mts and the interlacing is really bad from my Canon HG-21. I was testing different parameters to check which format I think is better.

I'm trying to figure out what is the difference between the preset lossless and medium codecs. I notice from mediainfo that when the lossless codec is run that it uses the Main instead of high profile. Also, the reframes is only 1. Otherwise appears to be very similar so before converting heaps of videos I want to find out so I make the right selection. I'm assuming it turns off some sort of compression schemes in the high profile and then doesn't reframe multiple times to try for further compression.

Cheers,
Jeff

rifter
October 2nd, 2010, 07:08 AM
well the error stats, "mkdir: cannot create directory `/usr/local/share/man/man1': File exists"
i would say temporarily rename that man1 file located where it says and see if you can compile it then. not sure why that file is already there but if it's on for a man entry can't imagine is super important. good luck

Uh, I would definitely not muck with that directory and it is indeed super important. That's the whole section 1 of the man pages!

The bigger question is why the install process would want to even create that directory. It should be present on basically every system (unless you are strange enough to somehow not install man pages .. which is probably nearly impossible in ubuntu). What it should be doing is adding a file there for the man pages for the packages.

It's been awhile since I went through this process, but I definitely don't remember anything like that happening.

**Edit** oh.. /usr/local/share/man .. so not the main section 1 of the man pages. However, other programs installed in /usr/local will definitely want to use that, so..

ron999
October 2nd, 2010, 09:34 AM
@ excetera2
The presets are stored in the folder /usr/local/share/ffmpeg.
They can be viewed with a text editor.

qyot27
October 2nd, 2010, 11:50 AM
Differences between lossless_medium and medium in the profile settings??

I had previously never really had to convert videos but most people have issues with .mts and the interlacing is really bad from my Canon HG-21. I was testing different parameters to check which format I think is better.

I'm trying to figure out what is the difference between the preset lossless and medium codecs. I notice from mediainfo that when the lossless codec is run that it uses the Main instead of high profile. Also, the reframes is only 1. Otherwise appears to be very similar so before converting heaps of videos I want to find out so I make the right selection. I'm assuming it turns off some sort of compression schemes in the high profile and then doesn't reframe multiple times to try for further compression.

Cheers,
Jeff
'Medium' is the medium efficiency distribution setting. As with nearly all configurations of H.264, it is lossy. So 'medium' in this case can refer either to quality (dependent on filesize targets) or filesize (if determined on quality targets). Speed is also a factor.

'Lossless Medium' is the medium time/space efficiency setting for lossless H.264. There is no 'quality' factor here, since it's lossless. But 'medium' refers to the type of settings involved to help maximize the compression ratio, and how they affect the filesize and speed of the compression. If you want a better comparison of the lossless modes, use, for instance, 'lossless slower' or 'lossless max' instead, and compare that to 'lossless medium'.

In short, 'medium' and 'lossless medium' can't be compared to each other because they're intended for entirely different uses.

The lossless stuff is meant for editing or archiving (this is why the frame options are set to make sure that the lossless modes only use intra-frame, not inter-frame), which is what lossless formats are most often used for. For something to just casually watch, you don't want to use a lossless preset. Especially since lossless filesizes are much larger. To draw an analogy with audio, comparing 'medium' to 'lossless medium' would be like comparing MP3 at 128kbps to FLAC at compression level 4. The settings are intended for completely different things, and the formats themselves are intended for completely different things.

cthlhu1987
October 3rd, 2010, 11:32 AM
Damn, i tried to play a webm file with the mplayer and it gives me this:

baruch@baruch-laptop:/media/DATA/my_docs/downloads/rammstein_-_kokain_-_n_pogodi$ mplayer Rammstein\ -\ Kokain\ -\ Nu\ Pogodi\ Ну\ Погоди\(360p_VP8-Vorbis\).webm
MPlayer SVN-r31042-Ubuntu-RVM (C) 2000-2010 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing Rammstein - Kokain - Nu Pogodi Ну Погоди(360p_VP8-Vorbis).webm.
Seek failed
libavformat file format detected.
[mp3 @ 0xabbee60]Header missing
Last message repeated 324 times
[mp3 @ 0xabbee60]big_values too big
[mp3 @ 0xabbee60]Header missing
Last message repeated 687 times
[mp3 @ 0xabbdc50]MAX_READ_SIZE:5000000 reached
[mp3 @ 0xabbdc50]Estimating duration from bitrate, this may be inaccurate
[lavf] Audio stream found, -aid 0
================================================== ========================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
ADecoder init failed :(
ADecoder init failed :(
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
Unknown/missing audio format -> no sound
ADecoder init failed :(
Opening audio decoder: [libmad] libmad mpeg audio decoder
Cannot sync MAD frame
ADecoder init failed :(
ADecoder init failed :(
Opening audio decoder: [hwmpa] MPEG audio pass-through (fake decoder)
Cannot sync MPA frame: 0
ADecoder init failed :(
ADecoder init failed :(
Cannot find codec for audio format 0x50.
Audio: no sound
Video: no video


Exiting... (End of file)

andrew.46
October 3rd, 2010, 12:56 PM
Hi cthlhu,


Damn, i tried to play a webm file with the mplayer and it gives me this....

You have perhaps used the wrong thread as well :). I am not sure about rvm's MPlayer but a recent build should have webm / vp8 support courtesy of libavcodec. Perhaps the sample is broken? I have created a nice enough webm file here that you might want to try:


wget http://www.andrews-corner.org/samples/legend_guardians.webm

which plays well enough on the svn MPlayer, screenshot attached. First decent shot I have had at producing a webm file, used 2 pass and set bitrate and also the -level 100 setting, not sure if this is necessary?

Andrew

Andrew

excetara2
October 3rd, 2010, 01:56 PM
I think it's because I was encoding from already lossy data. It's from a camcorder that output avchd at 24MBPS so when I ran lossless_medium or medium I got similar file sizes. That is why I was confused and assumed lossless wasn't working.

Does anyone know the typical max reference frame rate on portable devices?? I may just recode the videos I was planning on putting on my blackberry but just curious. Currently I use the slow preset but manually set refs at 4.

Cheers for the help

cthlhu1987
October 3rd, 2010, 06:14 PM
Hi cthlhu,
You have perhaps used the wrong thread as well :).
OK, i posted there, 2.

I am not sure about rvm's MPlayer but a recent build should have webm / vp8 support courtesy of libavcodec.
Could be, you know a ppa with the MOST recent mplayer bins? Would be nice :)

Perhaps the sample is broken? I have created a nice enough webm file here that you might want to try:

wget http://www.andrews-corner.org/samples/legend_guardians.webm
This webm file even crashed the mplayer, i got my test files from youtube.

andrew.46
October 3rd, 2010, 11:19 PM
Hi cthlhu,


Could be, you know a ppa with the MOST recent mplayer bins? Would be nice :)

I tend to avoid PPAs myself so I cannot give much advice here, my own MPlayer is built from source and I run a guide (http://ubuntuforums.org/showthread.php?t=1542240) on these forums to show how to do this. Perhaps give this a try? Mind you that error from RVM's build is not what you would expect from an inability to play webm material...


This webm file even crashed the mplayer, i got my test files from youtube.

Hmmm.... well I created this one myself from a reasonably high definition trailer and it runs well here, in fact I was a little proud of my efforts with this one :(. Perhaps others on this thread could test it, I will leave it in place for a week or so.

Andrew

mc4man
October 4th, 2010, 12:28 AM
thread could test it,
Works fine with all the usual suspects and looks pretty good as well.

andrew.46
October 4th, 2010, 01:02 AM
Hi mc4man,


Works fine with all the usual suspects and looks pretty good as well.

Thanks mc4man, and congrats btw for cracking 6000 posts on these forums :). Always useful and well thought out posts I might mention.

It does raise the question mind you of transcoding syntax for FFmpeg and libvpx, to make this paticular effort I appropriated the syntax suggested by Fakeoutdoorsman in this guide and made a few tweaks. The original file is here:


wget http://trailers.apple.com/movies/wb/legendoftheguardians/legendoftheguardians-tlr3_h480p.mov

and my crudely reworked syntax was as follows, using the most recent FFmpeg and libvpx:



ffmpeg -i legendoftheguardians_trlr_02_480p_dl.mov \
-pass 1 -vcodec libvpx -level 100 -b 512k -bt 512k \
-vf scale=640:-1 -threads 0 -f rawvideo -an -y /dev/null && \
ffmpeg -i legendoftheguardians_trlr_02_480p_dl.mov \
-pass 2 -acodec libvorbis -ab 128k -ac 2 \
-vcodec libvpx -level 100 -b 512k -bt 512k \
-vf scale=640:-1 -threads 0 \
legend_guardians.webm


but I could find little guidance online about producing quality webm files with FFmpeg and I would be interested to see any improvements that could be suggested to this method of encoding. Of some interest is this document (https://spreadsheets.google.com/ccc?key=0AvWxUS1XGCPAdGNtNW10a2p4c1VwdG1VZk1uMl9MU EE&hl=en#gid=0) which attempts to map ivfenc settings to FFmpeg settings but as far as I could see there was little definitive material available online as yet. This drifts a little from FFmpeg and x264 for which my apologies :(.

Andrew

FakeOutdoorsman
October 4th, 2010, 01:07 AM
The de-interlacing filter yadif recently added to FFmpeg isn't working as I expected. It seems to be adding artifacts to dvvideo inputs. Is anyone else noticing this? One developer said he did not.


wget http://samples.mplayerhq.hu/DV-raw/small_test2.dv
ffmpeg -i small_test2.dv -vf yadif -qscale 3 -an yadif.mp4

Watch the top row of pixels. I haven't tried any other input formats and regular, old -deinterlace doesn't introduce the artifacts.

However, if I change the output to .mpg, and play the video with ffplay, I get a different behavior:

mpeg1video @ 0x265c820] aspect ratio has forbidden 0 value
How about this one? Anyone else get that? This is FFmpeg version SVN-r25329 on Arch Linux x86_64.

mc4man
October 4th, 2010, 01:25 AM
Don't see any artifacts at top (screen vlc, but same with other players
(r25329 - 10.10, nvidia

mc4man
October 4th, 2010, 01:39 AM
syntax was as follows...
Thanks for that, will have to fool around a bit there,
(just noticed I built ffmpeg off of a tuned vorbis, didn't complain, though don't know what advantage, if any, is there.

Well OT
I did see how vlc handled transcoding to webm (vp8 ) a ways back, seemed to have some real issues if you raised the br above it's default

andrew.46
October 4th, 2010, 02:01 AM
I cannot see the problem on r25321 on 32 bit Slackware 13.0, I got a little excited when I saw some flickering at the base of the clip but then noticed that this is in the original as well :(. This can only really be seen if you remove the borders:


mplayer -noborder small_test2.dv

and I am not sure if this has any significance at all...

Andrew

mc4man
October 4th, 2010, 02:30 AM
Anyone else get that...
moving to a 64 bit install and the artifacts do show up at the top as in your screen.
So 32 bit is fine, 64 not so.

andrew.46
October 4th, 2010, 04:42 AM
Hi mc4man,


Thanks for that, will have to fool around a bit there,
(just noticed I built ffmpeg off of a tuned vorbis, didn't complain, though don't know what advantage, if any, is there.

To borrow the work of alienBOB again I note that his slackware script for FFmpeg incorporates some libvpx presets:

http://slackware.org.uk/people/alien/restricted_slackbuilds/ffmpeg/build/ffpresets-libvpx.diff

Something like this would be usefully incorporated into the FFmpeg source?

Andrew

mysoogal
October 4th, 2010, 05:11 AM
Requesting Help, in building all ffmpeg profiles, please if your interested in helping me with the profiles pm me or visit this page, i just need compatible ffmpeg commands

for adobe flash , ipod,itouch,etc you get the idea i want everything all the profiles



http://www.expertcore.org/viewtopic.php?f=41&p=4345#p4345

this is how it looks like my open source transcoder
http://i53.tinypic.com/3127cp1.png

help me with the profiles anybody ?
thanks for reading

FakeOutdoorsman
October 4th, 2010, 08:58 PM
I cannot see the problem on r25321 on 32 bit Slackware 13.0...

Thanks for taking a look at this.


So 32 bit is fine, 64 not so.

Yes, 32 bit is fine for me as well. Good catch.


Something like this would be usefully incorporated into the FFmpeg source?

I'm sure more preset files would be appreciated contributions. I'm probably missing something obvious and I only took a quick look, but this patch contains some options, such as lag, that don't seem to be present in my FFmpeg.

dannyboy79
October 4th, 2010, 09:32 PM
does anyone else have an issue with screencasting in linux by using ffmpeg and it cutting off the audio prior to hitting the q button to stop ffmpeg from capturing? THis is the command i run

ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 29.97 -s 1024x768 -i :0.0 -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0 output.mkv
and like I said it cuts off the audio prior to me even hitting the "q" button to stop ffmpeg. kind of weird and not really critical as I can just let it capture a few seconds after I am done talking but still annoying.

I am using ffmpeg SVN-r25112 with the following compile configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab

playback in vlc or totem results in same missing audio towards the end. ive already posted this in the screencasting thread but thought maybe you guys could be helpful here as well. sorry if i should'nt have double posted it.

mc4man
October 5th, 2010, 02:01 AM
It seems to be adding artifacts...
In a way it reminds me of on my son's hd tv - sometimes you see that once and a while on certain channels. It's like the picture isn't quite filling the screen.

(if you increase the height by 2 lines the effect isn't seen on the sample encode

andrew.46
October 7th, 2010, 09:25 AM
Hi mocha,




Fakeoutdoorsman's guide lured me to FFmpeg a long time ago but it might be of interest for some to hear that it is now possible to use presets to transcode with x264 in the latest svn MEncoder...

As my Russian computer science professor used to say, "how to do?" Please enlighten us Andrew.46.

I must apologise for this epic necropost, this slipped my mind until I ran into the same issue on Doom 9 :(. For standard 'film' transcoding the x264 options can be set with some variation on the following:



-ovc x264 -x264encopts preset=slow:tune=film:crf=22


FFmpeg still the far superior tool though...

Andrew

radiobuzzer
October 11th, 2010, 10:13 AM
It can be tricky to use ffmpeg and ffplay with some other applications in Ubuntu. This is because many applications look for these two executables at /usr/bin, though, after the installation as instructed above, mine were landed at /usr/local/bin .

Therefore, Winff convertor for example was giving me the error: Cannot find ffplay. The solution for Winff is simple: just go to the menu Edit > Preferences > Linux and change the path of ffmpeg and ffplay by browsing into the folder /usr/local/bin .

Weird why this happens. Dunno if there will be any problems with other preset apps, or if there is any other easy way to bypass this (e.g. install directly on /usr/bin, as the original debian package does.

FakeOutdoorsman
October 11th, 2010, 07:24 PM
This is a known bug in WinFF. Bug status is "fixed": Issue 56: Add /usr/local/bin for FFplay executable search (http://code.google.com/p/winff/issues/detail?id=56)

It's not recommended to install user compiled packages into /usr/bin due to a chance of interfering with important system files and/or packages from the repository.

prupert
October 11th, 2010, 10:58 PM
Just a little note for those interested, now that Meerkat is out, I have updated my little script for Meerkat / Maverick support:

http://code.google.com/p/x264-ffmpeg-up-to-date/

Though, Ubuntu's servers are still very slow, so it runs slowly at the moment (due to apt-get update taking an age).

andrew.46
October 13th, 2010, 12:33 AM
I see yet another reason to run the subversion FFmpeg, the MPlayer cropdetect filter finally arrived in FFmpeg this morning my time :). Syntax that has worked for me is:



ffmpeg -y -ss 00:10:00 -i <input_file> \
-vf cropdetect=24:16:0 -vframes 200 \
-f rawvideo -an /dev/null


The cropdetect options I have given are the defaults and the filter works beautifully!!!

Andrew

Padakwaak
October 17th, 2010, 10:35 PM
I've now managed to compile ffmpeg with x264 library on Ubuntu 10.10 x64 as shared libraries, since ZoneMinder requires shared libraries.
I ran into problems where it said that I needed to recompile with -fPIC, and when I looked in the x264's config.mak file, it was included in the list of arguments.

Please note that these changes to the original guide by FakeOutdoorsman would only be necessary for x64 Linux installations!

Here's how I did it, with steps 1 - 2 given in the original post.
Install x264
3. Get the current source files, compile, and install.


cd
git clone git://git.videolan.org/x264.git
cd x264
./configure --enable-shared
Important part:
In config.mak, I moved -fPIC to the front.
eg.: 'CFLAGS=-Wshadow -O3 -ffast-math -Wall -I. -std=gnu99 -I/usr/local/include -fPIC -s -fomit-frame-pointer -fno-tree-vectorize'
became: 'CFLAGS=-fPIC -Wshadow -O3 -ffast-math -Wall -I. -std=gnu99 -I/usr/local/include -s -fomit-frame-pointer -fno-tree-vectorize'.

make -j `grep -c ^processor /proc/cpuinfo`
sudo checkinstall --pkgname=x264 --pkgversion "2:0.`grep X264_BUILD x264.h -m1 | \
cut -d' ' -f3`.`git rev-list HEAD | wc -l`+git`git rev-list HEAD -n 1 | \
head -c 7`" --backup=no --deldoc=yes --fstrans=no --default



Install FFmpeg
4. Get the most current source files, compile, and install. Run "./configure --help" to see what other features you can enable/disable. Nightly FFmpeg snapshots (http://ffmpeg.mplayerhq.hu/releases/ffmpeg-checkout-snapshot.tar.bz2) are also available.


cd
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc \
--enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb \
--enable-libopencore-amrwb --enable-libtheora --enable-libvorbis \
--enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab \
--enable-shared --enable-pthreads
make -j `grep -c ^processor /proc/cpuinfo`
sudo checkinstall --pkgname=ffmpeg --pkgversion "4:SVN-r`LANG=C svn info | \
grep Revision | awk '{ print $NF }'`" --backup=no --deldoc=yes --fstrans=no \
--default
hash x264 ffmpeg ffplay


Thanks for FakeOutdoorsman for his great guide that I used as a foundation and for prupert's script that had the cool 'make `grep -c ^processor /proc/cpuinfo`' argument :)

andrew.46
November 1st, 2010, 07:08 AM
Not sure how many people will be interested in an upcoming guide I am in the early stages of writing which shows how to compile x264 and FFmpeg on Windows 7? I am inspired not a little by FakeOutdoorsman's efforts in this guide of course and the aim of the Windows 7 guide is identical to FakeOutdoorsman's guide: to enable encoding with faac, the latest x264 from git and the svn FFmpeg under the clunky console of Win 7, aided and abetted by MinGW and MSYS.

I have seen a ton of misinformation available online on how to accomplish this so hopefully I can make things a little clearer. First step is in place now:



Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\andrew>x264 --version
x264 0.107.1745 4785e8e
built on Nov 1 2010, gcc: 4.5.0
configuration: --bit-depth=8
x264 license: GPL version 2 or later

C:\Users\andrew>


Next for FFmpeg itself :).

Andrew

FakeOutdoorsman
November 1st, 2010, 09:21 PM
The few times I attempted to use FFmpeg on Windows I just used the Automated FFmpeg Builds (http://ffmpeg.arrozcru.org/autobuilds/), but I would guess a Windows 7 guide would be appreciated by Windows users. This is an area that I am totally ignorant in.

theteju
November 1st, 2010, 11:14 PM
I am sorry to post these stupid question. actually this thread is 136 page long and I could not search my answer. on very first page I found this link

http://code.google.com/p/x264-ffmpeg-up-to-date/ where there is a ready-made script to install the codecs. the script ran fine and it showed all is done message at the end.

I can see ffmpeg codec options under my Kdenlive rendering option under admin account.

My stupid questions are :

1). How can I make sure the the codecs are installed for sure?
2). Kdenlive from one of the user account does not see those codecs, Are we suppose to install for each users?

Hope someone will answer the question.

Thanks in advance.

qyot27
November 2nd, 2010, 03:04 AM
Not sure how many people will be interested in an upcoming guide I am in the early stages of writing which shows how to compile x264 and FFmpeg on Windows 7? I am inspired not a little by FakeOutdoorsman's efforts in this guide of course and the aim of the Windows 7 guide is identical to FakeOutdoorsman's guide: to enable encoding with faac, the latest x264 from git and the svn FFmpeg under the clunky console of Win 7, aided and abetted by MinGW and MSYS.

I have seen a ton of misinformation available online on how to accomplish this so hopefully I can make things a little clearer. First step is in place now:



Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\andrew>x264 --version
x264 0.107.1745 4785e8e
built on Nov 1 2010, gcc: 4.5.0
configuration: --bit-depth=8
x264 license: GPL version 2 or later

C:\Users\andrew>


Next for FFmpeg itself :).

Andrew
The most arduous part of getting things set up on Windows (at least XP, but Vista and Win7 would be included in that as well) isn't the compile instructions part - the instructions really are virtually the same under MSys/MinGW as the main instructions this thread caters to, for both x264 and ffmpeg. Except for ffmpeg needing the --enable-memalign-hack option, anyway.

EDIT: Oh yeah, and the U_STRICT_ANSI flag too. I always seem to forget that.

The difference is mainly in setting up the environment properly to do it, as it's not integrated into a repository system like Ubuntu (and while Cygwin has its repositories, I have no idea how anyone could call its repo manager 'easy to use'...but anything compiled with Cygwin needs extra DLLs residing in your PATH or the same folder as the program, unless you use Cygwin to cross-compile to MinGW). The arrozcru.org wiki used to have a guide to walk users through setting up the environment, and it was such a mess and so often outdated they actually now advocate using Ubuntu and going through the gcc-mingw32 package instead (which is what I've generally taken to doing, since the MSys prompt is so slow compared to Gnome Terminal). The other 'easy' option are the premade environments that are available through the CCCP wiki. Those seem to be pretty solid in regard to things working correctly*.

*although I believe you do have to snag the arrozcru.org autostatic pthreads to enable ffmpeg to use them.

The idea of it being under the native console sounds interesting. I presume you mean cmd.exe, not PowerShell, nor just using the cmd.exe window to run sh like recent MSys guides advocate...I prefer rxvt over the sh-in-cmd.exe thing.

One thing to also note, since it's a Windows guide - using the L-SMASH patch will allow x264 to use Quicktime's AAC engine to produce files with AAC audio (and I think it's a fairly safe bet that the percentage of Windows users with iTunes installed is pretty high). The only downside is that the user has to sign up for a free Apple Developer account and download the Quicktime SDK so that x264 can link to it at configure time. But it does work. I know it also allows for some other formats (like LAME for MP3), but I don't know the current working state of it beyond knowing the qtaac interface part is fine.

andrew.46
November 2nd, 2010, 06:37 AM
Hi FakeOutdoorsman,


The few times I attempted to use FFmpeg on Windows I just used the Automated FFmpeg Builds (http://ffmpeg.arrozcru.org/autobuilds/), but I would guess a Windows 7 guide would be appreciated by Windows users. This is an area that I am totally ignorant in.

I had a good look at this site previously and it is directed exclusively at cross-compiling. In fact the technique I am using with MinGW and MSYS, comping directly on Win 7 cops a bit of a pasting :). I have managed a barebones compile of x264 and FFmpeg, just compiling faac and lame and stage one is complete. The guide will be a while I suspect as there are a number of difficulties, the first being POSIX threading on win32 with x264/FFmpeg and a number of other issues. All good fun sorting it out though :).

Andrew

andrew.46
November 2nd, 2010, 07:18 AM
Hi quyot,


*although I believe you do have to snag the arrozcru.org autostatic pthreads to enable ffmpeg to use them.

Thanks for your comments about my small project, in fact win32 pthreads + x264 + FFmpeg have been an issue that I have been wrestling with, I have temporarily compiled without pthreads just to get a functioning FFmpeg. I have looked at patches but not seen this (http://ffmpeg.arrozcru.org/autobuilds/blog/2009/07/17/pthreads-win32-updated-important/) until you mentioned it. I will recompile everything against this tomorrow and hopefully this will be the end of it all...

Edit: Unfortunately neither x264 or FFmpeg build against the 'autostatic' win32 pthreads, back to the drawing board...

Edit (again): All fixed :). I cannot believe how absurdly happy I am to have accomplished my first encoding session with a self-built FFmpeg, x264 and faac on windows 7:



Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\andrew>cd Desktop

C:\Users\andrew\Desktop>ffmpeg -i test.mkv -acodec libfaac -ab 128k -vcodec libx264 -vpre slower -crf 22 -threads 0 test.mp4
FFmpeg version SVN-r25644, Copyright (c) 2000-2010 the FFmpeg developers
built on Nov 2 2010 20:35:04 with gcc 4.5.0
configuration: --prefix=/MinGW --extra-cflags=-U__STRICT_ANSI__ --enable-memalign-hack --enable-pt
hreads --enable-libx264 --extra-libs='-lx264 -lpthread' --enable-libfaac --enable-libmp3lame --enabl
e-gpl --disable-ffserver --disable-ffplay --disable-ffprobe --enable-nonfree
libavutil 50.32. 5 / 50.32. 5
libavcore 0. 9. 1 / 0. 9. 1
libavcodec 52.94. 0 / 52.94. 0
libavformat 52.84. 0 / 52.84. 0
libavdevice 52. 2. 2 / 52. 2. 2
libavfilter 1.53. 0 / 1.53. 0
libswscale 0.12. 0 / 0.12. 0
[matroska,webm @ 011dbbb0] Estimating duration from bitrate, this may be inaccurate

Seems stream 0 codec frame rate differs from container frame rate: 2397.00 (2397/1) -> 23.98 (24000/
1001)
Input #0, matroska,webm, from 'test.mkv':
Metadata:
ENCODER : Lavf52.84.0
Duration: 00:02:19.77, start: 0.000000, bitrate: 128 kb/s
Stream #0.0(eng): Video: mpeg4, yuv420p, 848x358 [PAR 1:1 DAR 424:179], 23.97 fps, 23.98 tbr, 1k
tbn, 2397 tbc
Stream #0.1(eng): Audio: mp3, 48000 Hz, 2 channels, s16, 128 kb/s
[buffer @ 02257ba0] w:848 h:358 pixfmt:yuv420p
[libx264 @ 02276880] using SAR=1/1
[libx264 @ 02276880] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[libx264 @ 02276880] profile High, level 3.1
[libx264 @ 02276880] 264 - core 107 r1745 4785e8e - H.264/MPEG-4 AVC codec - Copyleft 2003-2010 - ht
tp://www.videolan.org/x264.html - options: cabac=1 ref=8 deblock=1:0:0 analyse=0x3:0x133 me=umh subm
e=9 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,
11 fast_pskip=1 chroma_qp_offset=-2 threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 constrai
ned_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=
250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=60 rc=crf mbtree=1 crf=22.0 qcomp=0.60 qp
min=10 qpmax=51 qpstep=4 ip_ratio=1.41 aq=1:1.00
Output #0, mp4, to 'test.mp4':
Metadata:
encoder : Lavf52.84.0
Stream #0.0(eng): Video: libx264, yuv420p, 848x358 [PAR 1:1 DAR 424:179], q=10-51, 200 kb/s, 24k
tbn, 23.98 tbc
Stream #0.1(eng): Audio: libfaac, 48000 Hz, 2 channels, s16, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 3348 fps= 3 q=-1.0 Lsize= 16672kB time=139.60 bitrate= 978.4kbits/s
video:14400kB audio:2183kB global headers:0kB muxing overhead 0.535929%
frame I:51 Avg QP:16.82 size: 13026
[libx264 @ 02276880] frame P:2626 Avg QP:21.67 size: 4645
[libx264 @ 02276880] frame B:671 Avg QP:23.15 size: 2807
[libx264 @ 02276880] consecutive B-frames: 68.0% 9.7% 14.9% 7.4%
[libx264 @ 02276880] mb I I16..4: 37.0% 59.7% 3.3%
[libx264 @ 02276880] mb P I16..4: 9.4% 14.4% 0.6% P16..4: 40.2% 5.3% 0.8% 0.0% 0.0% skip:
29.2%
[libx264 @ 02276880] mb B I16..4: 6.2% 7.7% 0.2% B16..8: 35.7% 4.1% 0.7% direct: 3.6% skip:
41.8% L0:70.9% L1:21.9% BI: 7.1%
[libx264 @ 02276880] 8x8 transform intra:58.5% inter:81.8%
[libx264 @ 02276880] direct mvs spatial:99.9% temporal:0.1%
[libx264 @ 02276880] coded y,uvDC,uvAC intra: 38.6% 56.8% 8.2% inter: 12.8% 17.1% 1.4%
[libx264 @ 02276880] i16 v,h,dc,p: 46% 30% 21% 4%
[libx264 @ 02276880] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 19% 50% 4% 1% 1% 1% 2% 5%
[libx264 @ 02276880] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 39% 21% 17% 3% 3% 4% 4% 4% 4%
[libx264 @ 02276880] i8c dc,h,v,p: 35% 37% 24% 4%
[libx264 @ 02276880] Weighted P-Frames: Y:5.7%
[libx264 @ 02276880] ref P L0: 70.4% 9.0% 11.5% 3.5% 2.1% 1.3% 1.0% 0.6% 0.5% 0.0%
[libx264 @ 02276880] ref B L0: 79.5% 9.6% 5.1% 2.1% 1.7% 1.4% 0.6%
[libx264 @ 02276880] ref B L1: 95.0% 5.0%
[libx264 @ 02276880] kb/s:844.50

C:\Users\andrew\Desktop>


Now just a little tidying up to do...

Andrew

jackachan
November 2nd, 2010, 10:30 AM
Great guide. Thank you.

Although you may have retired the installation guide for Ubuntu 9.04, the steps are same as those for Ubuntu 8.04. I have followed the guide for 8.04 and successfully compiled and installed FFmpeg and X264 on my 9.04. Only one thing has to be noticed is that in the guide for 8.04 the package liblame-dev should be replaced by libmp3lame-dev, as liblame-dev seems no longer available. Maybe that's just the case for 9.04.

FakeOutdoorsman
November 2nd, 2010, 08:59 PM
Great guide. Thank you.

Although you may have retired the installation guide for Ubuntu 9.04, the steps are same as those for Ubuntu 8.04. I have followed the guide for 8.04 and successfully compiled and installed FFmpeg and X264 on my 9.04. Only one thing has to be noticed is that in the guide for 8.04 the package liblame-dev should be replaced by libmp3lame-dev, as liblame-dev seems no longer available. Maybe that's just the case for 9.04.

There are some slight differences between 9.04 and 8.04. Not much though. Anyway, I re-listed the 9.04 guide on the first page of this thread and also updated the 9.04 and 8.04 guides to include LAME compilation. LAME from their repositories is too old so it must be compiled.

FakeOutdoorsman
November 2nd, 2010, 09:06 PM
I am sorry to post these stupid question. actually this thread is 136 page long and I could not search my answer. on very first page I found this link

http://code.google.com/p/x264-ffmpeg-up-to-date/ where there is a ready-made script to install the codecs. the script ran fine and it showed all is done message at the end.

I can see ffmpeg codec options under my Kdenlive rendering option under admin account.

My stupid questions are :

1). How can I make sure the the codecs are installed for sure?
2). Kdenlive from one of the user account does not see those codecs, Are we suppose to install for each users?

Hope someone will answer the question.

Thanks in advance.

Not stupid questions, but unfortunately I've never used Kdenlive. I think some other users who frequent this thread have been able to get it working with a compiled FFmpeg (I think Kdenlive was compiled as well, but I can't remember) and hopefully they can provide a useful answer.

dannyboy79
November 3rd, 2010, 06:53 PM
I am sorry to post these stupid question. actually this thread is 136 page long and I could not search my answer. on very first page I found this link

http://code.google.com/p/x264-ffmpeg-up-to-date/ where there is a ready-made script to install the codecs. the script ran fine and it showed all is done message at the end.

I can see ffmpeg codec options under my Kdenlive rendering option under admin account.

My stupid questions are :

1). How can I make sure the the codecs are installed for sure?
2). Kdenlive from one of the user account does not see those codecs, Are we suppose to install for each users?

Hope someone will answer the question.

Thanks in advance.actually a PPA provider of kdenlive 0.7.8 and melt 5.10 has said that due to frequent API changes that it's not a good idea to try to use the latest and greatest ffmpeg due to ffmpeg and melt working together. I am using his PPA and use kdenlive all the time in my Lucid Lynx install. He also states it works in Maverick also. I can encode to x264 and aac audio using the default ffmpeg from ubuntu repo's but with medibuntu repos enabled for the -extra ffmpeg libraries. the info you seek can be found here: http://www.kdenlive.org/forum/kdenkive-078-packaged-ubuntu-maverick-lucid-karmic-jaunty
good luck

tvkpz
November 4th, 2010, 01:13 PM
Hi

I installed ffmpeg as given in the guide except that I used git.

So I think the checkinstall does not work for me. Any idea what is the command for checkinstall when I install from git.

Thanks!

FakeOutdoorsman
November 4th, 2010, 08:38 PM
Hi

I installed ffmpeg as given in the guide except that I used git.

So I think the checkinstall does not work for me. Any idea what is the command for checkinstall when I install from git.

Thanks!

How about this?

sudo checkinstall --pkgname=ffmpeg --pkgversion="5:git-$(date +%Y%m%d)" --backup=no \
--deldoc=yes --fstrans=no --default

tapas_mishra
November 8th, 2010, 03:03 PM
I get this error

E: Couldn't find package libjack-jackd2-dev

FakeOutdoorsman
November 8th, 2010, 08:41 PM
I get this error

E: Couldn't find package libjack-jackd2-dev

See my reply to you in Re: mp4 to flv using ffmpeg on Ubuntu server 10.04 (http://ubuntuforums.org/showpost.php?p=10089932&postcount=8).

tapas_mishra
November 9th, 2010, 07:23 AM
sudo apt-get remove ffmpeg x264 libx264-dev


sudo apt-get update
sudo apt-get install build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev



cd
git clone git://git.videolan.org/x264.git
cd x264
./configure --enable-libmp3lame


Gives me error

Unknown option --enable-libmp3lame, ignored

DaSilva_Ireland
November 9th, 2010, 04:57 PM
Hey, I am new to this and wondering about something. I did as the directions instructed and everything seemed to work alright.

However when I now try to build something with the ffmpeg libs I get errors. Code that previously compiled now gives tons of errors, I could understand if the errors were in my source but they seem to be in ffmpegs source.


gcc ffmpeg_test.c -o ffmpeg_test -lavutil -lavformat -lswscaleResults in many undefined references.


ffmpeg_test.c: In function ‘main’:
ffmpeg_test.c:85: warning: assignment makes pointer from integer without a cast
ffmpeg_test.c:88: warning: assignment makes pointer from integer without a cast
/usr/local/lib/libavformat.a(concat.o): In function `concat_close':
/home/******/ffmpeg/libavformat/concat.c:51: undefined reference to `av_freep'
/home/******/ffmpeg/libavformat/concat.c:52: undefined reference to `av_freep'
/usr/local/lib/libavformat.a(concat.o): In function `concat_open':
/home/******/ffmpeg/libavformat/concat.c:67: undefined reference to `av_strstart'
/home/******/ffmpeg/libavformat/concat.c:70: undefined reference to `av_mallocz'
/home/******/ffmpeg/libavformat/concat.c:78: undefined reference to `av_freep'
/home/******/ffmpeg/libavformat/concat.c:82: undefined reference to `av_malloc'
/home/******/ffmpeg/libavformat/concat.c:83: undefined reference to `av_freep'
/home/******/ffmpeg/libavformat/concat.c:94: undefined reference to `av_realloc'
/home/******/ffmpeg/libavformat/concat.c:99: undefined reference to `av_strlcpy'
/home/******/ffmpeg/libavformat/concat.c:117: undefined reference to `av_free'
/home/******/ffmpeg/libavformat/concat.c:122: undefined reference to `av_realloc'
...
many more
...
/usr/local/lib/libavformat.a(rtpenc_chain.o): In function `ff_rtp_chain_mux_open':
/home/******/ffmpeg/libavformat/rtpenc_chain.c:56: undefined reference to `av_free'
/home/******/ffmpeg/libavformat/rtpenc_chain.c:73: undefined reference to `av_free'
/home/******/ffmpeg/libavformat/rtpenc_chain.c:74: undefined reference to `av_free'
/home/******/ffmpeg/libavformat/rtpenc_chain.c:71: undefined reference to `av_free'
/usr/local/lib/libavformat.a(sauce.o): In function `ff_sauce_read':
/home/******/ffmpeg/libavformat/sauce.c:88: undefined reference to `av_malloc'
collect2: ld returned 1 exit status
make: *** [all] Error 1

jackachan
November 9th, 2010, 06:32 PM
Thank you for putting back the retired guides.

I have followed the guides for 10.04 to build the X264 and ffmpeg on a 10.04. Maybe it is just my problem, in the second step, I could not install libsdl1.2-dev. As it has the dependencies on older versions of some packages. I solved the problem by using "aptitude" instead of "apt-get". For "aptitude" it will ask me if I want to downgrade the dependencies to some older versions, then it works when I agree to downgrade.

FakeOutdoorsman
November 9th, 2010, 08:49 PM
Gives me error

Unknown option --enable-libmp3lame, ignored


No need to ask the same question in two (http://ubuntuforums.org/showpost.php?p=10092309&postcount=118) additional (http://ubuntuforums.org/showpost.php?p=10092273&postcount=9) threads. It appears that you followed the guide out of order and attempted to apply --enable-libmp3lame to x264.

You may be interested in using the repository FFmpeg instead. You may find it easier to install:

HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoders in FFmpeg (http://ubuntuforums.org/showthread.php?t=1117283)



... However when I now try to build something with the ffmpeg libs I get errors. Code that previously compiled now gives tons of errors, I could understand if the errors were in my source but they seem to be in ffmpegs source.

Sorry, I'm not sure of the answer, and I don't think I can help you much here. I recommend asking for help at the #ffmpeg IRC channel or the ffmpeg-user (http://ffmpeg.org/contact.html) mailing list.



Thank you for putting back the retired guides.

I have followed the guides for 10.04 to build the X264 and ffmpeg on a 10.04. Maybe it is just my problem, in the second step, I could not install libsdl1.2-dev. As it has the dependencies on older versions of some packages. I solved the problem by using "aptitude" instead of "apt-get". For "aptitude" it will ask me if I want to downgrade the dependencies to some older versions, then it works when I agree to downgrade.

I'm not sure what happened. Maybe an interfering PPA?

undercash
November 10th, 2010, 07:32 PM
Hello

I am having the following issue : I want to update my ffmpeg and here is the output:
http://pastebin.com/ZvM6qzrG

I previously tried on a test server where a fresher copy of ffmpeg was compiled (the same way as my live server btw) and I don't have any problems at all, neither when I try manually or using the updater script that you link too in the first post.

Can I just rename the actual ffmpeg source folder to ffmpeg_old and download a new one from where I will recompile ffmpeg? Even without having been able to apt-get remove neither make distclean?

Should I try to install ffmpeg using the apt-get manager to have a clean install and then remove/purge it. Then once uninstalled, I would compile from source again?

Thanks

FakeOutdoorsman
November 10th, 2010, 07:52 PM
Hello

I am having the following issue : I want to update my ffmpeg and here is the output:
http://pastebin.com/ZvM6qzrG
It looks like you're running make distclean in a directory where you never ran make in it so there is nothing to clean. You can just continue and not worry about these messages.


Can I just rename the actual ffmpeg source folder to ffmpeg_old and download a new one from where I will recompile ffmpeg?
Yes, you can do that if you want to, but I don't see many reasons to do that.


Even without having been able to apt-get remove neither make distclean?
Sorry, but I don't understand this question.


Should I try to install ffmpeg using the apt-get manager to have a clean install and then remove/purge it. Then once uninstalled, I would compile from source again?
Performing "apt-get install ffmpeg" would install the version from the repository. See the Updating FFmpeg and x264 section of the guide for an example of how to update FFmpeg.

undercash
November 10th, 2010, 08:01 PM
Hi, thanks a lot for this (very fast) answer.

I m using your tutorial for compiling and obviously I looked at it to update.

so you saw the result of the make distclean. Then I do


root@server:/root/ffmpeg# svn update

Fetching external item into 'libswscale'
External at revision 32618.

At revision 25716.

But it doesn't fetch any files (btw , this is probably the reason why the auto updater script fails as well).

You say I probably never made "make" on this directory but this is not possible since this is the directory from where I actually compiled ffmpeg some months ago

Thinking about ideas to be able to perform "apt-get remove ffmpeg" , since it is not possible right now, I thought I could install the package from repos, and then uninstall it so it would clean properly ffmpeg before recompiling from source. It's the only think that come to my mind right now: I didn't find almost any docs about that issue on googling it.
It's a live server of a streaming site so looks like a big risk for me, reason I trying to gather infos before any attempts on my own.

Thanks

FakeOutdoorsman
November 10th, 2010, 08:07 PM
Hi, thanks a lot for this (very fast) answer.

I m using your tutorial for compiling and obviously I looked at it to update.

so you saw the result of the make distclean. Then I do


root@server:/root/ffmpeg# svn update

Fetching external item into 'libswscale'
External at revision 32618.

At revision 25716.

But it doesn't fetch any files (btw , this is probably the reason why the auto updater script fails as well).
It doesn't fetch any files because there are no new files to fetch. You are up-to-date with the latest revision.


You say I probably never made "make" on this directory but this is not possible since this is the directory from where I actually compiled ffmpeg some months ago
I'm not sure then, but you can duplicate the behavior by grabbing a clean copy of the source and then running make distclean.

Cavsfan
November 10th, 2010, 08:48 PM
Thanks for that reminder to keep it up to date FakeOutdoorsman! After the update on Page 1:

27 files changed, 350 insertions(+), 298 deletions(-)

prupert
November 10th, 2010, 10:27 PM
Hello

I am having the following issue : I want to update my ffmpeg and here is the output:
http://pastebin.com/ZvM6qzrG

I previously tried on a test server where a fresher copy of ffmpeg was compiled (the same way as my live server btw) and I don't have any problems at all, neither when I try manually or using the updater script that you link too in the first post.

Can I just rename the actual ffmpeg source folder to ffmpeg_old and download a new one from where I will recompile ffmpeg? Even without having been able to apt-get remove neither make distclean?

Should I try to install ffmpeg using the apt-get manager to have a clean install and then remove/purge it. Then once uninstalled, I would compile from source again?

Thanks
Also, would "sudo dpkg -r ffmpeg" work better?

wheniwork
November 15th, 2010, 03:32 AM
Hi. When I run make i'm getting this error.


make: *** No rule to make target `libavcodec/x86/dsputil_h264_template_mmx.c', needed by `libavcodec/x86/dsputil_mmx.o'. Stop.

Any ideas?

FakeOutdoorsman
November 15th, 2010, 03:54 AM
I can't duplicate this error and everything compiled without issue for me on Ubuntu 10.10 64-bit. I need more information:

What Ubuntu version are you using?
Are you installing FFmpeg from a clean source, or are you attempting to upgrade a previous compiled FFmpeg?
Did you follow the guide word-for-word, or did you modify anything?
Do you know what FFmpeg revision you were attempting to compile?

You can find out the revision of your source with:

cd ~/ffmpeg
LANG=C svn info | grep Revision | awk '{ print $NF }'

Mark Rose
November 15th, 2010, 05:52 PM
I recently had problems converting flv files after following these instructions. If you have any troubles when using the --enable-shared options, try running `sudo ldconfig` which will make sure the proper libraries get loaded.

maxbear
November 15th, 2010, 08:09 PM
Thanks for the guide. When I run:


sudo checkinstall --pkgname=qt-faststart --pkgversion "4:SVN-r`LANG=C svn info | \
grep Revision | awk '{ print $NF }'`" --backup=no --deldoc=yes --fstrans=no \
--default install -D -m755 tools/qt-faststart /usr/local/bin/qt-faststart

I got the following error:


Installing with ...

========================= Installation results ===========================
/var/tmp/tmp.FJOuykVcii/installscript.sh: 4: : not found

**** Installation failed. Aborting package creation.

Cleaning up...OK

Any idea what's going wrong? :confused:

Bye.

mc4man
November 15th, 2010, 08:49 PM
I got the following error: .....
Try it like this, it appears the code box in post one has an errant space


sudo checkinstall --pkgname=qt-faststart --pkgversion "4:SVN-r`LANG=C svn info | \
grep Revision | awk '{ print $NF }'`" --backup=no --deldoc=yes --fstrans=no \
--default install -D -m755 tools/qt-faststart /usr/local/bin/qt-faststart

(otherwise you don't particularly need to 'install' qt-faststart, make executable and place in a bin in path (~/bin would be fine

FakeOutdoorsman
November 16th, 2010, 12:05 AM
Try it like this, it appears the code box in post one has an errant space

Thanks for noticing. Command updated.

Cavsfan
November 16th, 2010, 05:17 PM
Thanks for noticing. Command updated.

Thanks! I was able to get faststart installed without errors! :)

powersaver
November 19th, 2010, 12:21 PM
Hi FakeOutdoorsman.
I have almost completed the installation of ffmpeg and x264 following your instruction for Ubuntu 10.04, as my machine is running Ubuntu 10.04.1.
However, in the final stage of installing ffmpeg, the command line "hash x264 ffmpeg ffplay" failed, since "hash" command is not installed in my ubuntu. I double checked with "which hash" and "whereis hash". This hash process is not vital, I believe. But problem is ffmpeg is not installed. "whereis ffmpeg" returns nothing. The rest of the products, lame qt-faststart vpxdec vpxenc x264 have been installed in /usr/local/bin.

------------- the process I followed for ffmpeg ------------------
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc \
--enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb \
--enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid \
--enable-x11grab
make
sudo checkinstall --pkgname=ffmpeg --pkgversion "4:SVN-r`LANG=C svn info | \
grep Revision | awk '{ print $NF }'`" --backup=no --default --deldoc=yes
hash x264 ffmpeg ffplay
--------------------------------------------------------------------

Should I execute "make install" in the ffmpeg source directory?
I wonder I have done something strange, as no one seems to have this problem.
Also how can I get "hash" command for Ubuntu? Do you have any idea why my Ubuntu does not have one? I am running the default shell, which is I think bash.
Thank you for your detailed guide.

FakeOutdoorsman
November 24th, 2010, 11:51 PM
Sorry for the late reply. I was out of town for a week with no computer access.


However, in the final stage of installing ffmpeg, the command line "hash x264 ffmpeg ffplay" failed, since "hash" command is not installed in my ubuntu. I double checked with "which hash" and "whereis hash". This hash process is not vital, I believe.
hash shouldn't require any additional tasks by the user to enable it because it is included in the bash shell, and by default, Ubuntu should be using the bash shell. Can you make sure you're using bash?

$ echo $SHELL
/bin/bash


But problem is ffmpeg is not installed. "whereis ffmpeg" returns nothing. The rest of the products, lame qt-faststart vpxdec vpxenc x264 have been installed in /usr/local/bin.
Did you encounter any errors or useful messages during installation?

Jose Catre-Vandis
November 28th, 2010, 01:57 AM
Here's a handy tip - if you haven't followed this howto and just have good old ordinary ffmpeg, and need to extract 5.1 (6) channel AAC audio to 2 channel audio from an mkv file. Most howtos about doing this expect compilation from source!

Install faad from the repositories

Identify the track number of the audio you want:


mkvmerge -i input.mkv
(in this case "2")

then extract the audio using mkvextract:


mkvextract tracks input.mkv 2:input.aac (was ac3)

then run it on the aac (was ac3) file as follows:


faad -d -o output.wav input.aac (was ac3)

You can now encode the resultant wav file to you desired format, and then stick it back into the mkv if you want: e.g.

mkvmerge -o output.mkv input.mkv stereo.mp3

qyot27
November 28th, 2010, 04:29 PM
Here's a handy tip - if you haven't followed this howto and just have good old ordinary ffmpeg, and need to extract 5.1 (6) channel AAC audio to 2 channel audio from an mkv file. Most howtos about doing this expect compilation from source!

Install faad from the repositories

Identify the track number of the audio you want:


mkvmerge -i input.mkv
(in this case "2")

then extract the audio using mkvextract:


mkvextract tracks input.mkv 2:input.ac3

then run it on the ac3 file as follows:


faad -d -o output.wav input.ac3

You can now encode the resultant wav file to you desired format, and then stick it back into the mkv if you want: e.g.

mkvmerge -o output.mkv input.mkv stereo.mp3
If the audio stream is AAC, there's no need - and rather bewildering, really - to give it an .ac3 extension. The extension being different means nothing; it's not suddenly an AC3 file (if it were really an AC3, then faad couldn't do jack with it), it's just a mis-named AAC file.

ron999
November 28th, 2010, 04:48 PM
Yes, I agree with you qyot27.
It just needs the command changing to:-

mkvextract tracks input.mkv 2:input.aac
And this command becomes:-

faad -d -o output.wav input.aac

I have done some work using faad to decode the 5.1 aac (using faad-2.7).
I found that I could pipe the output from faad straight into another encoder without creating a wav file.
It seems to be OK using a command like this:-

faad -d -w foo_6.aac | faac -q 120 -X -P - -o foo_2.aac
(foo_6.aac is the original 5.1 aac and foo_2.aac is the new stereo aac)

mika91
November 29th, 2010, 10:55 AM
Hi,

Just installed latest ffmpeg SVN, but I can't play WMA lossless audio files !



Stream mapping:
Stream #0.0 -> #0.0
Decoder (codec id 86057) not found for input stream #0.0


I don't understand

andrew.46
November 29th, 2010, 11:54 AM
Hi mika,


Just installed latest ffmpeg SVN, but I can't play WMA lossless audio files !

For wma lossless you need MPlayer + an external codec:



andrew@skamandros~/samples$ mplayer -ac wma9dmo luckynight.wma
MPlayer SVN-r32648-4.3.3 (C) 2000-2010 MPlayer Team

Playing luckynight.wma.
ASF file format detected.
[asfheader] Audio stream found, -aid 1
Clip info:
title: Lucky Night
author: Jody Marie Gnant
copyright: 1995 Sirius Publishing
comments: 1-minute song sample demonstrating Windows Media lossless audio compression
================================================== ========================
Forced audio codec: wma9dmo
Opening audio decoder: [dmo] Win32/DMO decoders
AUDIO: 44100 Hz, 2 ch, s16le, 868.7 kbit/61.55% (ratio: 108583->176400)
Selected audio codec: [wma9dmo] afm: dmo (Windows Media Audio 9 DMO)
================================================== ========================
AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A: 63.1 (01:03.0) of 60.5 (01:00.4) 5.5%


Exiting... (End of file)


Andrew

lovinglinux
December 3rd, 2010, 12:44 PM
Great tutorial. Thanks. Working like a charm.

undercash
December 12th, 2010, 04:55 PM
I have been upgrading yesterday and I am now meeting a strange issue.

Whenever I try to convert a big size video, after a good while, ffmpeg start a new conversion on top of the unfinished first conversion, that is still running. Obviously the output results in a corrupt file.

it's very easy to observe with htop since the number of ffmpeg process duplicate as well as the cpu load. If I use 2 pass command , then they will be mixed (when new conversion starts) with the second pass process

I tried several command, 1 pass or 2 pass, same result.

Note that I have been using ffmpeg with my script for over a year and it never happened such thing. I was able to convert files up to one giga without any similar issue.

Any ideas? thanks

FakeOutdoorsman
December 13th, 2010, 02:07 AM
If you post your complete script I can attempt to duplicate the behavior. What Ubuntu version are you using?

undercash
December 13th, 2010, 02:12 AM
Hello thanks for your answer

here is the script (part of it)

http://pastebin.com/Y2U4b8Xv

I m using hardy. As I said, I have been using this script for long time now and I get this problem with big file size (over 500mb or so)

Ps: i forgot to mention but this is a cms so i guess it's impossible to post the complete script

Mesreth
December 22nd, 2010, 08:15 PM
I apologize if this has been covered before. I am trying to grab an h.323 stream and rebroadcast it live for use in a webpage as an embedded video. I'm not sure how to grab the h.323 stream (h.264 video and g711/g722 audio). I'd prefer to actually grab the stream and not try to grab the screen. Any ideas?

FakeOutdoorsman
December 22nd, 2010, 08:50 PM
I apologize if this has been covered before. I am trying to grab an h.323 stream and rebroadcast it live for use in a webpage as an embedded video. I'm not sure how to grab the h.323 stream (h.264 video and g711/g722 audio). I'd prefer to actually grab the stream and not try to grab the screen. Any ideas?

I've never tried anything like that. You might get a better answer at the #ffmpeg IRC channel, or the ffmpeg-user (http://ffmpeg.org/contact.html) mailing list.

Mesreth
December 22nd, 2010, 09:02 PM
I've never tried anything like that. You might get a better answer at the #ffmpeg IRC channel, or the ffmpeg-user (http://ffmpeg.org/contact.html) mailing list.

Thanks, I'll do that, though one thought came to me that you might know. If you know the ports the audio and video are coming in from (standard RTP) can you grab it from the ports, and if so, how?

FakeOutdoorsman
December 22nd, 2010, 10:45 PM
If you're using FFmpeg directly, maybe something like:

ffmpeg -i rtmp://192.168.1.1:29823/stream.foo ...
Perhaps you can just use JW Player or Flowplayer to handle the stream. It's worth investigating. These are Flash based players that allow a viewer to watch a video in a browser.

Mesreth
December 23rd, 2010, 12:05 AM
If you're using FFmpeg directly, maybe something like:

ffmpeg -i rtmp://192.168.1.1:29823/stream.foo ...
Perhaps you can just use JW Player or Flowplayer to handle the stream. It's worth investigating. These are Flash based players that allow a viewer to watch a video in a browser.

I'm not so concerned about how to display the feed in the browser (going to avoid flash if at all possible). Mostly concerned about how to grab the stream. We will have to "bridge the call" to get the feed to the computer to begin with, there is also the possibility of grabbing the stream from the variable in the program that does the bridging (assuming open source).

qyot27
December 24th, 2010, 02:11 AM
There's no guarantee it'll work, but get-flash-videos has the ability to grab stuff off RTMP streams from various sites (youtube-dl and nicovideo-dl are similar in purpose as well - those are in the repositories, but gfv isn't). It's based around rtmpdump (http://packages.ubuntu.com/maverick/rtmpdump), which IIRC has its project page hosted on mplayer's servers.

You may also need to install the gfv-plugins extension, since that adds lots of other sites to the script's capabilities (the extension advertises its use for Hulu, but I never got that to work; the plugin does work for other sites, though).

Drenriza
December 26th, 2010, 09:44 AM
does this guide work with ubuntu 10.10?

FakeOutdoorsman
December 26th, 2010, 06:21 PM
does this guide work with ubuntu 10.10?
Yes. See the first page (http://ubuntuforums.org/showthread.php?t=786095) of this guide for 10.10 instructions.

Drenriza
December 28th, 2010, 09:43 AM
Thanks. I royalty missed that.

But can you tell me what source to add, since i cannot find all the necessary packages. I dont see this described in your guide. Besides activating multisource.

If you can give the exact line to add to my /etc/apt/sources.list that would be great.

Thanks

edit
E: Kunne ikke lokalisere pakken libfaac-dev
E: Kunne ikke lokalisere pakken libopencore-amrwb-dev
E: Kunne ikke lokalisere pakken libx11-dev

qyot27
December 28th, 2010, 05:02 PM
After you activated Universe and Multiverse, did you reload the repositories? sudo apt-get update or the Reload button in Synaptic.

Drenriza
December 29th, 2010, 09:34 AM
After you activated Universe and Multiverse, did you reload the repositories? sudo apt-get update or the Reload button in Synaptic.

Did both after activated the repositories.

qyot27
December 29th, 2010, 04:40 PM
It should find them, then. packages.ubuntu.com reports libfaac-dev in multiverse, libopencore-amrwb-dev in universe, and libx11-dev in one of the main repositories (I would assume Main, not Restricted).

http://packages.ubuntu.com/maverick/libx11-dev
http://packages.ubuntu.com/maverick/libopencore-amrwb-dev
http://packages.ubuntu.com/maverick/libfaac-dev

If all else fails, you can download them through there and install them with dpkg -i pkgname.deb or Gdebi or Software Center. Just make sure the other dependencies are filled, though. The pages show what those packages depend on.


Which server are you using? The local (Denmark, I would assume) server, or the Main one? It may be related to not using Main, or - and someone else would have to answer this - something in the instructions screwing up because of the language settings. As I recall, this was a problem for some users in the checkinstall step some time ago.

smtkr
December 29th, 2010, 06:09 PM
All:

I have followed the directions given in the post "Install FFmpeg and x264 on Ubuntu Lucid Lynx 10.04" ( http://ubuntuforums.org/showpost.php?p=9868359&postcount=1289 ) to the letter and have failed to get a fully functional build of ffmpeg. If anyone has the time, can you review my issue and shoot a few ideas my way.

History:
1. Not knowing that ffmpeg was stripped, I installed the ffmpeg package and the libavcodec-extra-52 package (possibly a few more; I was liberal with the package manager on day one of the install). This failed to produce a version of ffmpeg that could transcode audio with libfaac.
2. I removed those packages and added the medibuntu repository and installed the same packages but ran into some sort of error when trying to convert an mkv (sorry, I can't remember the error)
3. [Currently hung on this one] Building components from source, as noted in the introduction, has provided a copy of ffmpeg that doesn't encode with the libx264 codec

Issue:
I compiled and installed all of the packages (including optional lame and vpx). There weren't any issues, save for the apparently innocuous warnings which inexorably appear during a compile.

To test the build, I ran a basic test command that works on my mac (installed with macports):

ffmpeg -i ./pp.mkv -vcodec libx264 -acodec libfaac -t 15 ./a.mp4

The job fails immediately with the following error:

Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height

Google... and I came across this mail indicating a similar issue ( http://mailman.videolan.org/pipermail/x264-devel/2009-August/006123.html ), which says "This error *CANNOT APPEAR* unless ffmpeg has been miscompiled."

OK. I had an issue with the compile. I tried the suggestion of comparing the header build spec (turns out to be 122) with the shared library linked in the ffmpeg binary (given by ldd). But, when I issued the ldd command on the ffmpeg binary, there was no reference, at all, to x264.

Now, I wanted to see if my libx264 files really were placed when I built the x264 package. So, I ran mlocate to see what exists:


mlocate 264
/home/brucew/.mozilla/firefox/83cf7lv6.default/Cache/2644ADC7d01
/usr/lib/libx264.so.85
/usr/lib/gstreamer-0.10/libgsth264parse.so
/usr/lib/i686/sse2/libx264.so.85
/usr/local/bin/x264
/usr/local/include/x264.h
/usr/local/include/x264_config.h
/usr/local/lib/libx264.a
/usr/local/lib/pkgconfig/x264.pc
...

So, a little problem there--I built 122, but I have an 85 module out there, for some reason. "No problem," I thought. "I will just specify the include and lib paths with the CFLAGS and LDFLAGS environment variables:

export CFLAGS=-I/usr/local/include:$CFLAGS
export LDFLAGS=-L/usr/local/lib:$LDFLAGS

So, I removed the old checkinstall package and did the ffmpeg build again by
make distclean, ./configure..., make... The outcome was identical.

My impression was that it ignored the CFLAGS and LDFLAGS that I set (or the default paths superseded). My next attempt involved renaming the /usr/lib/libx264.so.85 module to aaaaaa.so.85 and then creating the following symlinks in /usr/lib pointing to /usr/local/lib/libx264.a

libx264.a
libx264.so
libx264.so.122

I repeated the ffmpeg rebuild procedure and ran into the same issue AGAIN!

ARRRRGGGHGHHHH!

Does anyone have a firm understanding of what is happening here, what is interfering with my build, or where I could have made a mistake? What is the best way for me to get an ffmpeg build that is pretty well loaded with prominent codecs (like my macports version).

I'm willing to try just about anything.

Thanks.

mc4man
December 29th, 2010, 07:15 PM
. But, when I issued the ldd command on the ffmpeg binary, there was no reference, at all, to x264.
If you followed this guide. which it appears you did, then you've statically linked x264 w/ ffmpeg - so there should be no reference in ldd
(if you had built x264 as shared there would be

Your orig. issue most likely was your ffmpeg command, (and at this point possibly any of the things you've done to 'fix' something that wasn't 'broke' to begin with

FakeOutdoorsman
December 29th, 2010, 08:54 PM
To test the build, I ran a basic test command that works on my mac (installed with macports):


ffmpeg -i ./pp.mkv -vcodec libx264 -acodec libfaac -t 15 ./a.mp4

The job fails immediately with the following error:

Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height

You simply need to use a preset (with the -vpre option) when using -vcodec libx264. See the Using FFmpeg and x264 section of the guide for examples. Also see the FFmpeg x264 encoding guide (http://rob.opendot.cl/index.php/useful-stuff/ffmpeg-x264-encoding-guide/).

khughitt
December 30th, 2010, 11:17 PM
Is there any advantage (in terms of performance or compatibility) for choosing MKV over MP4 for generating lossless H.264?


Thanks for the excellent guide FakeOutdoorsman :)
Cheers,

FakeOutdoorsman
December 31st, 2010, 12:24 AM
I doubt there is much of a performance difference when encoding. I also doubt decoding would be much different, but I'm not totally sure because I don't have much experience with hardware accelerated decoding such as with VDPAU.

I tend to use MKV on the rare occasion that I do use lossless H.264 simply because it can handle more audio formats.

perspectoff
December 31st, 2010, 01:27 AM
Oh good. Does FFMPEG finally have audio and video synch'd?

I've been with mencoder for some time due to the synch problems.

FakeOutdoorsman
December 31st, 2010, 01:56 AM
Sorry, but I'm not exactly sure of what you're asking without any context. If you post your MEncoder command or tell me what output format(s) you are interested in I can give you a FFmpeg equivalent for you to try.

khughitt
December 31st, 2010, 12:04 PM
I doubt there is much of a performance difference when encoding. I also doubt decoding would be much different, but I'm not totally sure because I don't have much experience with hardware accelerated decoding such as with VDPAU.

I tend to use MKV on the rare occasion that I do use lossless H.264 simply because it can handle more audio formats.

Sounds good. Thanks for the clarification :)

FakeOutdoorsman
December 31st, 2010, 09:56 PM
Sounds good. Thanks for the clarification :)

Of course it all depends on what you're doing, and I don't really know what that is. I've used lossless on a few occasions:
Capturing the screen as shown here: HOWTO: Proper Screencasting on Linux (http://ubuntuforums.org/showthread.php?t=1392026).
Creating an intermediate format (such as above). This would also be a nice alternative to huffyuv when using Adobe Premiere or some other editors, but I haven't tried to get that working yet.
Messing around with lossless for the hell of it.
A good lossy encode with a proper crf value usually gets the job done though.

khughitt
January 1st, 2011, 02:32 PM
Of course it all depends on what you're doing, and I don't really know what that is. I've used lossless on a few occasions:

I'm using it for something a bit non-standard: on-the-fly generation of relatively small (~100-300 frame) videos of solar images (http://helioviewer.org/blog/2010/12/29/helioviewer-org-update-improved-movie-quality/). Since the videos are short, and since they need to be created on the fly, I am optimizing for speed and quality.

The approach I've taken up until now has been to generate two different versions of each video: one for in-browser viewing (which should be around ~10M or less for decent streaming) and another "high-quality" download version which could be much larger. Recently I began experimenting with lossless encoding for the downloadable version (with files from ~50-300M), but as I'm doing some more testing it looks like it is really not all the necessary; simply choosing a low enough CRF results in a very high-quality video with a smaller filesize. Further, it seems like Quicktime doesn't support the lossless H.264 out-of-the-box, and since a large number of our users are likely to be using that, it's not really a good option. I'm still doing some testing with different presets and CRF values but it looks like what I may end up doing is something like -crf 18 for the in-browser videos and -crf 10 or 15 for the high-quality download version.

dave-buntu
January 5th, 2011, 12:12 AM
I tried installing the dependencies and apt displayed this message below.


E: Couldn't find package libjack-jackd2-dev

Did I type it in wrong, or is there anywhere else I can find it?

FakeOutdoorsman
January 5th, 2011, 12:51 AM
The libjack-jackd2-dev package is for Ubuntu Maverick Meerkat 10.10 and newer. Are you following the correct guide for your Ubuntu version?

noleks
January 6th, 2011, 12:58 AM
Hi:I'm running Lucid. On step #7 I get this:

noleks-ub:~/ffmpeg> sudo checkinstall --pkgname=ffmpeg --pkgversion "4:SVN-r`LANG=C svn info | \ grep Revision | awk '{ print $NF }'`" --backup=no --default --deldoc=yes
NF: Undefined variable.

Where is NF defined?
Thanks

FakeOutdoorsman
January 6th, 2011, 02:27 AM
Works for me. It appears that your checkinstall command was copied incorrectly. Did you modify it? You can just copy and paste the command into your terminal and it should work fine.

noleks
January 6th, 2011, 02:45 AM
Yes I've been cutting and pasting directly from the how-to.
Can you just try echo $NF and see what it gives you?
Maybe I need to be using a shell other than tcsh?

FakeOutdoorsman
January 6th, 2011, 03:22 AM
I am unfamiliar with tcsh and these guides were written for bash. Looks like tcsh also chokes on LANG=C too. I can't investigate this very throughly right now, but if you want a quick and dirty solution:

ubuntu:~/ffmpeg> svn info | grep Revision
Revision: 26239
ubuntu:~/ffmpeg> sudo checkinstall --pkgname=ffmpeg --pkgversion "4:SVN-r26239" --backup=no --default --deldoc=yes

noleks
January 6th, 2011, 05:52 PM
Hi:
I've gone back through the whole process and confirmed that by using bash, I have no issues.
Thanks

Scott O'Nanski
January 8th, 2011, 01:22 PM
When I


./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc \
> --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb \
> --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis \
> --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab


I get the following message bounced back;



ERROR: libx264 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.log" produced by configure as this will help
solving the problem.
.

Anyone know why this is, or how to circumvent it?

Pablo_F
January 8th, 2011, 07:17 PM
Thanks a lot for this howto. It is the second time I just copy-paste the commands to a terminal as I read the rest of the post while the terminal is throwing "human"-readable lines. (I have followed the lucid version)

:popcorn:

FakeOutdoorsman
January 8th, 2011, 09:06 PM
...
I get the following message bounced back;

ERROR: libx264 not found.
Anyone know why this is, or how to circumvent it?
Are you using Ubuntu Nattty Narwhal 11.04? The guide doesn't work for that yet, and I can confirm that FFmpeg is having trouble finding x264 in that Ubuntu version.

Edit: I forgot to mention that current latest (FFmpeg version SVN-r26269) worked for me on 10.10.


Thanks a lot for this howto. It is the second time I just copy-paste the commands to a terminal as I read the rest of the post while the terminal is throwing "human"-readable lines. (I have followed the lucid version)

Glad it worked for you.

qyot27
January 9th, 2011, 01:37 AM
Are you using Ubuntu Nattty Narwhal 11.04? The guide doesn't work for that yet, and I can confirm that FFmpeg is having trouble finding x264 in that Ubuntu version.
Does it work on Natty if ffmpeg is forced to look at /usr/local/include and /usr/local/lib?

This assuming, of course, that the real problem was Natty, not that x264 hadn't been installed.


Anyone know why this is, or how to circumvent it?
Either
A) remove --enable-libx264 from the command, or
B) as the error message said to do, post the contents of the config.log file that was created when you told ffmpeg to ./configure - that'll show more or less exactly what happened.

mc4man
January 9th, 2011, 05:52 AM
I can confirm that FFmpeg is having trouble finding x264 in that Ubuntu version.

It is actually finding but failing on a number of undefined ref.'s
Doesn't matter where x264 is installed (tried /usr, /usr/local and $HOME

If x264 is built shared then no problem, but that presents other possible issues.

What does work is to use gcc-4.4, whether just on one or the other not sure, didn't break down.
Was fine though building both with 4.4
( for x264 export in terminal, for ffmpeg a configure option

edit:
just finished building, ect. - all seems well

uname -a && ffmpeg
Linux doug-alienware 2.6.37-12-generic #26-Ubuntu SMP Wed Jan 5 18:42:49 UTC 2011 i686 GNU/Linux
FFmpeg version SVN-r26278, Copyright (c) 2000-2011 the FFmpeg developers
built on Jan 8 2011 23:57:05 with gcc 4.4.5
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --cc=gcc-4.4
libavutil 50.36. 0 / 50.36. 0
libavcore 0.16. 0 / 0.16. 0
libavcodec 52.108. 0 / 52.108. 0
libavformat 52.92. 0 / 52.92. 0
libavdevice 52. 2. 3 / 52. 2. 3
libavfilter 1.72. 0 / 1.72. 0
libswscale 0.12. 0 / 0.12. 0
libpostproc 51. 2. 0 / 51. 2. 0
Hyper fast Audio and Video encoder

(ffmpeg definitely needs 4.4, (atm), didn't ck. on x264 though wouldn't hurt to use 4.4 also, ie.
export CC=gcc-4.4 && ./configure

FakeOutdoorsman
January 9th, 2011, 07:22 AM
I haven't had much of a chance to investigate this lately, but I also found that --enable-shared on x264 works as far as I can tell with my limited meddling.

Works fine with gcc 4.5.2 on Arch Linux.

mc4man
January 9th, 2011, 08:12 AM
Works fine with gcc 4.5.2 on Arch Linux.
i know it worked fine 3 - 4 wks ago, don't recall if it was 4.5.1 or .2, just did a fresh install so can't ck. (natty is now 4.5.2 + svn <whatever>
Certainly premature anyway, if it doesn't resolve down the road then there is always shared or 4.4.X

Argosse
January 9th, 2011, 09:37 AM
Thank you so so much for this guide, now Im finally able to convert all my dvd backup avi's to mp4 for my Ipod touch and stream them with apache.

andrew.46
January 9th, 2011, 10:20 AM
Hi mc4man,





uname -a [...]
Linux doug-alienware 2.6.37-12-generic #26-Ubuntu SMP Wed Jan 5 18:42:49 UTC 2011 i686 GNU/Linux



A little aside from the main discussion, is that the default kernel for natty? I am a little amazed that it is in use so quickly as it was only released a few days ago! A little peeved as well since I have compiled my own copy with a degree of pain:



andrew@skamandros~$ uname -rv
2.6.37-ads #1 SMP Sat Jan 8 17:18:36 EST 2011


(ads = my initials)

Andrew

Scott O'Nanski
January 9th, 2011, 10:25 AM
Are you using Ubuntu Nattty Narwhal 11.04? The guide doesn't work for that yet, and I can confirm that FFmpeg is having trouble finding x264 in that Ubuntu version.

Edit: I forgot to mention that current latest (FFmpeg version SVN-r26269) worked for me on 10.10.



Glad it worked for you.

Sorry I didn't respond sooner. I'm currently using Ubuntu 10.10.

I'll check the rest of the posts and try again.

Thanks for your efforts.

Scott O'Nanski
January 9th, 2011, 10:25 AM
Does it work on Natty if ffmpeg is forced to look at /usr/local/include and /usr/local/lib?

This assuming, of course, that the real problem was Natty, not that x264 hadn't been installed.


Either
A) remove --enable-libx264 from the command, or
B) as the error message said to do, post the contents of the config.log file that was created when you told ffmpeg to ./configure - that'll show more or less exactly what happened.


Don't know how to do that.

qyot27
January 9th, 2011, 11:04 AM
Don't know how to do that.
Which part? All removing --enable-libx264 means is to go to that part of the command, and Backspace (or Delete) it from the line before going further. Or remove it from the command in your own personal copy of the instructions, if you keep one around.

For config.log, it's in the ffmpeg source directory - so, assuming you're in that directory:

gedit config.log
Copy and paste the contents into your post.

But since we're talking about 10.10 here, have you installed x264 as described by the guide?

LauraKBurt
January 9th, 2011, 11:42 AM
Really its a good news.This site has lots of advantage. I found many interesting things from this site. I like it very much. Its so interesting.I want to sharing this topic with some of my close friends. So thanks this post.

mc4man
January 9th, 2011, 05:56 PM
Hi mc4man,
A little aside from the main discussion, is that the default kernel for natty

As of the other day, I gather it will use 2.38 eventually.
Overall I'm not too sure i'll have any use for 11.04 on my recent laptop, though I do like it for a much older p4 desktop with 23" display (where i have it now.
Probably will redo the eventual 2.38 when and if a bfs patch becomes avail., I have seen a bit of overall improvement with that on the p4 in 10.10 (2.36

ch3rryc0ke
January 14th, 2011, 08:26 AM
EDIT: Fixed my own problem

I had inadvertently entered the svc command twice, which created another ffmpeg src folder nested in my ffmpeg source folder, causing the problem. Deleted everything and recompiled and all is well.

------

Thanks a lot for the guide..

I'm getting the following error on Ubuntu 10.10 when running the make command for ffmpeg. This seemed to happen towards the tail end of compilation as it took a good 10 minutes of compiling before I hit this error.

Also, there were no problems with the configure step.

I believe the version of ffmpeg is 26326.

Any idea what it could be? What should I do now to get it working?


AR libavutil/libavutil.a
CC ffmpeg.o
ffmpeg.c: In function ‘term_exit’:
ffmpeg.c:424: warning: zero-length gnu_printf format string
ffmpeg.c: In function ‘opt_audio_sample_fmt’:
ffmpeg.c:2891: warning: passing argument 1 of ‘list_fmts’ from incompatible pointer type
cmdutils.h:165: note: expected ‘void (*)(char *, int, int)’ but argument is of type ‘char * (*)(char *, int, enum AVSampleFormat)’
ffmpeg.c: At top level:
ffmpeg.c:247: warning: ‘sws_flags’ defined but not used
ffmpeg.c: In function ‘output_packet’:
ffmpeg.c:1045: warning: dereferencing pointer ‘picture2’ does break strict-aliasing rules
ffmpeg.c:1603: note: initialized from here
CC cmdutils.o
cmdutils.c: In function ‘init_opts’:
cmdutils.c:67: warning: ‘sws_getContext’ is deprecated (declared at libswscale/swscale.h:191)
cmdutils.c: In function ‘read_file’:
cmdutils.c:735: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
LD ffmpeg_g
CP ffmpeg
STRIP ffmpeg
strip: Warning: 'ffmpeg' is not an ordinary file
make: *** [ffmpeg] Error 1

FakeOutdoorsman
January 19th, 2011, 04:45 AM
Yesterday I updated the Meerkat guide to Git because that's what FFmpeg is now using, but the Git repository location changed since then. If you followed this guide yesterday and plan to use the ffmpeg directory to update FFmpeg then issue the following command:

cd ~/ffmpeg && git remote set-url origin git://git.ffmpeg.org/ffmpeg.git

Amefurashi
January 19th, 2011, 10:07 AM
Hello,
sorry for the very n00b question: I succeded in compiling x264 on my Maverick Merkaat 64-bit using the guide in the first post, but I only get the 64-bit build. Is there a quick method to obtain the 32-bit build too?
Also, are there any differences between "make" and "make fprofiled"? Does the second option provide a more optimized code?
Thank you!

Regards,
Ame

qyot27
January 19th, 2011, 08:40 PM
Hello,
sorry for the very n00b question: I succeded in compiling x264 on my Maverick Merkaat 64-bit using the guide in the first post, but I only get the 64-bit build. Is there a quick method to obtain the 32-bit build too?
Also, are there any differences between "make" and "make fprofiled"? Does the second option provide a more optimized code?
Thank you!

Regards,
Ame
Personally I think doing a 32-bit build on 64-bit Linux is a bit useless*, but it should be a simple matter of using --cross-prefix and --host, specifying the 32-bit architecture (what is it, i686-linux-gnu or something like that? check in /usr).

*as the relevant tools on Linux are all usable in 64-bit for a proper toolchain. The only exception would be if you were using a more powerful 64-bit-running machine to compile software for an older 32-bit-running machine. Then you'd need to use --prefix so as not to end up installing in an inconvenient spot in the file hierarchy.

If you want to build ffmpeg as 32-bit, you'd need to use --cross-prefix, --target-os, and --arch (or maybe just --arch, but it may complain about not having the other two).


I usually do cross-compiles for Windows using mingw, but it's the same basic principle to do it for any other given system, provided the right cross-compiler is installed (and on a 64-bit system, the 32-bit compiler is a cross-compiler). In my case, x264 looks like this:

PKG_CONFIG_PATH=$HOME/win32_build/lib/pkgconfig ./configure --prefix=$HOME/win32_build --cross-prefix=i586-mingw32msvc- --extra-cflags="-I$HOME/win32_build/include -march=pentium3" --extra-ldflags="-L$HOME/win32_build/lib" --qtsdk=$HOME/qtsdk --host=i586-mingw32msvc
Some of that extra stuff is because I include LAVF, FFMS2, and Audio support; look at how I specified --cross-prefix and --host. The hyphen at the end of the cross-prefix command is necessary, because it will try to look for the regular compiling toolchain with i586-mingw32msvc- attached to the front of it. So instead of looking for gcc, it looks for i586-mingw32msvc-gcc. Without the hyphen, the needed calls would be misspelled.

So in the case of 32-bit Linux, it might look like this instead:

./configure --cross-prefix=i686-linux-gnu- --host=i686-linux-gnu

Amefurashi
January 20th, 2011, 06:34 PM
The only exception would be if you were using a more powerful 64-bit-running machine to compile software for an older 32-bit-running machine. Then you'd need to use --prefix so as not to end up installing in an inconvenient spot in the file hierarchy.

Indeed, that's exactly my purpose: providing 32-bit builds (not for personal use), but compiling them on my 64-bit maverick.

Also, I'd love to implement LAVF and FFMS2 support in my builds: is it possible under linux?

Thanks again,
Ame

andrew.46
January 20th, 2011, 10:40 PM
Hi Ame,

x264 should automagically enable lavf input for you in the presence of FFmpeg header. This should be seen with ./configure as follows:



andrew@skamandros~/Desktop/x264$ ./configure
Platform: X86
System: LINUX
asm: yes
avs: no
lavf: yes
ffms: no
gpac: no
gpl: yes
thread: posix
filters: resize crop select_every
debug: no
gprof: no
PIC: no
shared: no
visualize: no
bit depth: 8

You can run 'make' or 'make fprofiled' now.


and after compilation should show:



andrew@skamandros~/Desktop/x264$ x264 --help | head -n 14
x264 core:112 r156 22bfd31
Syntax: x264 [options] -o outfile infile

Infile can be raw (in which case resolution is required),
or YUV4MPEG (*.y4m),
or Avisynth if compiled with support (no).
or libav* formats if compiled with lavf support (yes) or ffms support (no).
Outfile type is selected by filename:
.264 -> Raw bytestream
.mkv -> Matroska
.flv -> Flash Video
.mp4 -> MP4 if compiled with GPAC support (no)
Output bit depth: 8 (configured at compile time)


Andrew

LyingB
January 21st, 2011, 05:46 AM
I think you should remove subversion from Updating FFmpeg and x264 section.

FakeOutdoorsman
January 21st, 2011, 05:51 AM
You're right. I missed it when I git-ized the guide. Thanks.

qyot27
January 21st, 2011, 07:12 AM
Also, I'd love to implement LAVF and FFMS2 support in my builds: is it possible under linux?
To trim it down to size, the basic outline looks like this:

FFmpeg (stripped down), installed to custom prefix
FFMS2, installed to custom prefix
x264, LAVF and FFMS2 should be detected and used
(if you want a fully-featured FFmpeg you'll then need to build it again as this thread's main guide details)

Just copy-and-pasting from my most recent reference file, with some adjustments:

git clone git://git.ffmpeg.org/ffmpeg.git
svn checkout http://ffmpegsource.googlecode.com/svn/trunk/ ffms2
git clone git://git.videolan.org/x264.git
FFmpeg (basic):

cd ffmpeg
./configure --prefix=$HOME/ffms2_build --enable-gpl --enable-version3 --enable-postproc --disable-encoders \
--disable-muxers --disable-debug --disable-network --disable-hwaccels --disable-indevs --disable-outdevs \
--extra-cflags="-march=native"
make
make install
FFMS2:

cd ../ffms2
./configure --prefix=$HOME/ffms2_build PKG_CONFIG_PATH=$HOME/ffms2_build/lib/pkgconfig
make
make install
x264:

cd ../x264
PKG_CONFIG_PATH=$HOME/ffms2_build/lib/pkgconfig ./configure --prefix=$HOME/x264_build --extra-cflags="-march=native"
make
make install
make distclean
PKG_CONFIG_PATH=$HOME/ffms2_build/lib/pkgconfig ./configure --prefix=$HOME/x264_build/x264-10bit \
--extra-cflags="-march=native" --bit-depth=10
make
make install

Of course, adding in the proper options for cross-compiling (the --extra-cflags="-march=native" parameter should be changed to whatever processor the target machine uses*; if that's not known, leave the option out entirely). The 10-bit step for x264, starting with the 'make distclean', can be omitted if you don't find it necessary.

*actually using 'native' will set it to the processor of the computer doing the compiling. The reference file actually has pentium3 specified since I'm using a Coppermine-based Celeron.

qyot27
January 21st, 2011, 07:23 AM
Speaking of FFmpeg's recent change to git, how do you get git to show the last X commits to a given repo without having it stored locally? Basically an analogue to svn log -l X url, where X is an actual number. I don't even care if it requires multiple commands, just as long as it doesn't require actually downloading the source code. A multi-command way of doing it can be shell scripted if need be.

ron999
January 21st, 2011, 02:18 PM
...when I git-ized the guide...

Hi
I see that you've updated to git for ffmpeg source when compiling for Maverick.
Should we also use git instead of svn for Karmic and the other Ubuntus?

qyot27
January 21st, 2011, 08:33 PM
Hi
I see that you've updated to git for ffmpeg source when compiling for Maverick.
Should we also use git instead of svn for Karmic and the other Ubuntus?
You have to. The guide wasn't changed on a whim, it changed because FFmpeg has moved completely to git (as per http://ffmpeg.org/download.html). The SVN repo is still up, but is frozen at r26402. If the note given is any indication, it stands a chance of eventually being taken down entirely, so using SVN would cease to work for anybody. Distro version or choice has nothing to do with it.

FakeOutdoorsman
January 21st, 2011, 08:37 PM
Speaking of FFmpeg's recent change to git, how do you get git to show the last X commits to a given repo without having it stored locally? Basically an analogue to svn log -l X url, where X is an actual number. I don't even care if it requires multiple commands, just as long as it doesn't require actually downloading the source code. A multi-command way of doing it can be shell scripted if need be.

Doesn't seem to be possible according to spaam in #ffmpeg.


Hi
I see that you've updated to git for ffmpeg source when compiling for Maverick.
Should we also use git instead of svn for Karmic and the other Ubuntus?

SVN will still work for now, but the repository is supposedly not updated anymore and may be removed "in a near future". I'll update the other guides in a few days. I haven't totally been keeping up with recent developments in FFmpeg and right now I'm not sure what's going on between the two git repositories (git://git.videolan.org/ffmpeg.git and git://git.ffmpeg.org/ffmpeg.git).

andrew.46
January 23rd, 2011, 10:12 AM
I haven't totally been keeping up with recent developments in FFmpeg and right now I'm not sure what's going on between the two git repositories (git://git.videolan.org/ffmpeg.git and git://git.ffmpeg.org/ffmpeg.git).

Looks like a leadership spill, hopefully everything will settle down. Some of the gory details on FFmpeg-devel....

tarasu
January 27th, 2011, 03:06 AM
I have problem while installing ffmpeg on Linux Mint 10 Julia i686

uname -a
Linux some1-pc 2.6.37-0.dmz.5-liquorix-686 #1 ZEN SMP PREEMPT Sun Jan 23 03:53:56 UTC 2011 i686 GNU/Linux
ppa's:

ppa:tiheum/equinox
ppa:am-monkeyd/nautilus-elementary-ppa
ppa:alexey-smirnov/deadbeef
ppa:synapse-core/ppa
logs:
./configure: http://pastebin.com/Pa2JEwpf
make: http://pastebin.com/ByUCwL5g

p.s.: never had problems with ffmpeg on mint before

FakeOutdoorsman
January 27th, 2011, 03:35 AM
I can confirm this on Ubuntu 10.10 x86_64. It appears that the following commit is to blame: Add ff_ prefix to data symbols of encoders, decoders, hwaccel, parsers, bsf (http://git.ffmpeg.org/?p=ffmpeg.git;a=commit;h=d36beb3f6902b1217beda576a a18abf7eb72b03c).

You can wait for this to be fixed by FFmpeg, or you can compile without VAAPI support by either adding --disable-vaapi to the FFmpeg ./configure, or by removing libva-dev. After choosing one of those methods be sure to make distclean in ~/ffmpeg before running make.

There might be a better method to resolve this.

Update: I pinged (pung?) the devs. This should be fixed soon, so you can just wait a day or less and then:

cd ~/ffmpeg
make distclean
git pull
Then continue with the ffmpeg ./configure line.

mc4man
January 27th, 2011, 04:40 AM
Will be interested on how it's fixed, built here w/ vaapi by removing the ff_## from the define, though clearly it was added for a reason.(I guess

(though again here don't see much value to vaapi anyway in ffmpeg

FakeOutdoorsman
January 27th, 2011, 05:22 AM
Will be interested on how it's fixed

With these probably:
[FFmpeg-devel] [PATCH] Add missing ff_ prefix to vaapi_hwaccel objects (http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2011-January/104530.html)

[FFmpeg-devel] [PATCH] Add ff_ to AVHWAccel decoders (http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2011-January/104531.html)

mc4man
January 27th, 2011, 05:47 AM
That makes sense - next time I'll think to look deeper rather than just at the offending item and source file.
As a side note = on natty there still is an issue with static linking w/ gcc-4.5.X, it's actually not just x264, had a static vorbis build that showed the same behavior, was fine w/ gcc-4.4

Amefurashi
January 27th, 2011, 06:56 PM
CUT

Thanks, it worked like a charm!
Quick question: generating the executable is fine (I copied it into usr/local/bin), but is it possible to obtain a .deb package too? I need it for some friends...

Regards,
Ame

qyot27
January 28th, 2011, 05:40 AM
Thanks, it worked like a charm!
Quick question: generating the executable is fine (I copied it into usr/local/bin), but is it possible to obtain a .deb package too? I need it for some friends...

Regards,
Ame
If you want a .deb package, just use the checkinstall step from the official guide rather than the regular 'make install' one. I'm not sure if checkinstall still makes the packages install to /usr/local when they have a custom prefix used on them during the configure process, though. You'd have to test that.

As a general note, you can run the x264 executable from absolutely any directory if you use ./ in front of it. This is because Linux (and probably most other *nixen) denies execution rights to executables not located in directories specified on the system's $PATH. Using ./ overrides that restriction on a run-by-run basis. Same goes for executable shell scripts, thus why ./configure is ./configure, and not just a plain configure.

So basically, if the way you normally use x264 looks like:
x264 --preset ultrafast --tune zerolatency -o output.mp4 input.y4m

but you're in /home/user/x264_build/bin, meaning that it won't run if you try to use the above, then the override command would look like:
./x264 --preset ultrafast --tune zerolatency -o output.mp4 input.y4m

The alternate method would be to add any custom install locations to the $PATH, but that's cumbersome and apt to change with whatever you name the directories, making for extra hassle.

mocha
January 28th, 2011, 08:29 AM
I just did a fresh pull of x264 and ffmpeg and compiled x264 with lavf and ffms2 support. So what advantage exactly is this giving me?

I use ffmpeg on a regular basis to encode "any" to libx264 and MPEG2. The ffms2 documentation seems to elude that it's only useful when encoding files directly via the x264 binary and not using ffmpeg? Any clarification on this in plain english would be appreciated. Thanks.

FakeOutdoorsman
January 28th, 2011, 08:42 AM
I've only tried lavf support in x264 myself. It allows you use any video file input that FFmpeg can support instead of using a named pipe or some other method of input to x264. One advantage is that you gain access to some of the features that are lacking if you use FFmpeg to encode with x264, such as --tune (see x264 --fullhelp).

andrew.46
January 28th, 2011, 10:25 AM
Since there is some talk of x264 as a standalone encoder I was going to suggest that it might be helpful to add the gpac dev libraries to this guide? This of course would allow direct encoding by the cli x264 encoder into an mp4 container. Mind you I struggled a little on my current system as Gpac has moved home (http://gpac.wp.institut-telecom.fr/) and deleted its old tarball, the currently required svn version reports itself as:


andrew@skamandros~$ mp4box -version | head -n 1
MP4Box - GPAC version 0.4.6-DEV (internal rev. 8)

but is picked up with no problems by x264. The old tarball (0.4.5) did not compile with gcc 4.5.2 :(.

Andrew

Henrikx
January 28th, 2011, 10:50 AM
Why?


MP4Box -version | head -n 1MP4Box - GPAC version 0.4.5 (build 33) (Ubuntu)


x264 --help
x264 core:112 Ubuntu_2:0.112.1867-1ubuntu1
Syntax: x264 [options] -o outfile infile

Infile can be raw (in which case resolution is required),
or YUV4MPEG (*.y4m),
or Avisynth if compiled with support (no).
or libav* formats if compiled with lavf support (yes) or ffms support (no).
Outfile type is selected by filename:
.264 -> Raw bytestream
.mkv -> Matroska
.flv -> Flash Video
.mp4 -> MP4 if compiled with GPAC support (yes)
Output bit depth: 8 (configured at compile time)

andrew.46
January 28th, 2011, 12:27 PM
Hi Henrikx,


Why?

Well, as it stands FO's guide does not actually include the gpac -dev file required to allow x264 to use an mp4 container, hence my suggestion. My disjointed ramblings about the svn gpac were more to do with my inability, on another distro, to successfully compile gpac 0.4.5 :).

Andrew

qyot27
January 28th, 2011, 01:23 PM
I just did a fresh pull of x264 and ffmpeg and compiled x264 with lavf and ffms2 support. So what advantage exactly is this giving me?

I use ffmpeg on a regular basis to encode "any" to libx264 and MPEG2. The ffms2 documentation seems to elude that it's only useful when encoding files directly via the x264 binary and not using ffmpeg? Any clarification on this in plain english would be appreciated. Thanks.
Correct. FFMS2 (FFmpegSource2) does nothing in FFmpeg itself.

It helps to understand FFMS2's original purpose to distinguish it from either x264's LAVF support or main FFmpeg, and that is that FFMS2 is primarily an AviSynth source plugin - it's meant to provide AviSynth with a method of frame accurate decoding of virtually any video file that FFmpeg supports. It later grew into a cross-platform library which performs essentially the same function for the programs linked against it (such as x264 and Aegisub). LAVF is x264 linking directly against FFmpeg's libraries to open and decode video files, but without the assurance it'll necessarily be frame accurate.

qyot27
January 28th, 2011, 01:49 PM
Hi Henrikx,



Well, as it stands FO's guide does not actually include the gpac -dev file required to allow x264 to use an mp4 container, hence my suggestion. My disjointed ramblings about the svn gpac were more to do with my inability, on another distro, to successfully compile gpac 0.4.5 :).

Andrew
The last GPAC discussion I can remember:
http://ubuntuforums.org/showpost.php?p=6841491&postcount=330

There was a trick to compiling 0.4.5 that involved copying config.h to include/gpac/internal after configure had been run and then going on with the compile. Supposedly the SVN dev branch makes it much simpler than the terror to build that GPAC has historically been, but I'd still recommend going with L-SMASH for MP4 output support. Especially as there was some nasty mux breakage between non-current SVN GPAC versions and x264 back last October. I honestly have no idea if it is completely resolved now (on GPAC's side; old versions are problematic on this, period - it had to do with the atoms that were being written screwing up because x264 properly implemented a feature on the bitstream level and the older builds of GPAC couldn't handle it correctly; it'd mux, but the resulting files were unplayable or went out of sync or had other types of issues) or if there's lingering issues with even a current SVN version of GPAC. No such problems have been reported with L-SMASH, though, or at least not that I can recall.

It's available either as a patch (which periodically needs updating because x264's development outpaces it at times), or as a standalone git branch which also needs periodic updating, but since it is an actual x264 branch, there's no need to worry about it failing to patch.

http://vfrmaniac.fushizen.eu/OtherStuff/L-SMASH/ (patch)
https://github.com/silverfilain/x264_L-SMASH (branch)

Both the patch and branch contain the audio encoding features of the x264-audio (https://github.com/Kovensky/x264-audio) branch.

mocha
January 28th, 2011, 03:06 PM
Thanks for all the clarification. I'll have to give it a try now that I went through all that trouble to get it compiled. There are some great usage examples here (http://www.x264bluray.com/home) if anyone is interested.

andrew.46
January 28th, 2011, 09:57 PM
Thanks for that qyot27, I will admit that I had not heard of L-SMASH before. Nice if this work was integrated into x264 so there could be native output to mp4.

qyot27
January 29th, 2011, 12:28 PM
Thanks for that qyot27, I will admit that I had not heard of L-SMASH before. Nice if this work was integrated into x264 so there could be native output to mp4.
From what I gather, L-SMASH originated as a GSoC project in 2010. It's intended to adhere very strictly to the MP4 specifications, and thereby cut out a lot of the cruft that GPAC has built up over the years. The dev website seems to imply that consideration of L-SMASH being officially accepted into x264 hinges on whenever the audio encoding features are committed.

It's also a fraction of a fraction of GPAC's size, and already has most or all of the same x264-relevant functionality (L-SMASH source code: less than 1MB as cloned from the muxer-only git repo, GPAC source code: I'm not entirely sure, but I prematurely stopped the SVN checkout at around 44MBs) and has the necessary qt-faststart reordering already built in.

ron999
February 1st, 2011, 10:13 PM
@ hi FakeOutdoorsman
If I re-build ffmpeg with Karmic from the GIT.
Should I change the first command
from this:-

svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
into this:-

git clone git://git.ffmpeg.org/ffmpeg.git

Is that correct?

And in the last line, what should I use instead of --pkgversion "4:0.5+svn`date +%Y%m%d`"?
;)

jjheap
February 1st, 2011, 10:39 PM
Installing ffmpeg, the guide(s) are fantastic, but...

I have found that the checkinstall step (see below) for 10.04 does not hold quite true for 10.04.1 ??? It seems to work if the appropraiet step is used from the 10.10 guide, perhaps somebody with a better understanding then mine could publish the exact correct steps?


7. Get the most current source files, compile, and install. Run "./configure --help" to see what other features you can enable/disable. Nightly FFmpeg snapshots (http://ffmpeg.mplayerhq.hu/releases/ffmpeg-checkout-snapshot.tar.bz2) are also available.
[CODE]
cd
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc \
--enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb \
--enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid \
--enable-x11grab
make
sudo checkinstall --pkgname=ffmpeg --pkgversion "4:SVN-r`LANG=C svn info | \
grep Revision | awk '{ print $NF }'`" --backup=no --default --deldoc=yes
hash x264 ffmpeg ffplay

FakeOutdoorsman
February 1st, 2011, 11:27 PM
@ hi FakeOutdoorsman
If I re-build ffmpeg with Karmic from the GIT.
Should I change the first command
from this:-

svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
into this:-

git clone git://git.ffmpeg.org/ffmpeg.git

Is that correct?
Yes, that is correct, but I would first remove the old ~/ffmpeg directory before running the git command. I've been waiting for things to settle down on the FFmpeg end, but I'll update the older guides on Monday.


And in the last line, what should I use instead of --pkgversion "4:0.5+svn`date +%Y%m%d`"?
This should do it:

sudo checkinstall --pkgname=ffmpeg --pkgversion="5:$(./version.sh)" --backup=no \
--deldoc=yes --default


I have found that the checkinstall step (see below) for 10.04 does not hold quite true for 10.04.1 ???
Is checkinstall giving you any errors?

ron999
February 1st, 2011, 11:50 PM
Thanks.:guitar:

ron999
February 2nd, 2011, 02:31 AM
Hi
ffmpeg has compiled OK.
But when installed it said:- bash: hash: ffplay: not found
And when I enter ffplay :-

The program 'ffplay' is currently not installed. You can install it by typing:
sudo apt-get install ffmpeg
ffplay: command not found
When I look in usr/local/bin I can see ffmpeg ffprobe and ffserver - but no ffplay.
So maybe ffplay isn't included in the package any more.:confused:


ron@ubuntu:~$ ffmpeg
FFmpeg version git-ea7f080, Copyright (c) 2000-2011 the FFmpeg developers
built on Feb 2 2011 01:14:24 with gcc 4.4.1
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --disable-encoder=vorbis
libavutil 50. 36. 0 / 50. 36. 0
libavcore 0. 16. 1 / 0. 16. 1
libavcodec 52.108. 0 / 52.108. 0
libavformat 52. 94. 0 / 52. 94. 0
libavdevice 52. 2. 3 / 52. 2. 3
libavfilter 1. 74. 0 / 1. 74. 0
libswscale 0. 12. 0 / 0. 12. 0
libpostproc 51. 2. 0 / 51. 2. 0

FakeOutdoorsman
February 2nd, 2011, 04:10 AM
Does it work after you enter hash -r?

ron999
February 2nd, 2011, 04:19 AM
I don't understand hash -r.
Do you mean I should use hash -r in my last command:-

sudo checkinstall --pkgname=ffmpeg --pkgversion="5:$(./version.sh)" --backup=no --deldoc=yes --default && hash x264 ffmpeg ffplay

FakeOutdoorsman
February 2nd, 2011, 04:36 AM
If, in the same session, you use the repository FFmpeg and then remove it, compile, and then attempt to use your compiled version you can get a "ffplay: command not found" message. The hash -r command purges remembered locations.

What I meant was to simpy run the hash command and then try running ffplay, but since you already mentioned that you don't see the binary anywhere then I suspect it isn't actually installed.

I just tested Karmic and ffplay installed fine:

$ dpkg -L ffmpeg | grep ffplay
/usr/share/doc/ffmpeg/doc/ffplay.html
/usr/share/doc/ffmpeg/doc/ffplay.pod.d
/usr/share/doc/ffmpeg/doc/ffplay.html.d
/usr/share/doc/ffmpeg/doc/ffplay.1
/usr/share/doc/ffmpeg/doc/ffplay.texi
/usr/share/doc/ffmpeg/doc/ffplay.pod
/usr/local/share/man/man1/ffplay.1.gz
/usr/local/bin/ffplay

Maybe you were missing libsdl1.2-dev before compiling? It's a required dependency for ffplay, but you won't get a message if it's missing. FFplay will simply not be built.

ron999
February 2nd, 2011, 04:44 AM
You're spot on!
libsdl1.2-dev isn't installed.

I don't know how that's happened.
Maybe I uninstalled it with some other stuff since I last compiled.
I don't use ffplay very often, so it could have been missing for a while.

For now, I can live without ffplay, till next time.
Thanks.

FakeOutdoorsman
February 2nd, 2011, 04:54 AM
Glad you found the culprit. Running Step 2 after uninstalling and before compiling x264 and FFmpeg is probably a good idea to make sure everything you need is still there and up to date.

Edit: I updated the Karmic guide.

Daerun
February 5th, 2011, 11:50 AM
Hello, I've found an issue that I think is not been discussed here, or at least couldn't find it searching backwards in this thread.

I'm trying to install ffmpeg with this tutorial, but first I installed libvpx. Downloaded it from here

http://code.google.com/p/webm/downloads/list

That's version 0.9.5. Then did the process


./configure
make
sudo checkinstall --pkgname=libvpx --pkgversion="`date +%Y%m%d%H%M`-git" --backup=no --default --deldoc=yesSo, when installing ffmpeg I was told to use this code:


./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --enable-libvpx --enable-libmp3lameAnd it returned this message:


ERROR: libvpx decoder version must be >=0.9.1

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.log" produced by configure as this will help
solving the problem.

So, what should I do now, please?

FakeOutdoorsman
February 5th, 2011, 07:13 PM
What Ubuntu version are you using?

Daerun
February 5th, 2011, 10:13 PM
Sorry, I'm using Lucid.

FakeOutdoorsman
February 5th, 2011, 10:35 PM
I tried this on Lucid and FFmepg found libvpx with no problem. However, I used git instead of svn for FFmpeg. I just updated the Lucid guide with new instructions for FFmpeg.

Can you double-check to make sure that libvpx even got installed?

I recommend doing this:

rm -rf ~/ffmpeg
...and then continuing on step 7.

Daerun
February 6th, 2011, 01:50 AM
Alright, the problem was libvpx not properly installed for some reason. Repeated using git and everything work, although I saw errors showing during the process, like:


libavcodec/h264_direct.c:263: warning: assignment from incompatible pointer type
libavcodec/h264_direct.c:264: warning: assignment from incompatible pointer type


libavcodec/imgconvert.c:715: warning: passing argument 3 of ‘av_image_copy’ from incompatible pointer type
./libavcore/imgutils.h:112: note: expected ‘const uint8_t **’ but argument is of type ‘uint8_t **’
libavcodec/imgconvert.c: In function ‘av_picture_copy’:



libavcodec/ivi_dsp.c:41: warning: ‘b3_5’ may be used uninitialized in this function
libavcodec/ivi_dsp.c:41: warning: ‘b3_6’ may be used uninitialized in this function

What is the meaning of this?

qyot27
February 6th, 2011, 02:06 AM
Alright, the problem was libvpx not properly installed for some reason. Repeated using git and everything work, although I saw errors showing during the process, like:


libavcodec/h264_direct.c:263: warning: assignment from incompatible pointer type
libavcodec/h264_direct.c:264: warning: assignment from incompatible pointer type


libavcodec/imgconvert.c:715: warning: passing argument 3 of ‘av_image_copy’ from incompatible pointer type
./libavcore/imgutils.h:112: note: expected ‘const uint8_t **’ but argument is of type ‘uint8_t **’
libavcodec/imgconvert.c: In function ‘av_picture_copy’:



libavcodec/ivi_dsp.c:41: warning: ‘b3_5’ may be used uninitialized in this function
libavcodec/ivi_dsp.c:41: warning: ‘b3_6’ may be used uninitialized in this function

What is the meaning of this?
Those aren't really 'errors'. If they were errors, compiling would fail and you would see something like this at the end:

collect2: ld returned 1 exit status
make[1]: *** [directory] Error 1
make[1]: Leaving directory `directory'
make: *** [all] Error 2
(with [directory] and `directory' meaning actual directory paths)



The warnings could be related to the version of GCC used to compile the build, or simply things that the ffmpeg devs either haven't tweaked or that they don't prioritize. I think it was the ffmpeg mailing list where I saw a comment to the effect that making the GCC output absolutely free from inconsequential warnings was not important, thus any cleaning up that happens probably is done at the behest of making sure it doesn't break anything else, or because it's part of a bigger fix/optimization that needed to be done anyway. The warnings being rooted in the version of GCC would be a good reason for this to be unimportant - they'd spend more time focusing on fixing GCC version inconsistencies than they would actual productive development. As long as it's not a case of breakage, it may eventually resolve itself on GCC's end.

undercash
February 7th, 2011, 02:15 AM
hello,
I m trying to compile ffmpeg on 10.0.4 (x86) for the first time. I have this error message, google didn't really help



ffmpeg: relocation error: /usr/local/lib/libavfilter.so.1: symbol sws_isSupportedInput, version LIBSWSCALE_0 not defined in file libswscale.so.0 with link time reference

I found this http://wieshka.pastebin.com/2u1XFx6B but it didn't solve this issue.

at first it worked via command line, then I checked if my script could use ffmpeg and I had the typical ffmpeg error:


error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory

which I fixed inserting /usr/local/lib in ld.config.conf

any ideas?

undercash
February 7th, 2011, 05:14 PM
hmm I think I found the cause of the problem.

I am using the option --enable-shared in the ffmpeg configuration line because I want to install ffmpeg-php.

How to make this works on ubuntu 10.0.4, since this always worked fine for me on hardy

FakeOutdoorsman
February 7th, 2011, 07:40 PM
I just did a test compile on 10.04 and it worked. Note that first I deleted the old ~/ffmpeg directory because it was using SVN and FFmpeg has moved to Git.

If you --enable-shared on FFmpeg, then you should do the same for the external libraries. Add it to x264 and libvpx. For LAME just remove --disable-shared.

Then after you install everything you should run "sudo ldconfig". If you don't run that command you'll receive something like the following:

$ ffmpeg
ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory

undercash
February 7th, 2011, 07:42 PM
thanks for the feedback, again. I am gonna test with -enable-shared for x264 now

Amefurashi
February 7th, 2011, 08:44 PM
// Whoa, my bad. Forget it //


Also, as a sidenote... is there a quick way to compile x264 with L-SMASH mp4 output? :oops:

As always, thanks!

Regards,

Ame




Edit: I just recalled that the "checkinstall" step for creating a deb. package doesn't work... it creates a dummy package (16kb in size).

undercash
February 7th, 2011, 10:57 PM
well no luck for me after recompiling with libx264 --enable-shared

output in terminal is:


FFmpeg version git-48545a8, Copyright (c) 2000-2011 the FFmpeg developers
built on Feb 7 2011 23:39:29 with gcc 4.4.3
configuration: --enable-gpl --enable-pthreads --enable-libvorbis --enable-version3 --enable-nonfree --enable-postproc --enable-pthreads --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libx264 --enable-libxvid --enable-x11grab --disable-debug --enable-shared
libavutil 50. 37. 0 / 50. 37. 0
libavcore 0. 16. 1 / 0. 16. 1
libavcodec 52.109. 0 / 52.109. 0
libavformat 52. 97. 0 / 52. 97. 0
libavdevice 52. 2. 3 / 52. 2. 3
libavfilter 1. 74. 0 / 1. 74. 0
libswscale 0. 12. 0 / 0. 12. 0
libpostproc 51. 2. 0 / 51. 2. 0
Hyper fast Audio and Video encoder



output using php is:

http://pokercast.dyndns.org/ffmpeg.php

andrew.46
February 8th, 2011, 10:21 AM
Also, as a sidenote... is there a quick way to compile x264 with L-SMASH mp4 output?

I have just been looking at this courtesy of qyot's recent post and I settled on patching, and quite a large patch it is. Change to the directory containing your x264 source and run the following:



$ wget http://vfrmaniac.fushizen.eu/OtherStuff/L-SMASH/x264_lsmash.diff
$ patch -p1 < x264_lsmash.diff
$ ./configure --enable-nonfree


and then run the usual make and checkinstall commands from Fakeoutdoorsman's guide. Nice having the audio track encoded as well with the patched x264 :)

FakeOutdoorsman
February 9th, 2011, 03:23 AM
The x264 checkinstall pkgversion is mental. I want a simpler, cleaner way of getting the same output. We get signal:

$ ./version.sh
#define X264_VERSION " r1900 60ef1f8"
#define X264_POINTVER "0.114.1900 60ef1f8"
I want 0.114.1900+git60ef1f8. Unfortunately, my text wrangling skills are lacking. I can get this with:

$ ./version.sh | awk '/POINT/{print $3,$4}' | sed 's/"//g;s/ /+git/'
0.114.1900+git60ef1f8
It's less verbose, but I know it can be more efficient. Any suggestions?

qyot27
February 9th, 2011, 03:41 AM
I have just been looking at this courtesy of qyot's recent post and I settled on patching, and quite a large patch it is. Change to the directory containing your x264 source and run the following:



$ wget http://vfrmaniac.fushizen.eu/OtherStuff/L-SMASH/x264_lsmash.diff
$ patch -p1 < x264_lsmash.diff
$ ./configure --enable-nonfree


and then run the usual make and checkinstall commands from Fakeoutdoorsman's guide. Nice having the audio track encoded as well with the patched x264 :)
As a sidenote, when doing compiles for Windows, the audio support allows using Quicktime to act as the AAC encoder*, so long as the SDK is given to x264 at ./configure. The downside to that is needing to sign up for a free ADC account and download the SDK yourself, though. For cross-compiles it's also a bit trickier because some case-sensitivity comes into play with the filenames, but under a native Windows environment that isn't a problem.

*Although it only works if one has Quicktime installed. It doesn't even have to be Quicktime Pro; the standard version that ships with iTunes is enough. And IMO iTunes is ubiquitous enough now that that shouldn't be a concern.

Personally I think the advantage of being able to use the Quicktime encoder far outweighs the extra work needed to get the necessary libs/includes. That advantage being, Quicktime's has historically been one of the best AAC encoders, whether that's first place, tied for first with Nero, or a very close second behind Nero. You would think that this functionality would also be possible on OSX builds, but apparently not (although I've not tried compiling x264 on OSX for almost a year, well before the L-SMASH and audio support stuff was being tossed around publicly; it very well could have been added by now).

andrew.46
February 9th, 2011, 10:46 AM
$ ./version.sh | awk '/POINTVER/ { print $3,$4 }' | sed 's/"//g' | sed 's/ /+git/'
0.114.1900+git60ef1f8

Hmmmm..... this is not much of an improvement I guess:


$ ./version.sh | grep 'POINT' | cut -d '"' -f 2 | sed 's/ /+git/'
0.114.189+git60ef1f8

Big advantage for me is that I don't understand awk :)

claracc
February 11th, 2011, 07:54 AM
Hello, great guide for ffmpeg, congratulations.

I have compiled and installed ffmpeg and x264 in my hp compaq 6720 s laptop dual boot vista/lucid lynx as it is recommended in this guide.

I try to pass this audio file from bbc (real player coded) http://www.bbc.co.uk/worldservice/learningenglish/multimedia/btp/ram_files/winchester_audio1.ram to wav. I download the file and then try the command : ffmpeg -i winchester_audio1.ram winchester_audio1.wav
as I was adviced by JC Cheloven in this thread: http://ubuntuforums.org/showthread.php?t=1678278 but I obtain the following error:

ffmpeg -i winchester_audio1.ram winchester_audio1.wav
FFmpeg version git-b466827, Copyright (c) 2000-2011 the FFmpeg developers
built on Feb 10 2011 16:29:10 with gcc 4.4.3
configuration: --enable-libmp3lame --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab
libavutil 50. 37. 0 / 50. 37. 0
libavcore 0. 16. 1 / 0. 16. 1
libavcodec 52.112. 0 / 52.112. 0
libavformat 52. 98. 0 / 52. 98. 0
libavdevice 52. 2. 3 / 52. 2. 3
libavfilter 1. 75. 0 / 1. 75. 0
libswscale 0. 12. 0 / 0. 12. 0
libpostproc 51. 2. 0 / 51. 2. 0
winchester_audio1.ram: Invalid data found when processing input

What can be the problem?, Have I missed some codec?

Thanks in advance

ron999
February 11th, 2011, 08:09 AM
Hi claracc
ffmpeg can't convert the link as it is.
Right-click on that link http://www.bbc.co.uk/worldservice/learningenglish/multimedia/btp/ram_files/winchester_audio1.ram

And 'Save link as...'.
You'll get a file named winchester_audio1.ram in your home folder.

Open that file with gedit text editor or similar.
You'll see that it says:-
rtsp://rmv8.bbc.net.uk/worldservice/learningenglish/beyondthepostcard/winchester1.ra?BBC-UID=144d2571dee4faed59a5a50dd10e5c0aa1f1b2cb709051 9424bff4f638d05eda&SSO2-UID=

You only need the part up till the question mark (?).
Which is
rtsp://rmv8.bbc.net.uk/worldservice/learningenglish/beyondthepostcard/winchester1.ra

Now you can use that with ffmpeg.
Like this:-

ffmpeg -i rtsp://rmv8.bbc.net.uk/worldservice/learningenglish/beyondthepostcard/winchester1.ra winchester_audio1.wav