ffmpeg compilation on ubuntu - another thread

Support and queries relating to all previous versions of ZoneMinder
Locked
kevin_robson
Posts: 247
Joined: Sun Jan 16, 2005 11:26 am

ffmpeg compilation on ubuntu - another thread

Post by kevin_robson »

I'm still having trouble compiling ffmpeg on ubuntu, as it looks like others are too.

I've been following the recent ubuntu install guide but getting stuck at the ffmpeg bit. This seems to be a common problem across all platforms at the moment. I can build zm using the packaged ffmpeg on suse 10.3, but it wont generate videos.

Anyway, can anyone get ffmpeg compiled on the current 7.10 ubuntu.
If I use the current ffmpeg svn, I get:

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg
. ./configure --enable-shared --enable-postproc --enable-swscale --enable-gpl --prefix=/opt/

Checked out external at revision 26334.

Checked out revision 12758.

/tmp/ffmpeg/current/ffmpeg# . ./configure --enable-shared --enable-postproc --enable-swscale --enable-gpl --prefix=/opt/ | more
sed: can't read /bin/libavcodec/allcodecs.c: No such file or directory
sed: can't read /bin/libavcodec/allcodecs.c: No such file or directory
sed: can't read /bin/libavcodec/allcodecs.c: No such file or directory
sed: can't read /bin/libavcodec/allcodecs.c: No such file or directory
sed: can't read /bin/libavformat/allformats.c: No such file or directory
sed: can't read /bin/libavformat/allformats.c: No such file or directory
sed: can't read /bin/libavdevice/alldevices.c: No such file or directory
sed: can't read /bin/libavdevice/alldevices.c: No such file or directory
sed: can't read /bin/libavformat/allformats.c: No such file or directory
sed: can't read /bin/libavfilter/allfilters.c: No such file or directory

I cannot do a make after this.

If I try to use an older version:

svn checkout -r 11637 svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg
Checked out external at revision 26334.

Checked out revision 11637.
cd ffmpeg
./configure --enable-shared --enable-pp --enable-swscaler --enable-gpl --prefix=/opt/
make
make causes lots of errors - the last of which is below. See the main install guide thread for the full error as posted by somebody else.

