Page 1 of 1

Fedora Core 14 + WVC54GC + ffmpeg

Posted: Sun Jan 23, 2011 5:42 pm
by jtmcdole
Ohhh the fun that was getting this setup to work! I was trying to use motion and ffmeg for a while, but I really wanted to get zoneminder working with these cameras (I got them for free, otherwise I'd never have bought them).

So; fc14 doesn't have ffmpeg compiled with zoneminder. I did the normal steps to get the src rpms for ffmpeg and installed all of them:

Code: Select all

rpm -qa | grep ffmpeg
ffmpeg-0.6-4.20100704svn.fc14.i386
ffmpeg-devel-0.6-4.20100704svn.fc14.i386
ffmpeg-libs-0.6-4.20100704svn.fc14.i386
I then downloaded the zoneminder src rpm and installed it. I had to modify the .spec:
1) Remove the ffmpeg delete patch
2) Add my own patch to fix ffmpeg compilation errors in the zoneminder source tree (0.6-4)
3) Add the config for non-x86_64 compile

For #3:

Code: Select all

--- zoneminder.spec     2011-01-23 11:06:01.493372988 -0500
+++ zoneminder.spec_ffmpeg      2010-06-02 06:20:28.000000000 -0400
@@ -23,10 +23,10 @@ Source5:    http://downloads.sourceforge
 Source6:    http://mootools.net/download/get/mootools-1.2.3-core-yc.js
 Patch1:        zoneminder-1.24.2-dbinstall.patch
 Patch2:                zoneminder-1.24.1-runlevel.patch
+Patch3:                zoneminder-1.24.2-noffmpeg.patch
 Patch4:                zoneminder-1.24.1-perldep.patch
 Patch10:       zoneminder-1.22.3-installfix.patch
 Patch11:       zoneminder-1.24.2-gcc44.patch
-Patch20:       zoneminder-1.24.2-ffmpeg064.patch

 Conflicts:     zm <= 1.22.3

@@ -72,10 +72,10 @@ popd

 %patch1 -p0 -b .dbinstall
 %patch2 -p0 -b .runlevel
+%patch3 -p0 -b .noffmpeg
 %patch4 -p0 -b .perldep
 %patch10 -p0 -b .installfix
 %patch11 -p0 -b .gcc44
-%patch20 -p0 -b .ffmpeg064
 gunzip -c %{SOURCE1} | tar xf - cambozola-*/dist/cambozola.jar
 cp %{SOURCE4} README.Fedora

@@ -102,7 +102,6 @@ OPTS=""
        --with-webuser=%{zmuid} \
        --with-webgroup=%{zmgid} \
        --disable-debug \
-       CPPFLAGS='-D__STDC_CONSTANT_MACROS' \
        $OPTS
 make %{?_smp_mflags}
 %{__perl} -pi -e 's/(ZM_WEB_USER=).*$/${1}%{zmuid_final}/;' \
For #2:

Code: Select all

