Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h264_omx has been blacklisted using codec libx264 #930

Closed
francisuk1989 opened this issue Jul 3, 2018 · 69 comments
Closed

h264_omx has been blacklisted using codec libx264 #930

francisuk1989 opened this issue Jul 3, 2018 · 69 comments

Comments

@francisuk1989
Copy link

francisuk1989 commented Jul 3, 2018

I might have discovered an issue for Motioneye that results into libx264 been used instead of h264_omx
Also using the h264/omx under Movies with Motion 4.1.1.1 installed and with motioneye v0.39.2, Ubuntu 18.04 Bionic Beaver x64

ffmpeg libavcodec version 57.107.100 libavformat version 57.83.100
[1:ml1] [WRN] [ENC] ffmpeg_set_codec: Preferred codec h264_omx has been blacklisted
[1:ml1] [NTC] [ENC] ffmpeg_set_codec: Using codec libx264

squidpop@xpsdc:lap~$ ffmpeg -v
ffmpeg version 3.4.2-2 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7 (Ubuntu 7.3.0-16ubuntu2)
configuration: --prefix=/usr --extra-version=2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100

@ccrisan
Copy link
Collaborator

ccrisan commented Jul 3, 2018

And what could we do to fix this?

@jasaw
Copy link
Contributor

jasaw commented Jul 4, 2018

I blacklisted h264_omx by default because ffmpeg has zero copy enabled on h264_omx by default, and it WILL cause the GPU to lock up. Disable zero copy on your ffmpeg, recompile and reinstall, then comment out h264_omx from the blacklist in motion source code to re-enable it. All patches to do this are available in motionEyeOS.

This was referenced Jul 26, 2018
@gururise
Copy link

gururise commented Aug 6, 2018

@jasaw thanks for providing the patches! I would like to try this out, as CPU usage is just too high on my XU4. Could you kindly point to where in the MotionEyeOS repo the requisite patches are located?

@jasaw
Copy link
Contributor

jasaw commented Aug 7, 2018

ffmpeg disable zero copy patch:
https://github.com/ccrisan/motioneyeos/blob/master/package/ffmpeg/disable-rpi-omx-input-zerocopy.patch

ffmpeg fix handling of fragmented buffers patch:
https://trac.ffmpeg.org/raw-attachment/ticket/7687/0001-avcodec-omx-Fix-handling-of-fragmented-buffers.patch

motion undo h264_omx blacklist patch:
https://github.com/ccrisan/motioneyeos/blob/master/package/motion/enable-h264-omx-codec.patch

@roger-
Copy link

roger- commented May 28, 2019

Are these patches still necessary with the latest version of ffmpeg?

@maffi91
Copy link

maffi91 commented Jun 28, 2019

@gururise Did the patch help you? I also have a XU4 and CPU problems saving the videos.

@jasaw
Copy link
Contributor

jasaw commented Jul 1, 2019

@roger- I believe the patches are still necessary.

@maffi91 @gururise For XU4 hardware video encoding, you need to use h264_v4l2m2m encoder. Make sure your ffmpeg supports h264_v4l2m2m, then change movie_codec parameter in the camera-1.conf file to select the h264_v4l2m2m encoder to this: movie_codec mp4:h264_v4l2m2m.

@jeffdickman
Copy link

Are there instructions for applying the patches somewhere I can reference?

Thanks!

@jasaw
Copy link
Contributor

jasaw commented Aug 20, 2019

# Compile and install FFmpeg from source

sudo apt-get update -qq && sudo apt-get -y install \
  autoconf \
  automake \
  build-essential \
  cmake \
  git-core \
  libass-dev \
  libfreetype6-dev \
  libsdl2-dev \
  libtool \
  libva-dev \
  libvdpau-dev \
  libvorbis-dev \
  libxcb1-dev \
  libxcb-shm0-dev \
  libxcb-xfixes0-dev \
  pkg-config \
  texinfo \
  wget \
  zlib1g-dev \
  libx264-dev

sudo apt-get install libavformat-dev libavcodec-dev libavutil-dev libswscale-dev libavdevice-dev

wget https://ffmpeg.org/releases/ffmpeg-4.2.tar.bz2
tar xf ffmpeg-4.2.tar.bz2
wget https://raw.githubusercontent.com/ccrisan/motioneyeos/master/package/ffmpeg/disable-rpi-omx-input-zerocopy.patch
wget https://trac.ffmpeg.org/raw-attachment/ticket/7687/0001-avcodec-omx-Fix-handling-of-fragmented-buffers.patch
patch -p1 -d ffmpeg-4.2 < 0001-avcodec-omx-Fix-handling-of-fragmented-buffers.patch
patch -p1 -d ffmpeg-4.2 < disable-rpi-omx-input-zerocopy.patch

