BUG: Motion doesn't build with latest ffmpeg
Motion build exists with error when ffmpeg.c is compiled. Even latest motion snapshot has this problem. Is my version of ffmpeg too new? For info my ffmpeg configure line was:
./configure --arch=i486 --target-os=linux --prefix=/usr --mandir=/usr/man --disable-debug --enable-shared --disable-static --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-x11grab --enable-liba52 --enable-libdc1394 --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libogg --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libamr-nb --enable-libamr-wb
I suggest the symbol file_protocol to be 'extern'-ed in the ffmpeg.c file or its header.
$ CFLAGS='-march=i486 -mtune=i686' ./configure --build=i486-slackware-linux --prefix=/usr
checking for Darwin... no
checking for *BSD... no
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for pthread_create in -lpthread... yes
checking for libjpeg-mmx... skipping
checking for jpeg_set_defaults in -ljpeg... yes
checking for ffmpeg autodetecting... found
checking for ffmpeg headers... found
checking for mysql support... testing
checking autodect mysql headers... yes
checking autodect mysql libs... found
checking for PostgreSQL... Cannot find libpq-fe.h. Please specify the installation path of PostgreSQL
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for unistd.h... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking linux/videodev.h usability... yes
checking linux/videodev.h presence... yes
checking for linux/videodev.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking for struct v4l2_buffer... yes
checking for V42L support... yes
checking for short int... yes
checking size of short int... 2
checking for int... yes
checking size of int... 4
checking for an ANSI C-conforming const... yes
Detected CPU: Celeron (Coppermine)
CPU optimization: -march=pentium3 -mfpmath=sse -msse -mmmx
checking for bswap instruction... yes
configure: creating ./config.status
config.status: creating motion.init-FreeBSD.sh
config.status: creating motion.init-Debian
config.status: creating motion.init-RH
config.status: creating motion.spec
config.status: creating Makefile
************************
* Configure status *
************************
OS : Linux
pthread Support: Yes
jpeg Support: Yes
V4L included: Yes
V4L2 supported: Yes
FFmpeg Support: Yes
MYSQL Support: Yes
PostgreSQL Support: No
CFLAGS: -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx
LIBS: -lm -lpthread -ljpeg -L/usr/lib -lavformat -lavcodec -lm -lz -L/usr/lib -lmysqlclient -lz
LDFLAGS: -L/usr/lib
Install prefix: /usr
$ time make
Welcome to the setup procedure for Motion, the motion detection daemon! If you get
error messages during this procedure, please report them to the mailing list. The
Motion Guide contains all information you should need to get Motion up and running.
Run "make updateguide" to download the latest version of the Motion Guide.
Version: 3.2.8
Platform: Linux (if this is incorrect, please read README.FreeBSD)
Generating dependencies, please wait...
Compiling Motion object files...
--------------------------------------------------------------------------------
gcc -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx -Wall -DVERSION=\"3.2.8\" -D_REENTRANT -Dsysconfdir=\"/usr/etc\" -c -o motion.o motion.c
gcc -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx -Wall -DVERSION=\"3.2.8\" -D_REENTRANT -Dsysconfdir=\"/usr/etc\" -c -o conf.o conf.c
gcc -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx -Wall -DVERSION=\"3.2.8\" -D_REENTRANT -Dsysconfdir=\"/usr/etc\" -c -o draw.o draw.c
gcc -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx -Wall -DVERSION=\"3.2.8\" -D_REENTRANT -Dsysconfdir=\"/usr/etc\" -c -o video.o video.c
gcc -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx -Wall -DVERSION=\"3.2.8\" -D_REENTRANT -Dsysconfdir=\"/usr/etc\" -c -o video2.o video2.c
video2.c:51:17: warning: #warning **************************************************
video2.c:52:4: warning: #warning Using experimental V4L2 support
video2.c:53:17: warning: #warning **************************************************
video2.c:398: warning: 'v4l2_set_fps' defined but not used
gcc -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx -Wall -DVERSION=\"3.2.8\" -D_REENTRANT -Dsysconfdir=\"/usr/etc\" -c -o video_common.o video_common.c
gcc -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx -Wall -DVERSION=\"3.2.8\" -D_REENTRANT -Dsysconfdir=\"/usr/etc\" -c -o netcam.o netcam.c
gcc -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx -Wall -DVERSION=\"3.2.8\" -D_REENTRANT -Dsysconfdir=\"/usr/etc\" -c -o netcam_ftp.o netcam_ftp.c
gcc -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx -Wall -DVERSION=\"3.2.8\" -D_REENTRANT -Dsysconfdir=\"/usr/etc\" -c -o netcam_jpeg.o netcam_jpeg.c
gcc -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx -Wall -DVERSION=\"3.2.8\" -D_REENTRANT -Dsysconfdir=\"/usr/etc\" -c -o netcam_wget.o netcam_wget.c
gcc -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx -Wall -DVERSION=\"3.2.8\" -D_REENTRANT -Dsysconfdir=\"/usr/etc\" -c -o track.o track.c
gcc -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx -Wall -DVERSION=\"3.2.8\" -D_REENTRANT -Dsysconfdir=\"/usr/etc\" -c -o alg.o alg.c
gcc -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx -Wall -DVERSION=\"3.2.8\" -D_REENTRANT -Dsysconfdir=\"/usr/etc\" -c -o event.o event.c
gcc -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx -Wall -DVERSION=\"3.2.8\" -D_REENTRANT -Dsysconfdir=\"/usr/etc\" -c -o picture.o picture.c
gcc -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx -Wall -DVERSION=\"3.2.8\" -D_REENTRANT -Dsysconfdir=\"/usr/etc\" -c -o rotate.o rotate.c
gcc -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx -Wall -DVERSION=\"3.2.8\" -D_REENTRANT -Dsysconfdir=\"/usr/etc\" -c -o webhttpd.o webhttpd.c
gcc -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx -Wall -DVERSION=\"3.2.8\" -D_REENTRANT -Dsysconfdir=\"/usr/etc\" -c -o webcam.o webcam.c
gcc -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx -Wall -DVERSION=\"3.2.8\" -D_REENTRANT -Dsysconfdir=\"/usr/etc\" -c -o mjpeg.o mjpeg.c
gcc -march=i486 -mtune=i686 -DHAVE_FFMPEG -I/usr/include/ffmpeg -DHAVE_MYSQL -I/usr/include/mysql -DMOTION_V4L2 -DTYPE_32BIT="int" -DHAVE_BSWAP -march=pentium3 -mfpmath=sse -msse -mmmx -Wall -DVERSION=\"3.2.8\" -D_REENTRANT -Dsysconfdir=\"/usr/etc\" -c -o ffmpeg.o ffmpeg.c
ffmpeg.c:26:4: warning: #warning **************************************************
ffmpeg.c:27:4: warning: #warning Your version of FFmpeg is newer than version 0.4.8
ffmpeg.c:28:4: warning: #warning Newer versions of ffmpeg do not support MPEG1 with
ffmpeg.c:29:4: warning: #warning non-standard framerate. MPEG1 will be disabled for
ffmpeg.c:30:4: warning: #warning normal video output. You can still use mpeg4 and
ffmpeg.c:31:4: warning: #warning and mpeg4ms which are both better in terms of size
ffmpeg.c:32:4: warning: #warning and quality. MPEG1 is always used for timelapse.
ffmpeg.c:33:4: warning: #warning Please read the Motion Guide for more information.
ffmpeg.c:34:4: warning: #warning Note that this is not an error message!
ffmpeg.c:35:4: warning: #warning **************************************************
ffmpeg.c: In function 'ffmpeg_init':
ffmpeg.c:135: error: 'file_protocol' undeclared (first use in this function)
ffmpeg.c:135: error: (Each undeclared identifier is reported only once
ffmpeg.c:135: error: for each function it appears in.)
make: *** [ffmpeg.o] Error 1
real 0m12.071s
user 0m10.337s
sys 0m1.612s
Environment
Motion version: |
3.2.8 |
ffmpeg version: |
20071002 |
Shared libraries: |
ffmpeg, mysql |
Server OS: |
Slackware Linux |
--
GeorgiSotirov - 06 Oct 2007
Follow up
I did recently a patch for motion ports because had problem you described above , this patch is available in latest svn version ( svn r227 ). So please get current svn version and try to reproduce your problem again , however you have to do a small change in ffmpeg.c to allow work in linux:
ffmpeg.c:117
<#if LIBAVFORMAT_BUILD > 3345660 && defined(BSD)
>#if LIBAVFORMAT_BUILD > 3345660
--
AngelCarpintero - 07 Oct 2007
Fix record
I've added a fix in current svn version ( r228 ) , please reopen if problem remains.
--
AngelCarpintero - 07 Oct 2007