Make / ffmpeg Issues

Support and queries relating to all previous versions of ZoneMinder
Locked
CLA12345
Posts: 3
Joined: Sat Aug 28, 2004 6:38 pm

Make / ffmpeg Issues

Post by CLA12345 »

Greetings,

I've somehow managed to get ZoneMinder (Very cool program, Phil!) v1.19.4 running on Fedora Core 2 (v2.6.8-1.521 kernel). This was a small miracle, considering what a newbie I am to Linux/MySQL/Apache/ZoneMinder, etc. :shock:

I did not include mpeg support initially, but was able to stream JPEGs with Cambozola. Now I'm trying to get streaming mpegs to work. I've installed FFmpeg (cvs-2004-07-12). But when I try to Make (gcc v3.3.3) ZoneMinder with mpeg support, I get the following errors. Not being a C++ guru, I'm at a loss what to try next.

Any help would be greatly appreciated! Thanks!


make all-recursive
make[1]: Entering directory `/usr/src/zoneminder/zm-1.19.4'
Making all in src
make[2]: Entering directory `/usr/src/zoneminder/zm-1.19.4/src'
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/include -g -O2 -MT zmc.o -MD -MP -MF ".deps/zmc.Tpo" \
-c -o zmc.o `test -f 'zmc.cpp' || echo './'`zmc.cpp; \
then mv ".deps/zmc.Tpo" ".deps/zmc.Po"; \
else rm -f ".deps/zmc.Tpo"; exit 1; \
fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/include -g -O2 -MT zm.o -MD -MP -MF ".deps/zm.Tpo" \
-c -o zm.o `test -f 'zm.cpp' || echo './'`zm.cpp; \
then mv ".deps/zm.Tpo" ".deps/zm.Po"; \
else rm -f ".deps/zm.Tpo"; exit 1; \
fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/include -g -O2 -MT zm_db.o -MD -MP -MF ".deps/zm_db.Tpo" \
-c -o zm_db.o `test -f 'zm_db.cpp' || echo './'`zm_db.cpp; \
then mv ".deps/zm_db.Tpo" ".deps/zm_db.Po"; \
else rm -f ".deps/zm_db.Tpo"; exit 1; \
fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/include -g -O2 -MT zm_config.o -MD -MP -MF ".deps/zm_config.Tpo" \
-c -o zm_config.o `test -f 'zm_config.cpp' || echo './'`zm_config.cpp; \
then mv ".deps/zm_config.Tpo" ".deps/zm_config.Po"; \
else rm -f ".deps/zm_config.Tpo"; exit 1; \
fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/include -g -O2 -MT zm_coord.o -MD -MP -MF ".deps/zm_coord.Tpo" \
-c -o zm_coord.o `test -f 'zm_coord.cpp' || echo './'`zm_coord.cpp; \
then mv ".deps/zm_coord.Tpo" ".deps/zm_coord.Po"; \
else rm -f ".deps/zm_coord.Tpo"; exit 1; \
fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/include -g -O2 -MT zm_box.o -MD -MP -MF ".deps/zm_box.Tpo" \
-c -o zm_box.o `test -f 'zm_box.cpp' || echo './'`zm_box.cpp; \
then mv ".deps/zm_box.Tpo" ".deps/zm_box.Po"; \
else rm -f ".deps/zm_box.Tpo"; exit 1; \
fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/include -g -O2 -MT zm_image.o -MD -MP -MF ".deps/zm_image.Tpo" \
-c -o zm_image.o `test -f 'zm_image.cpp' || echo './'`zm_image.cpp; \
then mv ".deps/zm_image.Tpo" ".deps/zm_image.Po"; \
else rm -f ".deps/zm_image.Tpo"; exit 1; \
fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/include -g -O2 -MT zm_event.o -MD -MP -MF ".deps/zm_event.Tpo" \
-c -o zm_event.o `test -f 'zm_event.cpp' || echo './'`zm_event.cpp; \
then mv ".deps/zm_event.Tpo" ".deps/zm_event.Po"; \
else rm -f ".deps/zm_event.Tpo"; exit 1; \
fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/include -g -O2 -MT zm_zone.o -MD -MP -MF ".deps/zm_zone.Tpo" \
-c -o zm_zone.o `test -f 'zm_zone.cpp' || echo './'`zm_zone.cpp; \
then mv ".deps/zm_zone.Tpo" ".deps/zm_zone.Po"; \
else rm -f ".deps/zm_zone.Tpo"; exit 1; \
fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/include -g -O2 -MT zm_camera.o -MD -MP -MF ".deps/zm_camera.Tpo" \
-c -o zm_camera.o `test -f 'zm_camera.cpp' || echo './'`zm_camera.cpp; \
then mv ".deps/zm_camera.Tpo" ".deps/zm_camera.Po"; \
else rm -f ".deps/zm_camera.Tpo"; exit 1; \
fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/include -g -O2 -MT zm_local_camera.o -MD -MP -MF ".deps/zm_local_camera.Tpo" \
-c -o zm_local_camera.o `test -f 'zm_local_camera.cpp' || echo './'`zm_local_camera.cpp; \
then mv ".deps/zm_local_camera.Tpo" ".deps/zm_local_camera.Po"; \
else rm -f ".deps/zm_local_camera.Tpo"; exit 1; \
fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/include -g -O2 -MT zm_remote_camera.o -MD -MP -MF ".deps/zm_remote_camera.Tpo" \
-c -o zm_remote_camera.o `test -f 'zm_remote_camera.cpp' || echo './'`zm_remote_camera.cpp; \
then mv ".deps/zm_remote_camera.Tpo" ".deps/zm_remote_camera.Po"; \
else rm -f ".deps/zm_remote_camera.Tpo"; exit 1; \
fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/include -g -O2 -MT zm_monitor.o -MD -MP -MF ".deps/zm_monitor.Tpo" \
-c -o zm_monitor.o `test -f 'zm_monitor.cpp' || echo './'`zm_monitor.cpp; \
then mv ".deps/zm_monitor.Tpo" ".deps/zm_monitor.Po"; \
else rm -f ".deps/zm_monitor.Tpo"; exit 1; \
fi
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/include -g -O2 -MT zm_mpeg.o -MD -MP -MF ".deps/zm_mpeg.Tpo" \
-c -o zm_mpeg.o `test -f 'zm_mpeg.cpp' || echo './'`zm_mpeg.cpp; \
then mv ".deps/zm_mpeg.Tpo" ".deps/zm_mpeg.Po"; \
else rm -f ".deps/zm_mpeg.Tpo"; exit 1; \
fi