cd ffmpeg-4.2
./configure --enable-mmal --enable-omx --enable-omx-rpi --extra-cflags=-I/opt/vc/include/IL
make
make install
cd -



# Compile and install motion from source

sudo apt-get install autoconf automake pkgconf libtool libjpeg8-dev build-essential libzip-dev gettext libmicrohttpd-dev

git clone https://github.com/Motion-Project/motion.git
cd motion
git checkout ff903de2e3d6320f13841a91e4080c1220c38059
wget https://raw.githubusercontent.com/jasaw/motioneyeos/motion-disable-omx-zerocopy/package/motion/2000-disable-zerocopy-via-avoptions.patch
patch -p1 -d . < 2000-disable-zerocopy-via-avoptions.patch
wget https://raw.githubusercontent.com/jasaw/motioneyeos/motion-disable-omx-zerocopy/package/motion/enable-h264-omx-codec.patch
patch -p1 -d . < enable-h264-omx-codec.patch

autoreconf -fiv
./configure
make
make install

@zagrim
Copy link
Collaborator

zagrim commented Aug 20, 2019

The above is great, thanks @jasaw , I just wonder how long it takes to pull that through on a RPi...
I once tried to set up cross-compiling toolchain to recompile ffmpeg on a Linux desktop but failed at it (I don't exactly remember what it was that failed, I recall I managed to produce a simple test arm executable so it might have been some ffmpeg dependencies or required tools or just configuration, since I didn't really know what I was doing). I'd be interested in trying it out once more if someone could point out (or share) instructions for it.

@jasaw
Copy link
Contributor

jasaw commented Aug 20, 2019

RPi 3 and above are pretty fast, shouldn't take too long. I compile things on my RPi all the time. Replace make with make -j4 to use 4 cores to compile. FFmpeg may take a while to compile, but can always start the compilation and leave it overnight.

Cross compiling ffmpeg is painful because it has A LOT of dependencies. You'll need to set up the whole cross compilation environment properly, and cross compile all the dependencies too. This is why we have MotionEyeOS project that deals with all the cross compilation. If you still want to cross compile, check out MotionEyeOS.

@Saku241
Copy link

Saku241 commented Aug 27, 2019

# Compile and install FFmpeg from source

sudo apt-get update -qq && sudo apt-get -y install \
  autoconf \
  automake \
  build-essential \
  cmake \
  git-core \
  libass-dev \
  libfreetype6-dev \
  libsdl2-dev \
  libtool \
  libva-dev \
  libvdpau-dev \
  libvorbis-dev \
  libxcb1-dev \
  libxcb-shm0-dev \
  libxcb-xfixes0-dev \
  pkg-config \
  texinfo \
  wget \
  zlib1g-dev \
  libx264-dev

sudo apt-get install libavformat-dev libavcodec-dev libavutil-dev libswscale-dev libavdevice-dev

git clone https://github.com/FFmpeg/FFmpeg.git
patch -p1 -d FFmpeg < disable-rpi-omx-input-zerocopy.patch
patch -p1 -d FFmpeg < 0001-avcodec-omx-Fix-handling-of-fragmented-buffers.patch

cd FFmpeg
./configure
make
make install
cd -



# Compile and install motion from source

sudo apt-get install autoconf automake pkgconf libtool libjpeg8-dev build-essential libzip-dev gettext libmicrohttpd-dev

git clone https://github.com/Motion-Project/motion.git
patch -p1 -d motion < enable-h264-omx-codec.patch

cd motion
autoreconf -fiv
./configure
make
make install

`pi@raspberrypi:~$ patch -p1 -d FFmpeg < disable-rpi-omx-input-zerocopy.patch
-bash: disable-rpi-omx-input-zerocopy.patch: No such file or directory

pi@raspberrypi:~$ patch -p1 -d FFmpeg < 0001-avcodec-omx-Fix-handling-of-fragmented-buffers.patch
-bash: 0001-avcodec-omx-Fix-handling-of-fragmented-buffers.patch: No such file or directory`

Do you have a full explanation please ?

@zagrim
Copy link
Collaborator

zagrim commented Aug 28, 2019

@Saku241 Did you download the patches (links given by @jasaw in a couple of comments up)? You need to have those present to be able to apply them :)

@Saku241
Copy link

Saku241 commented Aug 28, 2019

@zagrim Where I suppose to place them ?
Anyone got a full instruction for Raspberry Pi 3 ?