rgb2rgb_template.c:1309: error: memory input 2 is not directly addressable
rgb2rgb_template.c:1309: error: memory input 3 is not directly addressable
rgb2rgb_template.c:1309: error: memory input 4 is not directly addressable
rgb2rgb_template.c: In function ‘rgb32tobgr32_3DNOW’:
rgb2rgb_template.c:1419: error: ‘mask32b’ undeclared (first use in this function)
rgb2rgb_template.c:1419: error: ‘mask32r’ undeclared (first use in this function)
rgb2rgb_template.c:1419: error: ‘mmx_one’ undeclared (first use in this function)
rgb2rgb_template.c:1371: error: memory input 3 is not directly addressable
rgb2rgb_template.c:1371: error: memory input 4 is not directly addressable
rgb2rgb_template.c:1371: error: memory input 5 is not directly addressable
make[1]: *** [rgb2rgb.o] Error 1
make[1]: Leaving directory `/tmp/ffmpeg/old/ffmpeg/libswscale'
make: *** [lib] Error 2

Could somebody who has got it to work themselves please have another go with the current release of ffmpeg and document the steps involved? Obviously you dont have to do a make install - just get the thing compiled.

As I said this doesn't just seem to be affecting me - it seems others are getting the same problem.

Before anyone suggests I really dont want to use the .deb package. I've installed from source on other platforms and much prefer the control it gives me.

Thanks
User avatar
Lee Sharp
Posts: 1069
Joined: Sat Mar 31, 2007 9:18 pm
Location: Houston, TX

Re: ffmpeg compilation on ubuntu - another thread

Post by Lee Sharp »

kevin_robson wrote:Before anyone suggests I really dont want to use the .deb package. I've installed from source on other platforms and much prefer the control it gives me.
Sorry, but as far as I know that is the only way people have it working. The ZM deb is compiled against it anyway, so unless you are compiling both you will have issues with them working together.
kevin_robson
Posts: 247
Joined: Sun Jan 16, 2005 11:26 am

Post by kevin_robson »

Sorry, I meant build from source for both ffmpeg and zm
kevin_robson
Posts: 247
Joined: Sun Jan 16, 2005 11:26 am

Post by kevin_robson »

For additonal info I have tried compiling ffmpeg on suse. The current version works OK but the the older version fails with the same error.

As the lastest version works on suse 10.3 perhaps I this means I am missing some dependency in ubuntu for the newer version? Any ideas?
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

When you are building ffmpeg from SVN you must consider that it is the in-development version. Some times it is broken as something uploaded to svn was over looked and could take a few days or more before someone corrects it. Unfortunately there is not much we as the ZM community can do about it, we use the ffmpeg project and develop on it and do not develop ffmpeg it self. It's not the first time and certainly not going to be the last time it happens. The only option when it does happen is to retrieve an older version from SVN that works.
kevin_robson
Posts: 247
Joined: Sun Jan 16, 2005 11:26 am

Post by kevin_robson »

Yes, I understand. I have tried 11637 which everyone seems to indicate success with, but myself and others dont seem to be able to compile it? The errors are in the first post.
W.
Posts: 108
Joined: Tue Apr 10, 2007 5:06 pm
Location: Latvia

Post by W. »

i just tried to compile ffmpeg from svn on my kubuntu 7.10 and everything worked like a charm. only difference i noticed was that libswscale was at revision 26340, ffmpeg itself was at 12758. of course it gave me the usual bunch of warnings while compiling, but other than that, nothing went wrong.
could it be you are missing some build prerequisites?
if common sense is so uncommon, why is it called common then?
kevin_robson
Posts: 247
Joined: Sun Jan 16, 2005 11:26 am

Post by kevin_robson »

Thanks. Thats what I'm thinking.
Anyone any ideas what? I installed all the ones at the top of the howto.

sed: can't read /bin/libavcodec/allcodecs.c: No such file or directory
sed: can't read /bin/libavcodec/allcodecs.c: No such file or directory
sed: can't read /bin/libavcodec/allcodecs.c: No such file or directory
sed: can't read /bin/libavcodec/allcodecs.c: No such file or directory
sed: can't read /bin/libavformat/allformats.c: No such file or directory
sed: can't read /bin/libavformat/allformats.c: No such file or directory
sed: can't read /bin/libavdevice/alldevices.c: No such file or directory
sed: can't read /bin/libavdevice/alldevices.c: No such file or directory
sed: can't read /bin/libavformat/allformats.c: No such file or directory
sed: can't read /bin/libavfilter/allfilters.c: No such file or directory
W.
Posts: 108
Joined: Tue Apr 10, 2007 5:06 pm
Location: Latvia

Post by W. »

first of all, i am on Kubuntu, which probably does not make any difference. the path in your error messages looks strange to me. no surprise it can not read source files from /bin/something :)
if common sense is so uncommon, why is it called common then?
kevin_robson
Posts: 247
Joined: Sun Jan 16, 2005 11:26 am

Post by kevin_robson »

Very strange. It seems to be trying to create stuff in /bin.
After I do the configure I end up with the following links:
lrwxrwxrwx 1 user users 13 2008-04-07 18:53 Makefile -> /bin/Makefile
lrwxrwxrwx 1 user users 15 2008-04-07 18:53 common.mak -> /bin/common.mak

Not clearly these should be in a bin subdirectory from my current location rather than from /

Anyone any ideas where it is picking up the /bin from?
Thanks
kevin_robson
Posts: 247
Joined: Sun Jan 16, 2005 11:26 am

Post by kevin_robson »

OK, I managed to get ffmpeg built from the latest version. It must have been dependency but not sure which one - I installed mythbuntu which also installed various multimedia stuff. Didn't work straight after, but after a reboot I tried once more and it worked fine:

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-shared --enable-postproc --enable-swscale --enable-gpl --prefix=/opt/

make
sudo make install

Its a bit like using a sledgehammer to crack a nut, but I was going to install anyway.
THanks for your help.
kevin_robson
Posts: 247
Joined: Sun Jan 16, 2005 11:26 am

Post by kevin_robson »

For info, zm compilation/build still moaned about this.

Managed to fix by setting --with-ffmpeg=/opt/include rather than /opt

Not sure if this will break other stuff later on but it gets zm built.
I will update on progress/lack of as I progress. Unfortunately I'm just managing an hour or so at a time on this.
Locked