Motion 3.2.12 gmake failed with ffmpeg error
Question
Really appreciate if anyone has hint of why I encountered the error. Has been googling and looking around all documents that has no clue.
I tried to compile motion-3.2.12 on
FreeBSD 9.0 and hit into the following error when I call the gmake command.
What else do I missed?
P.S: Reason why I perform the compilation is that I have 2 version of ffmpeg (ffmpeg-N-42368-gbf53863 and ffmpeg-1.0.1). I need to maintain ffmpeg-N-42368-gbf53863 to proper running serviio server. If I do a pkg_add, it will overwrite the ffmpeg-N-42368-gbf53863 and the serviio transcoding will failed.
<b><u>My FreeBSD Environment:</u></b>
autoconf-2.69
ffmpeg-1.0.1
motion-3.2.12
FreeBSD 9.0 release.
The following is the sequence of command that I had ran. configure command return no error. However, autoconf seems to generate a warning, included in this email. I had also attached the full gmake command output in the attached file.
autoconf
./configure --with-ffmpeg=/opt/ffmpeg-1.0.1 --prefix=/opt/motion-3.2.12
gmake
<u><b>Error from gmake:</b></u>
<i>ffmpeg.c:76: error: expected ')' before '*' token</i>
<i>ffmpeg.c:112: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'mpeg1_file_protocol'</i>
<i>ffmpeg.c:131: error: expected ')' before '*' token</i>
<i>ffmpeg.c:155: error: expected ')' before '*' token</i>
<i>ffmpeg.c:161: error: expected ')' before '*' token</i>
<i>ffmpeg.c:167: error: expected ')' before '*' token</i>
<i>ffmpeg.c:173: error: expected ')' before '*' token</i>
<i>ffmpeg.c:179: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'file_protocol'</i>
<i>ffmpeg.c: In function 'mpeg1_write_trailer':</i>
<i>ffmpeg.c:202: warning: implicit declaration of function 'put_buffer'</i>
<i>ffmpeg.c:203: warning: implicit declaration of function 'put_flush_packet'</i>
<i>ffmpeg.c: In function 'ffmpeg_init':</i>
<i>ffmpeg.c:225: error: 'mpeg1_file_protocol' undeclared (first use in this function)</i>
<i>ffmpeg.c:225: error: (Each undeclared identifier is reported only once</i>
<i>ffmpeg.c:225: error: for each function it appears in.)</i>
<i>ffmpeg.c:225: error: 'file_protocol' undeclared (first use in this function)</i>
<i>ffmpeg.c:235: warning: implicit declaration of function 'av_register_protocol2'</i>
<i>ffmpeg.c: In function 'ffmpeg_close':</i>
<i>ffmpeg.c:639: warning: implicit declaration of function 'url_fclose'</i>
<i>ffmpeg.c: In function 'ffmpeg_put_frame':</i>
<i>ffmpeg.c:703: warning: 'avcodec_encode_video' is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4118)</i>
<i>gmake: *** [ffmpeg.o] Error 1</i>
<u><b>autoconfig warning:</b></u>
<i>
[root@universe /opt/motion-3.2.12/src]# autoconf</i>
<i>configure.in:429: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body</i>
<i>../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...</i>
<i>../../lib/autoconf/general.m4:2590: _AC_COMPILE_IFELSE is expanded from...</i>
<i>../../lib/autoconf/general.m4:2606: AC_COMPILE_IFELSE is expanded from...</i>
<i>configure.in:429: the top level</i>
<u><b>configure output:</b></u>
<i>[root@universe /opt/motion-3.2.12/src]# ./configure --with-ffmpeg=/opt/ffmpeg-1.0.1 --prefix=/opt/motion-3.2.12</i>
<i>checking for Darwin... no</i>
<i>checking for *BSD... yes</i>
<i>checking Linuxthreads... skipping</i>
<i>Build with PWCBSD support no</i>
<i>checking for gcc... gcc</i>
<i>checking whether the C compiler works... yes</i>
<i>checking for C compiler default output file name... a.out</i>
<i>checking for suffix of executables...</i>
<i>checking whether we are cross compiling... no</i>
<i>checking for suffix of object files... o</i>
<i>checking whether we are using the GNU C compiler... yes</i>
<i>checking whether gcc accepts -g... yes</i>
<i>checking for gcc option to accept ISO C89... none needed</i>
<i>checking bktr headers in /usr/include/dev/bktr... yes</i>
<i>checking threads... yes</i>
<i>checking for libjpeg-mmx... skipping</i>
<i>checking for libjpeg...</i>
<i>checking for jpeg_set_defaults in -ljpeg... yes</i>
<i>checking for ffmpeg in -> /opt/ffmpeg-1.0.1 <-... found</i>
<i>checking for ffmpeg headers in /opt/ffmpeg-1.0.1... found /opt/ffmpeg-1.0.1/include/libavformat/avformat.h</i>
<i>checking file_protocol is defined in ffmpeg ?... no</i>
<i>checking for mysql support... testing</i>
<i>checking autodect mysql headers... yes</i>
<i>checking autodect mysql libs... /usr/local/lib/mysql</i>
<i>checking for mysql_init in -lmysqlclient... yes</i>
<i>checking for PostgreSQL... testing</i>
<i>checking autodect pgsql headers... not found</i>
<i>Invalid PostgreSQL directory - unable to find libpq-fe.h.</i>
<i>checking how to run the C preprocessor... gcc -E</i>
<i>checking for grep that handles long lines and -e... /usr/bin/grep</i>
<i>checking for egrep... /usr/bin/grep -E</i>
<i>checking for ANSI C header files... yes</i>
<i>checking for sys/types.h... yes</i>
<i>checking for sys/stat.h... yes</i>
<i>checking for stdlib.h... yes</i>
<i>checking for string.h... yes</i>
<i>checking for memory.h... yes</i>
<i>checking for strings.h... yes</i>
<i>checking for inttypes.h... yes</i>
<i>checking for stdint.h... yes</i>
<i>checking for unistd.h... yes</i>
<i>checking stdio.h usability... yes</i>
<i>checking stdio.h presence... yes</i>
<i>checking for stdio.h... yes</i>
<i>checking for unistd.h... (cached) yes</i>
<i>checking for stdint.h... (cached) yes</i>
<i>checking fcntl.h usability... yes</i>
<i>checking fcntl.h presence... yes</i>
<i>checking for fcntl.h... yes</i>
<i>checking time.h usability... yes</i>
<i>checking time.h presence... yes</i>
<i>checking for time.h... yes</i>
<i>checking signal.h usability... yes</i>
<i>checking signal.h presence... yes</i>
<i>checking for signal.h... yes</i>
<i>checking sys/ioctl.h usability... yes</i>
<i>checking sys/ioctl.h presence... yes</i>
<i>checking for sys/ioctl.h... yes</i>
<i>checking sys/mman.h usability... yes</i>
<i>checking sys/mman.h presence... yes</i>
<i>checking for sys/mman.h... yes</i>
<i>checking linux/videodev.h usability... no</i>
<i>checking linux/videodev.h presence... no</i>
<i>checking for linux/videodev.h... no</i>
<i>checking linux/videodev2.h usability... no</i>
<i>checking linux/videodev2.h presence... no</i>
<i>checking for linux/videodev2.h... no</i>
<i>checking sys/param.h usability... yes</i>
<i>checking sys/param.h presence... yes</i>
<i>checking for sys/param.h... yes</i>
<i>checking for sys/types.h... (cached) yes</i>
<i>checking for get_current_dir_name... no</i>
<i>checking for struct v4l2_buffer... no</i>
<i>checking for V42L support... no</i>
<i>checking for V42L *old* support... testing</i>
<i>checking for linux/videodev2.h... (cached) no</i>
<i>checking size of short... 2</i>
<i>checking size of int... 4</i>
<i>checking size of long int... 4</i>
<i>checking size of long long... 8</i>
<i>checking size of int *... 4</i>
<i>checking size of void *... 4</i>
<i>checking for an ANSI C-conforming const... yes</i>
<i>checking for bswap instruction... yes</i>
<i>configure: creating ./config.status</i>
<i>config.status: creating thread1.conf</i>
<i>config.status: creating thread2.conf</i>
<i>config.status: creating thread3.conf</i>
<i>config.status: creating thread4.conf</i>
<i>config.status: creating motion-dist.conf</i>
<i>config.status: creating motion.init-FreeBSD.sh</i>
<i>config.status: creating motion.init-Debian</i>
<i>config.status: creating motion.init-Fedora</i>
<i>config.status: creating motion.spec</i>
<i>config.status: creating Makefile</i>
<i>config.status: creating config.h</i>
<i> *******************************</i>
<i> Configure status</i>
<i> motion 3.2.12</i>
<i> *******************************</i>
<i>OS : *BSD</i>
<i>pthread Support: Yes</i>
<i>jpeg Support: Yes</i>
<i>BKTR included: Yes</i>
<i>PWCBSD include: No</i>
<i>FFmpeg Support: Yes</i>
<i>MYSQL Support: Yes</i>
<i>PostgreSQL Support: No</i>
<i>CFLAGS: -I/usr/local/include -g -O2 -D_REENTRANT -D_THREAD_SAFE -DHAVE_FFMPEG -I/opt/ffmpeg-1.0.1/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -I/usr/local/include/mysql -DTYPE_32BIT="int" -DHAVE_BSWAP</i>
<i>LIBS: -lm -L/usr/local/lib -pthread -ljpeg -L/opt/ffmpeg-1.0.1/lib -lavformat -lavcodec -lavutil -lm -lz -L/usr/local/lib/mysql -lmysqlclient -lz</i>
<i>LDFLAGS: -L/usr/local/lib -L/opt/ffmpeg-1.0.1/lib</i>
<i>Install prefix: /opt/motion-3.2.12</i>
<u><b>Complete gmake output</b>:</u>
[root@universe /opt/motion-3.2.12/src]# gmake
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.12
Platform: FreeBSD
Generating dependencies, please wait...
Compiling Motion object files...
--------------------------------------------------------------------------------
gcc -I/usr/local/include -g -O2 -D_REENTRANT -D_THREAD_SAFE -DHAVE_FFMPEG -I/opt/ffmpeg-1.0.1/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -I/usr/local/include/mysql -DTYPE_32BIT="int" -DHAVE_BSWAP -Wall -DVERSION=\"3.2.12\" -Dsysconfdir=\"/opt/motion-3.2.12/etc\" -c -o motion.o motion.c
gcc -I/usr/local/include -g -O2 -D_REENTRANT -D_THREAD_SAFE -DHAVE_FFMPEG -I/opt/ffmpeg-1.0.1/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -I/usr/local/include/mysql -DTYPE_32BIT="int" -DHAVE_BSWAP -Wall -DVERSION=\"3.2.12\" -Dsysconfdir=\"/opt/motion-3.2.12/etc\" -c -o conf.o conf.c
gcc -I/usr/local/include -g -O2 -D_REENTRANT -D_THREAD_SAFE -DHAVE_FFMPEG -I/opt/ffmpeg-1.0.1/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -I/usr/local/include/mysql -DTYPE_32BIT="int" -DHAVE_BSWAP -Wall -DVERSION=\"3.2.12\" -Dsysconfdir=\"/opt/motion-3.2.12/etc\" -c -o draw.o draw.c
gcc -I/usr/local/include -g -O2 -D_REENTRANT -D_THREAD_SAFE -DHAVE_FFMPEG -I/opt/ffmpeg-1.0.1/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -I/usr/local/include/mysql -DTYPE_32BIT="int" -DHAVE_BSWAP -Wall -DVERSION=\"3.2.12\" -Dsysconfdir=\"/opt/motion-3.2.12/etc\" -c -o jpegutils.o jpegutils.c
gcc -I/usr/local/include -g -O2 -D_REENTRANT -D_THREAD_SAFE -DHAVE_FFMPEG -I/opt/ffmpeg-1.0.1/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -I/usr/local/include/mysql -DTYPE_32BIT="int" -DHAVE_BSWAP -Wall -DVERSION=\"3.2.12\" -Dsysconfdir=\"/opt/motion-3.2.12/etc\" -c -o video_freebsd.o video_freebsd.c
gcc -I/usr/local/include -g -O2 -D_REENTRANT -D_THREAD_SAFE -DHAVE_FFMPEG -I/opt/ffmpeg-1.0.1/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -I/usr/local/include/mysql -DTYPE_32BIT="int" -DHAVE_BSWAP -Wall -DVERSION=\"3.2.12\" -Dsysconfdir=\"/opt/motion-3.2.12/etc\" -c -o netcam.o netcam.c
gcc -I/usr/local/include -g -O2 -D_REENTRANT -D_THREAD_SAFE -DHAVE_FFMPEG -I/opt/ffmpeg-1.0.1/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -I/usr/local/include/mysql -DTYPE_32BIT="int" -DHAVE_BSWAP -Wall -DVERSION=\"3.2.12\" -Dsysconfdir=\"/opt/motion-3.2.12/etc\" -c -o netcam_ftp.o netcam_ftp.c
gcc -I/usr/local/include -g -O2 -D_REENTRANT -D_THREAD_SAFE -DHAVE_FFMPEG -I/opt/ffmpeg-1.0.1/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -I/usr/local/include/mysql -DTYPE_32BIT="int" -DHAVE_BSWAP -Wall -DVERSION=\"3.2.12\" -Dsysconfdir=\"/opt/motion-3.2.12/etc\" -c -o netcam_jpeg.o netcam_jpeg.c
gcc -I/usr/local/include -g -O2 -D_REENTRANT -D_THREAD_SAFE -DHAVE_FFMPEG -I/opt/ffmpeg-1.0.1/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -I/usr/local/include/mysql -DTYPE_32BIT="int" -DHAVE_BSWAP -Wall -DVERSION=\"3.2.12\" -Dsysconfdir=\"/opt/motion-3.2.12/etc\" -c -o netcam_wget.o netcam_wget.c
gcc -I/usr/local/include -g -O2 -D_REENTRANT -D_THREAD_SAFE -DHAVE_FFMPEG -I/opt/ffmpeg-1.0.1/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -I/usr/local/include/mysql -DTYPE_32BIT="int" -DHAVE_BSWAP -Wall -DVERSION=\"3.2.12\" -Dsysconfdir=\"/opt/motion-3.2.12/etc\" -c -o track.o track.c
gcc -I/usr/local/include -g -O2 -D_REENTRANT -D_THREAD_SAFE -DHAVE_FFMPEG -I/opt/ffmpeg-1.0.1/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -I/usr/local/include/mysql -DTYPE_32BIT="int" -DHAVE_BSWAP -Wall -DVERSION=\"3.2.12\" -Dsysconfdir=\"/opt/motion-3.2.12/etc\" -c -o alg.o alg.c
gcc -I/usr/local/include -g -O2 -D_REENTRANT -D_THREAD_SAFE -DHAVE_FFMPEG -I/opt/ffmpeg-1.0.1/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -I/usr/local/include/mysql -DTYPE_32BIT="int" -DHAVE_BSWAP -Wall -DVERSION=\"3.2.12\" -Dsysconfdir=\"/opt/motion-3.2.12/etc\" -c -o event.o event.c
gcc -I/usr/local/include -g -O2 -D_REENTRANT -D_THREAD_SAFE -DHAVE_FFMPEG -I/opt/ffmpeg-1.0.1/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -I/usr/local/include/mysql -DTYPE_32BIT="int" -DHAVE_BSWAP -Wall -DVERSION=\"3.2.12\" -Dsysconfdir=\"/opt/motion-3.2.12/etc\" -c -o picture.o picture.c
picture.c:121:2: warning: #warning using JPEG_LIB_VERSION >= 70
picture.c:240:2: warning: #warning using JPEG_LIB_VERSION >= 70
gcc -I/usr/local/include -g -O2 -D_REENTRANT -D_THREAD_SAFE -DHAVE_FFMPEG -I/opt/ffmpeg-1.0.1/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -I/usr/local/include/mysql -DTYPE_32BIT="int" -DHAVE_BSWAP -Wall -DVERSION=\"3.2.12\" -Dsysconfdir=\"/opt/motion-3.2.12/etc\" -c -o rotate.o rotate.c
gcc -I/usr/local/include -g -O2 -D_REENTRANT -D_THREAD_SAFE -DHAVE_FFMPEG -I/opt/ffmpeg-1.0.1/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -I/usr/local/include/mysql -DTYPE_32BIT="int" -DHAVE_BSWAP -Wall -DVERSION=\"3.2.12\" -Dsysconfdir=\"/opt/motion-3.2.12/etc\" -c -o webhttpd.o webhttpd.c
gcc -I/usr/local/include -g -O2 -D_REENTRANT -D_THREAD_SAFE -DHAVE_FFMPEG -I/opt/ffmpeg-1.0.1/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -I/usr/local/include/mysql -DTYPE_32BIT="int" -DHAVE_BSWAP -Wall -DVERSION=\"3.2.12\" -Dsysconfdir=\"/opt/motion-3.2.12/etc\" -c -o webcam.o webcam.c
gcc -I/usr/local/include -g -O2 -D_REENTRANT -D_THREAD_SAFE -DHAVE_FFMPEG -I/opt/ffmpeg-1.0.1/include -DFFMPEG_NEW_INCLUDES -DHAVE_FFMPEG_NEW -I/usr/local/include/mysql -DTYPE_32BIT="int" -DHAVE_BSWAP -Wall -DVERSION=\"3.2.12\" -Dsysconfdir=\"/opt/motion-3.2.12/etc\" -c -o ffmpeg.o ffmpeg.c
ffmpeg.c:26:10: warning: #warning **************************************************
ffmpeg.c:27:10: warning: #warning Your version of FFmpeg is newer than version 0.4.8
ffmpeg.c:28:10: warning: #warning Newer versions of ffmpeg do not support MPEG1 with
ffmpeg.c:29:10: warning: #warning non-standard framerate. MPEG1 will be disabled for
ffmpeg.c:30:10: warning: #warning normal video output. You can still use mpeg4 and
ffmpeg.c:31:10: warning: #warning and mpeg4ms which are both better in terms of size
ffmpeg.c:32:10: warning: #warning and quality. MPEG1 is always used for timelapse.
ffmpeg.c:33:10: warning: #warning Please read the Motion Guide for more information.
ffmpeg.c:34:10: warning: #warning Note that this is not an error message!
ffmpeg.c:35:10: warning: #warning **************************************************
ffmpeg.c:76: error: expected ')' before '*' token
ffmpeg.c:112: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'mpeg1_file_protocol'
ffmpeg.c:131: error: expected ')' before '*' token
ffmpeg.c:155: error: expected ')' before '*' token
ffmpeg.c:161: error: expected ')' before '*' token
ffmpeg.c:167: error: expected ')' before '*' token
ffmpeg.c:173: error: expected ')' before '*' token
ffmpeg.c:179: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'file_protocol'
ffmpeg.c: In function 'mpeg1_write_trailer':
ffmpeg.c:202: warning: implicit declaration of function 'put_buffer'
ffmpeg.c:203: warning: implicit declaration of function 'put_flush_packet'
ffmpeg.c: In function 'ffmpeg_init':
ffmpeg.c:225: error: 'mpeg1_file_protocol' undeclared (first use in this function)
ffmpeg.c:225: error: (Each undeclared identifier is reported only once
ffmpeg.c:225: error: for each function it appears in.)
ffmpeg.c:225: error: 'file_protocol' undeclared (first use in this function)
ffmpeg.c:235: warning: implicit declaration of function 'av_register_protocol2'
ffmpeg.c: In function 'ffmpeg_close':
ffmpeg.c:639: warning: implicit declaration of function 'url_fclose'
ffmpeg.c: In function 'ffmpeg_put_frame':
ffmpeg.c:703: warning: 'avcodec_encode_video' is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4118)
gmake: *** [ffmpeg.o] Error 1
Environment
Motion version: |
3.2.12 |
ffmpeg version: |
1.0.1 |
Libraries: |
ffmpeg, mysql |
Server OS: |
FreeBSD 9.0 |
--
ChengGan - 05 Jan 2013
Answer