@zagrim
Copy link
Collaborator

zagrim commented Aug 28, 2019

@Saku241 If you want to use the given instructions 1:1 (copy-paste), then you need to place the patch files in the parent directory of the cloned repos, which would seem to mean the home dir of the "pi" user.
In case command line is not your friend, you should execute these commands after running the first git clone command:

wget https://github.com/ccrisan/motioneyeos/blob/master/package/ffmpeg/disable-rpi-omx-input-zerocopy.patch
wget https://trac.ffmpeg.org/raw-attachment/ticket/7687/0001-avcodec-omx-Fix-handling-of-fragmented-buffers.patch
wget https://github.com/ccrisan/motioneyeos/blob/master/package/motion/enable-h264-omx-codec.patch

@Saku241
Copy link

Saku241 commented Aug 28, 2019

@zagrim Thank you for everything,
all is working but now the "h264/omx" is gone :/
image

Edit : I think it broke my MotionEye because now when it detects motion it start recording but dont stop
Here's my log : https://pastebin.com/raw/Um7BcRVQ

@jasaw
Copy link
Contributor

jasaw commented Aug 29, 2019

@Saku241 Sorry, my bad, I left out --enable-mmal --enable-omx --enable-omx-rpi in the ffmpeg configure stage. I've also updated my post above to include the enable lines. I was expecting the configure script to pick it up automatically, but it obviously did not. Let's hope it can pick up the dependencies. Let us know if it doesn't.

After you ran configure, compiled and installed ffmpeg, check whether h264_omx is supported by running this command: ffmpeg -encoders | grep omx. You should get the below line if it's supported.

V..... h264_omx OpenMAX IL H.264 video encoder (codec h264)

@Saku241
Copy link

Saku241 commented Aug 29, 2019

@Saku241 Sorry, my bad, I left out --enable-mmal --enable-omx --enable-omx-rpi in the ffmpeg configure stage. I've also updated my post above to include the enable lines. I was expecting the configure script to pick it up automatically, but it obviously did not. Let's hope it can pick up the dependencies. Let us know if it doesn't.

After you ran configure, compiled and installed ffmpeg, check whether h264_omx is supported by running this command: ffmpeg -encoders | grep omx. You should get the below line if it's supported.

V..... h264_omx OpenMAX IL H.264 video encoder (codec h264)

pi@raspberrypi:~/FFmpeg $ ./configure --enable-mmal --enable-omx --enable-omx-rpi
ERROR: OMX_Core.h not found

If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.

Edit : fixed with sudo apt-get install libomxil-bellagio-dev
but now I got a strange green line on my videos :
image

@jasaw
Copy link
Contributor

jasaw commented Aug 29, 2019

Just a heads up: after 2 years, zerocopy problem has finally been fixed in ffmpeg. Now it doesn't force enable zerocopy on RPi builds anymore, instead allows applications to disable zerocopy. See FFmpeg/FFmpeg@23a3e14

What this means is, ffmpeg master is in a mess right now, and in a broken state that has the green line across the screen. I've updated my instructions above, which works for me.

@Saku241
Copy link

Saku241 commented Aug 29, 2019

Just a heads up: after 2 years, zerocopy problem has finally been fixed in ffmpeg. Now it doesn't force enable zerocopy on RPi builds anymore, instead allows applications to disable zerocopy. See FFmpeg/FFmpeg@23a3e14

What this means is, ffmpeg master is in a mess right now, and in a broken state that has the green line across the screen. I've updated my instructions above, which works for me.

Alright, everything seems working now, no more green line but I got a problem when a file is recorded, it creates the video and a 262bytes file here :
image

that contain this :
image
I got this from motion.log
aoû 29 15:36:29 raspberrypi motion[310]: Not starting motion daemon, disabled via /etc/default/motion ... (warning).

@jasaw
Copy link
Contributor

jasaw commented Aug 29, 2019

@Saku241 Very odd. Make sure you don't have 2 instances of motion or motioneye running? I don't see this problem on my Pi.

@Saku241
Copy link

Saku241 commented Aug 29, 2019

@jasaw working fine now
This happen only when continuous recording is on, it doesnt happen in motion dectection

@takiainen
Copy link

takiainen commented Sep 10, 2019

@jasaw thanks for your instructions, I got my motionEYE framerate up to pretty decent levels (20-30fps or so). I am running motioneye on latest Rasbian (raspberry pi 4 4gb). Had only 2-3fps before. Same with my raspberry pi3B.

Only difference I did (regarding your instructions), I installed ffmpeg 4.2.1 instead of 4.2.