--- configure.ac.ffmpeg064      2011-01-23 11:06:06.374806597 -0500
+++ configure.ac        2011-01-23 11:06:06.469815037 -0500
@@ -259,13 +259,13 @@ AC_CHECK_HEADERS(linux/videodev.h,,AC_MS
 AC_CHECK_HEADERS(linux/videodev2.h,AC_SUBST(ZM_V4L2,"1"),AC_MSG_WARN(zm requires Video4Linux2 to be installed for V4L2 support),)
 AC_CHECK_HEADERS(mysql/mysql.h,,AC_MSG_ERROR(zm requires MySQL headers - check that MySQL development packages are installed),)
 AC_CHECK_HEADERS(libavutil/avutil.h,,,)
-AC_CHECK_HEADERS(ffmpeg/avutil.h,,,)
+AC_CHECK_HEADERS(ffmpeg/libavutil/avutil.h,,,)
 AC_CHECK_HEADERS(libavcodec/avcodec.h,,,)
-AC_CHECK_HEADERS(ffmpeg/avcodec.h,,,)
+AC_CHECK_HEADERS(ffmpeg/libavcodec/avcodec.h,,,)
 AC_CHECK_HEADERS(libavformat/avformat.h,,,)
-AC_CHECK_HEADERS(ffmpeg/avformat.h,,,)
+AC_CHECK_HEADERS(ffmpeg/libavformat/avformat.h,,,)
 AC_CHECK_HEADERS(libswscale/swscale.h,,,)
-AC_CHECK_HEADERS(ffmpeg/swscale.h,,,)
+AC_CHECK_HEADERS(ffmpeg/libswscale/swscale.h,,,)
 AC_CHECK_HEADERS(pcre/pcre.h,AC_SUBST(ZM_PCRE,"1"),,)
 AC_CHECK_HEADERS(pcre.h,AC_SUBST(ZM_PCRE,"1"),,)
 if test "$ENABLE_MMAP" = "yes"; then
--- src/zm_ffmpeg.h.ffmpeg064   2009-03-20 12:09:46.000000000 -0400
+++ src/zm_ffmpeg.h     2011-01-23 11:56:36.452029213 -0500
@@ -27,30 +27,30 @@ extern "C" {
 #endif
 #if HAVE_LIBAVUTIL_AVUTIL_H
 #include <libavutil>
-#elif HAVE_FFMPEG_AVUTIL_H
-#include <ffmpeg>
+#elif HAVE_FFMPEG_LIBAVUTIL_AVUTIL_H
+#include <ffmpeg>
 #else
 #error "No location for avutils.h found"
 #endif
 #if HAVE_LIBAVCODEC_AVCODEC_H
 #include <libavcodec>
-#elif HAVE_FFMPEG_AVCODEC_H
-#include <ffmpeg>
+#elif HAVE_FFMPEG_LIBAVCODEC_AVCODEC_H
+#include <ffmpeg>
 #else
 #error "No location for avcodec.h found"
 #endif
 #if HAVE_LIBAVFORMAT_AVFORMAT_H
 #include <libavformat>
-#elif HAVE_FFMPEG_AVFORMAT_H
-#include <ffmpeg>
+#elif HAVE_FFMPEG_LIBAVFORMAT_AVFORMAT_H
+#include <ffmpeg>
 #else
 #error "No location for avformat.h found"
 #endif
 #if HAVE_LIBSWSCALE
 #if HAVE_LIBSWSCALE_SWSCALE_H
 #include <libswscale>
-#elif HAVE_FFMPEG_SWSCALE_H
-#include <ffmpeg>
+#elif HAVE_FFMPEG_LIBSWSCALE_SWSCALE_H
+#include <ffmpeg>
 #else
 #error "No location for swscale.h found"
 #endif

Last step; to get things compiling nice (heade files found by the autoconf stuff), I made a series of symlinks in the /usr/include/ffmpeg directory:

Code: Select all

find . -type l
./libavformat/libavutil
./libavformat/libavcodec
./libswscale/libavutil
./libavutil/libavutil
./libavcodec/libavutil
./libavfilter/libavformat
./libavfilter/libpostproc
./libavfilter/libswscale
./libavfilter/libavutil
./libavfilter/libavdevice
./libavfilter/include
./libavfilter/libavcodec
After setting this all up, compiling and installing my own zoneminder rpm, I've got a pair of WVC54GC cameras working as monitors following the settings in:
http://www.zoneminder.com/wiki/index.ph ... ys#WVC54GC

--John

Notes:

Posted: Sun Jan 23, 2011 6:03 pm
by jtmcdole
I've noticed my logs are filling with these line:

Code: Select all

Jan 23 12:45:46 shadoelord zmc_m4[31201]: INF [Monitor-4: 452000 - Capturing at 200.00 fps]
Jan 23 12:45:50 shadoelord zmu[574]: ERR [Signal address is 0x268, from 0x2088bc9]
Jan 23 12:45:50 shadoelord zmu[574]: ERR [Backtrace: /usr/lib/libavcodec.so.52(avcodec_close+0x6c) [0x2088bc9]]
Jan 23 12:45:50 shadoelord zmu[574]: ERR [Signal address is 0x268, from 0x2088bc9]
Jan 23 12:45:50 shadoelord zmu[574]: ERR [Backtrace: /usr/lib/libavcodec.so.52(avcodec_close+0x6c) [0x2088bc9]]
Jan 23 12:45:50 shadoelord zmu[574]: ERR [Backtrace: /usr/lib/libavcodec.so.52(avcodec_close+0x6c) [0x2088bc9]]
Jan 23 12:45:50 shadoelord zmu[574]: ERR [Backtrace: /usr/bin/zmu() [0x805c272]]
Jan 23 12:45:50 shadoelord zmu[574]: ERR [Backtrace: /usr/bin/zmu() [0x806d966]]
Jan 23 12:45:50 shadoelord zmu[574]: ERR [Backtrace: /usr/bin/zmu() [0x804d1ee]]
Jan 23 12:45:50 shadoelord zmu[574]: ERR [Backtrace: /lib/libc.so.6(__libc_start_main+0xe6) [0x91be16]]
So far, I still have camera output.[/code]

FC 14, ffmpeg, and Zoneminder

Posted: Tue Jan 25, 2011 1:01 am
by eronquillo
Hi! I'm trying to do the same thing. I'm a bit linux illiterate, and was wondering if you might have the detailed steps to do this? Congrats on gettin this working though!

Posted: Wed Jan 26, 2011 8:11 am
by jtmcdole
Sure. I'm currently on business travel for 2 weeks, so if I can find the time to type it all up I will. If I can also find the resulting .rpm file, I could try to post it on dropbox or the like.

Re: Fedora Core 14 + WVC54GC + ffmpeg

Posted: Wed Mar 30, 2011 5:10 pm
by gretelmk2
This solution would be perfect for me if I could get it going... I have a fairly high degree of experience with linux, but I'm new to creating RPMs and I am relatively inexperienced when it comes to anything related to autoconf.

I noticed in your post you renamed configure.ac to configure.ac.ffmpeg064 and that you specified a new patch file in the zoneminder.spec that I'm assuming that we need to create... is this new configure.ac.ffmpeg064 and the patch file the same?

Also, I was a bit unclear on your links... We both have the includes in /usr/include/ffmpeg, but my /usr/include/ffmpeg/libavformat is an actual folder files in it:

Code: Select all

[tom@mclovin include]$ pwd
/usr/include
[tom@mclovin include]$ cd ffmpeg/
[tom@mclovin ffmpeg]$ ls -l
total 28
drwxr-xr-x 2 root root 4096 Mar 29 19:52 libavcodec
drwxr-xr-x 2 root root 4096 Mar 29 19:52 libavdevice
drwxr-xr-x 2 root root 4096 Mar 29 19:52 libavfilter
drwxr-xr-x 2 root root 4096 Mar 29 19:52 libavformat
drwxr-xr-x 2 root root 4096 Mar 29 19:52 libavutil
drwxr-xr-x 2 root root 4096 Mar 29 19:52 libpostproc
drwxr-xr-x 2 root root 4096 Mar 29 19:52 libswscale
[tom@mclovin ffmpeg]$ ls -l libavformat/
total 72
-rw-r--r-- 1 root root 52124 Mar 29 19:47 avformat.h
-rw-r--r-- 1 root root 19673 Mar 29 19:47 avio.h
[tom@mclovin ffmpeg]$

Thanks,
Tom

Re: Fedora Core 14 + WVC54GC + ffmpeg

Posted: Wed Mar 30, 2011 5:38 pm
by gretelmk2
One more thing, your diffs are a bit weird to me... It seems like the ---'s are when lines are added and +++'s when they are deleted. I based this on files and lines that wouldn't have been there before, but in the case of zm_ffmpeg.h it looks like the --- lines are the original and the +++ act's as the new line (which is what I am used to).

Is my brain broken? It is not too long after lunch still...