zm_mpeg.cpp: In member function `double VideoStream::EncodeFrame(uint8_t*, int,
bool, unsigned int)':

zm_mpeg.cpp:257: error: 'struct AVFormatContext' has no member named 'pts_num'

zm_mpeg.cpp:257: error: 'struct AVFormatContext' has no member named 'pts_den'

zm_mpeg.cpp:287: error: invalid conversion from `int' to `AVPacket*'

/usr/local/include/ffmpeg/avformat.h:559: error: too many arguments to function
`int av_write_frame(AVFormatContext*, AVPacket*)'

zm_mpeg.cpp:287: error: at this point in file

zm_mpeg.cpp:301: error: invalid conversion from `int' to `AVPacket*'

/usr/local/include/ffmpeg/avformat.h:559: error: too many arguments to function
`int av_write_frame(AVFormatContext*, AVPacket*)'

zm_mpeg.cpp:301: error: at this point in file

make[2]: *** [zm_mpeg.o] Error 1
make[2]: Leaving directory `/usr/src/zoneminder/zm-1.19.4/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/zoneminder/zm-1.19.4'
make: *** [all] Error 2
kim_asplund
Posts: 33
Joined: Tue Dec 16, 2003 1:51 pm

Post by kim_asplund »

Are you using FFmpeg version 0.4.9-pre1? trye to use FFmpeg version 0.4.8 in stead. I had similar problems with 0.4.9-pre1.

Regards Kim.
kim_asplund
Posts: 33
Joined: Tue Dec 16, 2003 1:51 pm

Post by kim_asplund »

Did not se that you wrote that you used the CVS version.... :oops:

Trye to dl the older source v.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Don't forget also that you may have to rerun 'configure' in ZM depending on when you installed ffmpeg relative to the last ZM build.

Also, you need to do a 'make install-libs' (I think) as well as just a 'make install' in ffmpeg otherwise the libraries don't get installed and ZM can't link.

Phil,
kim_asplund
Posts: 33
Joined: Tue Dec 16, 2003 1:51 pm

Post by kim_asplund »

I think that can be done in the ./configure --options to if im not mistaken.
CLA12345
Posts: 3
Joined: Sat Aug 28, 2004 6:38 pm

Post by CLA12345 »

Thanks to everyone for their suggestions! I don't have FFmpeg working yet, but I'm still hopeful.

In the meantime I have run into a related issue. Even when I explicitly tell Configure that I do NOT want FFmpeg support (--without-ffmpeg), I still get the same mpeg-related error messages (see below) during Make.

Why does it still try to include FFmpeg support when I have told it not to? :? I'm probably overlooking something simple. Thanks!


zm_mpeg.cpp: In member function `double VideoStream::EncodeFrame(uint8_t*, int, bool, unsigned int)':

zm_mpeg.cpp:257: error: 'struct AVFormatContext' has no member named 'pts_num'

zm_mpeg.cpp:257: error: 'struct AVFormatContext' has no member named 'pts_den'

zm_mpeg.cpp:287: error: invalid conversion from `int' to `AVPacket*'

/usr/local/include/ffmpeg/avformat.h:559: error: too many arguments to function `int av_write_frame(AVFormatContext*, AVPacket*)'

zm_mpeg.cpp:287: error: at this point in file

zm_mpeg.cpp:301: error: invalid conversion from `int' to `AVPacket*'

/usr/local/include/ffmpeg/avformat.h:559: error: too many arguments to function `int av_write_frame(AVFormatContext*, AVPacket*)'

zm_mpeg.cpp:301: error: at this point in file

make[2]: *** [zm_mpeg.o] Error 1
User avatar
stoffell
Posts: 5
Joined: Wed Sep 15, 2004 9:19 am
Location: Belgium

Post by stoffell »

I guess removing the ffmpeg package would do the trick as the --without-ffmpeg doesn't do a thing ?

Have you gotten any further on getting it compiled? I'm getting exactly the same error as you.. Will be trying out an 'older' version later today, if it succeeds i'll post it here.
User avatar
securiteaze
Posts: 25
Joined: Wed Jun 16, 2004 5:38 pm

Post by securiteaze »

/usr/local/include/ffmpeg/avformat.h:559: error: too many arguments to function `int av_write_frame(AVFormatContext*, AVPacket*)'
I received the exact error when trying to install on zm on Gentoo using ffmpeg-0.4.9_pre1. However, regressing to ffmpeg-0.4.8.20040322-r1 solved the problem.

I believe that ffmpeg has had major updates recently, which appear to have broken zm. At least that is what I get from the preceding error, and rummaging through the source.

Also, try running `make clean` before running `make`, this may clear up your compile problems.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I did post a reply to this a week or so ago, or so I thought. I can't see it here though so I'll try again.

The --with--ffmpeg flag is used to inform configure of the whereabouts of ffmpeg in case it's not in the regular places. The configure script will unconditionally check however for the existence of the library and headers and if it finds them will include ffmpeg in the build.

It does appear that the most recent ffmpeg release has changed the api somewhat. I'll try and figure out what it's done and see if I can make it work under both versions.

Phil,
loop
Posts: 69
Joined: Thu Nov 06, 2003 3:10 pm

Post by loop »

Great, Phil.
Because I'm having a lot of problems compiling ffmpeg 0.4.8 on EPIA PD & Suse 9.1 (minimum install). It won't compile unless I turn off optimization. Then it also needs one of X11 includes, that's why I needed to add XFree86-devel. 0.4.9-pre1 however did compile without a problem on this same machine (but ZM won't).

Regards, D.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Hi,

I've fixed this in .15 (out over the weekend if I get chance) and it should detect which version of ffmpeg you have and compile with either.

Phil,
Locked