But now there's another problem --> those green lines appear in nearly every video. Is there any solution to this?

@jasaw
Copy link
Contributor

jasaw commented Sep 10, 2019

As far as I know, the latest working ffmpeg version is 4.2. Anything newer has the green line over the video. My suggestion is to stick to version 4.2.

@noliveleger
Copy link

@jasaw: Ok thank you for the explanation.
I thought, it wouldn't enter the if condition because of these line:

Thank you for the help, I'll compile the FFMPEG 4.2.

@dragonflyuk
Copy link

I have had this same issue with Blacklisted OMX on a pi3b+ under raspbian buster. I have used script kindly posted half way through the issue, however now my recordings all have the yellow\green stripe. Despite running ffmpeg v4.2

Any help anyone??

@sorcer1122
Copy link

# Compile and install FFmpeg from source

sudo apt-get update -qq && sudo apt-get -y install \
  autoconf \
  automake \
  build-essential \
  cmake \
  git-core \
  libass-dev \
  libfreetype6-dev \
  libsdl2-dev \
  libtool \
  libva-dev \
  libvdpau-dev \
  libvorbis-dev \
  libxcb1-dev \
  libxcb-shm0-dev \
  libxcb-xfixes0-dev \
  pkg-config \
  texinfo \
  wget \
  zlib1g-dev \
  libx264-dev

sudo apt-get install libavformat-dev libavcodec-dev libavutil-dev libswscale-dev libavdevice-dev

wget https://ffmpeg.org/releases/ffmpeg-4.2.tar.bz2
tar xf ffmpeg-4.2.tar.bz2
wget https://raw.githubusercontent.com/ccrisan/motioneyeos/master/package/ffmpeg/disable-rpi-omx-input-zerocopy.patch
wget https://trac.ffmpeg.org/raw-attachment/ticket/7687/0001-avcodec-omx-Fix-handling-of-fragmented-buffers.patch
patch -p1 -d ffmpeg-4.2 < 0001-avcodec-omx-Fix-handling-of-fragmented-buffers.patch
patch -p1 -d ffmpeg-4.2 < disable-rpi-omx-input-zerocopy.patch

cd ffmpeg-4.2
./configure --enable-mmal --enable-omx --enable-omx-rpi --extra-cflags=-I/opt/vc/include/IL
make
make install
cd -



# Compile and install motion from source

sudo apt-get install autoconf automake pkgconf libtool libjpeg8-dev build-essential libzip-dev gettext libmicrohttpd-dev

git clone https://github.com/Motion-Project/motion.git
cd motion
git checkout ff903de2e3d6320f13841a91e4080c1220c38059
wget https://raw.githubusercontent.com/jasaw/motioneyeos/motion-disable-omx-zerocopy/package/motion/2000-disable-zerocopy-via-avoptions.patch
patch -p1 -d . < 2000-disable-zerocopy-via-avoptions.patch
wget https://raw.githubusercontent.com/jasaw/motioneyeos/motion-disable-omx-zerocopy/package/motion/enable-h264-omx-codec.patch
patch -p1 -d . < enable-h264-omx-codec.patch

autoreconf -fiv
./configure
make
make install

I am also struggling with 0.1 FPS when streaming, so tried this. Got an error - ERROR: mmal not found
I have got the latest dietPi OS. I would appreciate if someone can help me how to fix it? Tried to google and did not find any solution. Thanks

@starbasessd
Copy link

Did you try RaspberryPiOS Lite? (2020-08-20)
Have you tried motionEyeOS dev20201026 or 20200203>

@sorcer1122
Copy link

Did you try RaspberryPiOS Lite? (2020-08-20)
Have you tried motionEyeOS dev20201026 or 20200203>

Not Yet. I am waiting for a microSD replacement, so will give it a go once I get it. Thanks!

@sorcer1122
Copy link

Did you try RaspberryPiOS Lite? (2020-08-20)
Have you tried motionEyeOS dev20201026 or 20200203>

Many thanks, Raspbian Lite worked like a charm!

@starbasessd
Copy link

@sorcer1122 Glad to help.

@sorcer1122
Copy link

