Bug 584716 - zoneminder mpeg4 via RTSP from IP camera - ffmpeg-libraries not found
zoneminder mpeg4 via RTSP from IP camera - ffmpeg-libraries not found
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: zoneminder (Show other bugs)
12
All Linux
low Severity medium
: ---
: ---
Assigned To: Martin Ebourne
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-22 05:14 EDT by Nikolay Yatsyshyn
Modified: 2010-04-22 10:35 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-04-22 10:35:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
zoneminder patch and spec (4.38 KB, application/x-gzip)
2010-04-22 05:14 EDT, Nikolay Yatsyshyn
no flags Details

  None (edit)
Description Nikolay Yatsyshyn 2010-04-22 05:14:40 EDT
Created attachment 408272 [details]
zoneminder patch and spec

Description of problem:

I'm using AXIS M1011 IP cameras and want to move capture format from mjpeg to mpeg4, because of internet havn't sufficient bandwidth. Mjpeg working fine, but when I change format to mpeg4 via RTSP (zoneminder AXIS IP mpeg4 RTS/RTSP/HTTP preset) and path /mpeg4/media.amp

I got:
zmc_m3[8961]: FAT [You must have ffmpeg libraries installed to use remote camera protocol 'rtsp' for monitor 3],
but ffmpeg and ffmpeg-libs was installed from rpmfusion repos and have all libraries need.

mplayer or ffmpeg play video fine via rtsp://ip/mpeg4/media.amp.

Version-Release number of selected component (if applicable):
zoneminder-1.24.2-3.fc12.i386
ffmpeg-libs-0.5-5.20091026svn.fc12.i686
ffmpeg-devel-0.5-5.20091026svn.fc12.i686
ffmpeg-0.5-5.20091026svn.fc12.i686

Steps to Reproduce:
1. add rpmfusion repos, then yum install zoneminder ffmpeg ffmpeg-libs.
2. configure zoneminder as provided in INSTALL 
3. add new camera and change setting via preset "Axis IP, mpeg4, RTP/RTSP/HTTP".
4. tail -f /var/log/messages, you can see

zmc_m3[8961]: FAT [You must have ffmpeg libraries installed to use remote camera protocol 'rtsp' for monitor 3],
  
I have fixed this bug:

What are you need:
Install rpm-build, then "yumdownload --source zoneminder && rpm -ivh zoneminder-1.24.2-3.fc12.src.rpm". After it enter rpmbuild and run rpmbuild SPECS/zoneminder.spec and install all deps to satisfy it.
then run patch to SPEC file "patch -p0 < /root/zmspec.patch":

--- SPECS/zoneminder.spec	2010-04-22 12:02:42.000000000 +0300
+++ SPECS/zoneminder.spec	2010-04-22 10:11:15.000000000 +0300
@@ -27,6 +27,7 @@
 Patch4:		zoneminder-1.24.1-perldep.patch
 Patch10: 	zoneminder-1.22.3-installfix.patch
 Patch11: 	zoneminder-1.24.2-gcc44.patch
+Patch12: 	zoneminder-1.24.2-ffmpeglibs.patch
 
 Conflicts: 	zm <= 1.22.3
 
@@ -76,6 +77,7 @@
 %patch4 -p0 -b .perldep
 %patch10 -p0 -b .installfix
 %patch11 -p0 -b .gcc44
+%patch12 -p0 -b .ffmpeglibs
 gunzip -c %{SOURCE1} | tar xf - cambozola-*/dist/cambozola.jar
 cp %{SOURCE4} README.Fedora

after it copy below patch to "SOURCES/zoneminder-1.24.2-noffmpeg.patch" and run rpmbuild -bb SPECS/zoneminder.spec. After it ZM will correctly handle "rtsp" protocol.

diff -up configure.ac configure.ac
--- configure.ac        2010-04-22 10:09:29.000000000 +0300
+++ configure.ac        2010-04-22 10:10:24.000000000 +0300
@@ -74,8 +74,8 @@ AC_ARG_WITH(ffmpeg,
     e.g. --with-ffmpeg=/usr/local])
 )
 AC_SUBST(FFMPEG_PREFIX)
-FFMPEG_LIBS="-L${FFMPEG_PREFIX}/${LIB_ARCH}"
-FFMPEG_CFLAGS="-I${FFMPEG_PREFIX}/include"
+FFMPEG_LIBS=`pkg-config --libs libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswscale`
+FFMPEG_CFLAGS=`pkg-config --cflags libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswscale`
 AC_SUBST(FFMPEG_LIBS)
 AC_SUBST(FFMPEG_CFLAGS)
 
@@ -244,10 +244,10 @@ else
 AC_CHECK_LIB(gnutls-openssl,MD5,,AC_MSG_WARN([gnutls-openssl.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead]))
 fi
 AC_CHECK_LIB(pcre,pcre_compile,,AC_MSG_WARN(libpcre.a may be required for remote/network camera support))
-dnl AC_CHECK_LIB(avutil,av_malloc,,AC_MSG_WARN(libavutil.a may be required for MPEG streaming))
-dnl AC_CHECK_LIB(avcodec,avcodec_init,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming))
-dnl AC_CHECK_LIB(avformat,av_new_stream,,AC_MSG_WARN(libavformat.a is required for MPEG streaming),[-lavcodec -lavutil])
-dnl AC_CHECK_LIB(swscale,sws_scale,,,-lswscale)
+AC_CHECK_LIB(avutil,av_malloc,,AC_MSG_WARN(libavutil.a may be required for MPEG streaming))
+AC_CHECK_LIB(avcodec,avcodec_init,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming))
+AC_CHECK_LIB(avformat,av_new_stream,,AC_MSG_WARN(libavformat.a is required for MPEG streaming),[-lavcodec -lavutil])
+AC_CHECK_LIB(swscale,sws_scale,,,-lswscale)
 AC_CHECK_LIB(bz2,BZ2_bzCompress,,AC_MSG_WARN(zm requires libbz2.a for recent versions of ffmpeg))
 AC_CHECK_LIB(z,compress,,)

@@ -259,14 +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(pcre/pcre.h,AC_SUBST(ZM_PCRE,"1"),,)
+AC_CHECK_HEADERS(ffmpeg/libswscale/swscale.h,,,)
 AC_CHECK_HEADERS(pcre.h,AC_SUBST(ZM_PCRE,"1"),,)
 if test "$ENABLE_MMAP" = "yes"; then
 AC_CHECK_HEADERS(sys/mman.h,,,)

I don't know how to contribute this patch, so if it possible to include it in official distribution.
Comment 1 Jason Tibbitts 2010-04-22 10:35:27 EDT
I don't believe this is acceptable for Fedora.  We can't build Fedora packages with packages from rpmfusion installed, so what is required is an alteration of the source to check for the ffmpeg libraries at runtime instead of at build time, or to use some other media framework like gstreamer that has such a capability.

If you can fix the software to check for ffmpeg at runtime, we'll investigate the patch, but something that requires it at build time is not useful for Fedora.

Another possibility would be to move zoneminder out of Fedora and into rpmfusion.  I am not interested in doing that; perhaps someone else is.

Note You need to log in before you can comment on or make changes to this bug.