ok FPS improved a little bit but the CPU use is terrible. 'top' command shows that motion uses 381% of the CPU :(

@starbasessd
Copy link

starbasessd commented Nov 29, 2020 via email

@starbasessd
Copy link

starbasessd commented Nov 29, 2020 via email

@sorcer1122
Copy link

All I need is to save streams from 4 cameras in good quality to an external hard drive. Maybe switching streaming off will improve the performance. Will play with it.

@starbasessd
Copy link

starbasessd commented Nov 29, 2020 via email

@cap9qd
Copy link

cap9qd commented Nov 29, 2020 via email

@starbasessd
Copy link

starbasessd commented Nov 29, 2020 via email

@Norgus
Copy link

Norgus commented Jan 17, 2021

Does this issue mean that if I have the latest motioneye installed and am selecting h264_omx encoding from the drop-down in the interface, it is in fact not using GPU encoding?

If so, that seems somewhat misleading. Will this topic be updated when it's been fixed in a release?

@zagrim
Copy link
Collaborator

zagrim commented Jan 20, 2021

@Norgus you are correct, h264_omx is being substituted with h264 in the background. MotionEye does check in OMX is being supported but it is done by querying for the codec's availability in ffmpeg (just as for any other codecs one might do), but since it is Motion which has the blacklisting and substitution functionality added for OMX, there's no way MotionEye could know if OMX is really in use or not.

Because getting h264_omx to be available AND usable requires both a changed version of ffmpeg (to fix the bug that caused the codec to be blacklisted) as well as motion (to remove the blacklisting), I don't think there's currently any setup that you could download which would include both. No release of MotionEye alone will resolve that ever, since MotionEye as a standalone application doesn't come with neither ffmpeg or motion (you need to install those somehow yourself, as told in the installation instructions.
MotionEyeOS, on the other hand, by being a full operating system with all required things included to get ME running, could include patched versions of ffmpeg and motion, but that should be asked from MotionEyeOS project (https://github.com/ccrisan/motioneyeos)

@Avessalom608
Copy link

Avessalom608 commented Apr 3, 2022

@jasaw Please tell me what could be the problem

 pi@raspberrypi:~/motion $ 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.

Version: 4.2.2
Platform: Linux (if this is incorrect, please read README.FreeBSD)

Compiling Motion object files...
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Motion object files compiled.

Linking Motion...
--------------------------------------------------------------------------------
gcc  -o motion motion.o logger.o conf.o draw.o jpegutils.o video_loopback.o video_v4l2.o video_common.o video_bktr.o netcam.o netcam_http.o netcam_ftp.o netcam_jpeg.o netcam_wget.o track.o alg.o event.o picture.o rotate.o translate.o webu.o webu_html.o webu_text.o webu_stream.o stream.o md5.o netcam_rtsp.o ffmpeg.o  -lm  -pthread -ljpeg -lmicrohttpd    -L/usr/local/lib -lavdevice -lm -lavfilter -pthread -lm -lswscale -lm -lavformat -lm -lz -lavcodec -lm -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host -lz -ldl -pthread -lswresample -lm -lavutil -pthread -lm
/usr/bin/ld: logger.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: conf.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: conf.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: draw.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: jpegutils.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: jpegutils.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: video_loopback.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: video_loopback.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: video_v4l2.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: video_v4l2.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: video_common.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: video_common.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: video_bktr.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: video_bktr.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: netcam.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: netcam.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: netcam_http.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: netcam_http.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: netcam_ftp.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: netcam_ftp.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: netcam_jpeg.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: netcam_jpeg.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: netcam_wget.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: track.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: track.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: alg.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: event.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: event.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: picture.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: picture.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: rotate.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: rotate.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: translate.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: translate.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: webu.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: webu.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: webu_html.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: webu_html.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: webu_text.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: webu_text.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: webu_stream.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: webu_stream.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: stream.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: stream.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: netcam_rtsp.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: netcam_rtsp.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
/usr/bin/ld: ffmpeg.o:/home/pi/motion/netcam.h:119: multiple definition of `caps'; motion.o:/home/pi/motion/netcam.h:119: first defined here
/usr/bin/ld: ffmpeg.o:/home/pi/motion/translate.h:13: multiple definition of `nls_enabled'; motion.o:/home/pi/motion/translate.h:13: first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:113: motion] Error 1

@chetbox
Copy link

chetbox commented Apr 3, 2022

I’m not sure what the exact problem is here but, if it helps, I have an example of compiling Motion for Raspberry Pi (Zero v1.1 in this case) using h264_omx hardware acceleration: https://github.com/chetbox/SafariCam/blob/main/motion/Dockerfile

CPU usage when encoding video is very low. 👍

@MichaIng
Copy link
Member

MichaIng commented Apr 3, 2022

Best is always to follow the official documentation: https://motion-project.github.io/motion_build.html
Otherwise you may ask at the Motion GitHub: https://github.com/Motion-Project/motion/issues

Also I suggest compiling v4.3.2, the latest one fully supported by motionEye.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests