undefined reference to `swr_(several)

Forum for questions and support relating to the 1.28.x releases only.
Locked
liderbug
Posts: 125
Joined: Wed Dec 19, 2007 4:46 pm

undefined reference to `swr_(several)

Post by liderbug »

Building 28 on an ARMV7l Fedora 22 machine. After about 27 times I was able to get cmake to run cleanly. After several dnf install xyz, some apt-get. One thing missing was ffmpeg which I downloaded and built and did make install. So after cmake ran to success I did make and it runs up to:
[ 71%] Building CXX object src/CMakeFiles/zm.dir/zm_zone.cpp.o
[ 73%] Linking CXX static library libzm.a
[ 73%] Built target zm
Scanning dependencies of target nph-zms
[ 75%] Building CXX object src/CMakeFiles/nph-zms.dir/zms.cpp.o
[ 77%] Linking CXX executable nph-zms
/usr/local/lib/libavcodec.a(opusdec.o): In function `opus_decode_subpacket':
/home/cal/Downloads/ffmpeg-2.8.3/libavcodec/opusdec.c:379: undefined reference to `swr_is_initialized'
/usr/local/lib/libavcodec.a(opusdec.o): In function `opus_decode_frame':
/home/cal/Downloads/ffmpeg-2.8.3/libavcodec/opusdec.c:220: undefined reference to `swr_is_initialized'
/usr/local/lib/libavcodec.a(opusdec.o): In function `opus_init_resample':
<snip>
src/CMakeFiles/nph-zms.dir/build.make:108: recipe for target 'src/nph-zms' failed
make[2]: *** [src/nph-zms] Error 1
CMakeFiles/Makefile2:131: recipe for target 'src/CMakeFiles/nph-zms.dir/all' failed
make[1]: *** [src/CMakeFiles/nph-zms.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
src/CMakeFiles/nph-zms.dir/build.make:108: recipe for target 'src/nph-zms' failed
make[2]: *** [src/nph-zms] Error 1
CMakeFiles/Makefile2:131: recipe for target 'src/CMakeFiles/nph-zms.dir/all' failed
make[1]: *** [src/CMakeFiles/nph-zms.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
===========================

A. I did "make install" on ffmpeg and it went without problem but during ZM cmake it says:
/home/cal/Downloads/ffmpeg-2.8.3/libavcodec/opusdec.c:379:...
which is my compile in my home directory - so I'm confused there.

B. Googleing for undefined reference to `swr_ returns a few problems: 1 said it's a bad configure.ac with LDFLAGS should be LIBS but that was 4 years old - and didn't change anything. Another said to add libva - I did, no change.

I'm at Witt's End.
Thanks for any help.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: undefined reference to `swr_(several)

Post by asker »

I remember facing similar issues several months ago.
I think I solved it by adding both -lva and -lswresample. I think your problem may be swresample.

BTW, I think there are ready made packages for your system at http://zmrepo.zoneminder.com which should do away the need for a source compile
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
liderbug
Posts: 125
Joined: Wed Dec 19, 2007 4:46 pm

Re: undefined reference to `swr_(several)

Post by liderbug »

Found that fix on the web (-lva & swr) - nope. The canned package is 25 and I can't get it to work. I'm thinking that maybe my compile of ffmpeg has an error - /usr/local/lib/libavcodec.a contains and points to "my" home dir where I compiled it. (note zm make errors).

Anyhow I'm thinking - compile 28, add my own debug lines and maybe find the problem.

Semiaside: fswebcam -d /dev/video0 -p UYVU - > cam.jpg give me a nice image.

slog, slog, slog ...
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: undefined reference to `swr_(several)

Post by knight-of-ni »

Why are you doing this the hard way?
ZoneMinder rpms are available for armv7 architecture on zmrepo:
http://zmrepo.zoneminder.com/

Make sure you uninstall your prior attempts to build zoneminder, ffmpeg, vlc, and anything else.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
liderbug
Posts: 125
Joined: Wed Dec 19, 2007 4:46 pm

Re: undefined reference to `swr_(several)

Post by liderbug »

Took your advice and went to zmrepo. I question your "... the hard way?".
rpm zoneminder...
needs abc, ftp abc rpm abc
needs def, ghi, jkl, ftp def, rpm
def need def.a, def.b, def.c ... def.p <sigh> ftp def.a, rpm, def.a need
I now have a subdir with 56 xyz.rpm file
I wrote the following, would search fpmfind for the right rpm and past the link
./omt ftp://rpmfind.net....[file].rpm

Code: Select all

#!/bin/bash
url="$1"
f=`basename $1`
curl "$url" > $f
rpm -ivhl $f
The last rpm -i zoneminder..28... ran and popped up README
localhost/zm works
probe found my usb camer
The logs say Monitor-1: 11000 - Capturing at 7.52 fps
The image is ... no image, so I've got some config'er'n to do.
<slog><slog><slog>...
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: undefined reference to `swr_(several)

Post by knight-of-ni »

If you think you need to search rpmfind for some package, then you've done something very wrong.
You need to be specific with describing your output if you want specific help.

You have to have a clean system. Uninstall everything you attempted to install previously, then add the zmrepo repository per the instructions. All you do is "sudo yum install zoneminder" then zonemidner, and all its dependencies will be installed. It can't get any easier.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
liderbug
Posts: 125
Joined: Wed Dec 19, 2007 4:46 pm

Re: undefined reference to `swr_(several)

Post by liderbug »

My system is an OrangePi (armv7l) with Fedora-22. dnf install zoneminder - installs 25. But I've got ZM working 99% - it's running, source is green, it's detecting, it's recording - it's not showing any images. The only image I can get is via "Show Timeline". Google hasn't been any help.

lsusb: Z-Star Microelectronics Corp. Venus USB2.0 Camera
zmu -d /dev/video0 -q -v
Video Device: /dev/video0
General Capabilities
Driver: uvcvideo
Card: Venus USB2.0 Camera
Bus: usb-sunxi-ehci-1
Version: 1.1.1
Type: 0x4000001
Supports video capture (X)
Supports streaming i/o (X)
Standards:
Formats:
YUV 4:2:2 (YUYV) (YUYV)
MJPEG (MJPG)
Crop Capabilities
Cropping is not supported
Inputs: 1
Input 0
Name: Camera 1
Type: Camera
Audioset: 00000000
Standards: 0x0
Power on (X)
Signal detected (X)
Colour Signal detected
Horizontal Lock detected
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: undefined reference to `swr_(several)

Post by knight-of-ni »

The fact that you got ZoneMinder "working" using an un-verified procedure means the potential is there for that to come back and bite you. I'm not trying to beat you over the head with this, but merely pointing out we may have to come back to this.

You mentioned the obsolete ZoneMinder 1.25 package in the Fedora 22 repository. Are you saying that is the version you are currently using? If you are, then we need to get you on the latest release, 1.28.1. ZoneMinder 1.25 is EOL and was written by a different developer.

That is good that zmu outputs useful info. That means the driver is set up right. However, we need to see how you programmed the camera in your monitor config. In particular, the resolution you enter into ZoneMinder has to match the resolution of the stream the camera is sending, exactly.

Another bit of information we need is your ZoneMinder log file. We need to know what ZoneMinder is telling us. More is better.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
liderbug
Posts: 125
Joined: Wed Dec 19, 2007 4:46 pm

Re: undefined reference to `swr_(several)

Post by liderbug »

Thanks for the response. I removed 25 (the version from dnf install). Then I went to "zmrepo" and started rpming (Oooo new word) ... requires... I'm thinking my copy of Fedora-22 might be a little light as in OS only - OH, you want tires on that new car??

The image grab is working because I'm getting events (10 so far). I can prove that by moving IE. 00266-capture.jpg to /v/w/html and viewing it in my browser and vlc and... When I open the console I'm green, I click on Events, get the list, click on an event and it pops up with all the controls - sans image, not even a "busted" icon. If I open Timeline I get good images. I get this when I try to view an event (zm stopped)
2015-12-01 07:31:39.778343 web_js 7067 WAR Adjusting to minimum height when getting popup size for tag 'event' - getPopupSize() ?view=timeline
2015-12-01 07:31:39.324121 web_js 23990 ERR getCmdResponse stream error: socket_sendto( /var/lib/zoneminder/sock/zms-399253s.sock ) failed: No such file or directory - checkStreamForErrors() ?view=event
2015-12-01 07:31:38.820222 web_php 23990 ERR socket_sendto( /var/lib/zoneminder/sock/zms-399253s.sock ) failed: No such file or directory /usr/share/zoneminder/www/includes/functions.php 2330
2015-12-01 07:31:28.530219 web_php 7516 ERR socket_sendto( /var/lib/zoneminder/sock/zms-749420s.sock ) failed: No such file or directory /usr/share/zoneminder/www/includes/functions.php 2330
2015-12-01 07:31:16.759897 web_php 7662 ERR socket_sendto( /var/lib/zoneminder/sock/zms-050827s.sock ) failed: No such file or directory /usr/share/zoneminder/www/includes/functions.php 2330
2015-12-01 07:31:06.513851 web_js 7662 WAR Adjusting to minimum width when getting popup size for tag 'event' - getPopupSize() ?view=timeline
2015-12-01 07:31:05.854131 web_js 7662 WAR Adjusting to minimum height when getting popup size for tag 'event' - getPopupSize() ?view=timeline
2015-12-01 07:31:05.554729 web_js 7067 WAR Adjusting to minimum width when getting popup size for tag 'event' - getPopupSize() ?view=timeline
2015-12-01 07:31:04.920667 web_js 7516 WAR Adjusting to minimum height when getting popup size for tag 'event' - getPopupSize() ?view=timeline
2015-12-01 07:31:04.722860 web_js 7516 WAR Adjusting to minimum width when getting popup size for tag 'event' - getPopupSize() ?view=timeline

When Running I have zmdc.sock in the right subdir but view=event give me a sock err.
I'm trying to debug.
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: undefined reference to `swr_(several)

Post by knight-of-ni »

I do all my armv7 development on a Raspberry Pi 2. It currently has Fedora 22 installed on it, using a base image I got from the Fedora thread on the Raspberry Pi forum.

https://www.raspberrypi.org/forums/view ... p?t=101027

I have not seen any other ways to get Fedora on the Pi so perhaps you installed Fedora on the Pi the same way I did.

I started out with Fedora 21 and then upgraded it to Fedora 22. Now that Fedora 23 is out, at some point in the near future I am going to upgrade again.

When I build, I use mock, which creates a clean chroot environment. If there were any packages that mock could not find automatically from the Fedora and zmrepo repo's, then the ZoneMinder package would simply not build, and I would know about it.

If your attempt to install ZoneMinder required you to get packages that were not in zmrepo and were not in the base Fedora repo, then I'd really like to know what those packages were.

But on to the log information you posted.....
Since you are getting events, that means the backend is working (+1), and in this case those socket_sendto errors almost certainly mean you have an Apache configuration problem. Make sure the Script Alias in the config file agrees with PATH_ZMS under options. You also need to verify you have followed step 7 from the README:
7. IMPORTANT: Edit /etc/httpd/conf.d/zoneminder.conf and/or
/etc/httpd/conf/httpd.conf.

The httpd.conf file included with this version of Fedora processes the conf.d
folder after the default ScriptAlias directive in the httpd.conf file.
Previously, the conf.d folder was processed before the default ScriptAlias
directive. This causes a ScriptAlias overlap and breaks Zoneminder's
streaming abilities.

Reference: http://httpd.apache.org/docs/2.4/mod/mo ... html#order
Bug Report: https://bugzilla.redhat.com/show_bug.cgi?id=973067

WORKAROUND #1
If you are running zoneminder on a dedicated server then the simplest
solution may be to simply comment out the line in httpd.conf that reads:

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

WORKAROUND #2
If you need both the default cgi-bin folder & the zoneminder cgi-bin folder
then a solution might be to move the following line before the default
ScriptAlias directive in the httpd.conf file:

IncludeOptional conf.d/*.conf
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
liderbug
Posts: 125
Joined: Wed Dec 19, 2007 4:46 pm

Re: undefined reference to `swr_(several)

Post by liderbug »

Thanks, will get to Apache/etc later.
OrangePi http://www.aliexpress.com/wholesale?cat ... ange+pi+pc

$18.51 inc shipping. 1.6Ghz, Quad core, 1Meg mem
vs RasPi 2 quad core @ 900Mhz for $40

Thought I try it - eh... $15 - drop that on beer Fri nights.... or pizza for a Sunday football on TV (American) - Go Broncos.

Fedora - http://www.orangepi.org/orangepibbsen/f ... ad&tid=342
( I think the web site is via a 19.2 modem...)
loboris (his handle) has built several loads for the OPI and put them on GoogleDrive & Mega. Note: I had problems with the GD dl's, ended up with Mega's F22.

I have 2 RPI's (A&B+) and they're alright but the OPI seems ... snapper (?), in fact a lot faster.

Looking ahead - Once I get this working 100% - how would I bundle for a dnf or apt-get package - would be my first.
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: undefined reference to `swr_(several)

Post by knight-of-ni »

Zmrepo already does all that for you.
It bundles zoneminder and all its dependencies so all you have to do is "dnf install zoneminder" to get zoneminer 1.28.1 and all its dependencies installed for you, automatically.

If that isn't working, then you need to post exactly what dnf is complaining about in order to get any further.

I checked the Fedora 22 Minimal Image from the orangepi site you linked. That image is pulling its base packages directly from Fedora (/etc/yum.repos.d/fedora.repo) and not a third party, so you should not have any package problems.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: undefined reference to `swr_(several)

Post by knight-of-ni »

Maybe this will help. Here is a Youtube video showing how to install ZoneMinder using zmrepo and programming one ip camera in just over 8 minutes:
https://www.youtube.com/watch?v=l2lLvl8WxfU

This video installs ZoneMinder on x86_64 architecture running CentOS 6. However, the steps are no different for the Fedora distro on armv7 architecture.

Notice I am literally copying and pasting the necessary commands from the instructions directly into a browser window.
Since making this video, I have moved these instructions from the ZoneMinder wiki to the zmrepo.zoneminder.com site.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
liderbug
Posts: 125
Joined: Wed Dec 19, 2007 4:46 pm

Re: undefined reference to `swr_(several)

Post by liderbug »

Let me try this reply OneMoreTime - I was so tired last night I typed it up and hit the wrong button and POOF! So.... I called it a night.

Nice video, thanks. I think that exactly what I did. I "erase"d everything and went through the zmrepo page in a See-Spot-Run mode. So one of the things I've tried is to put some debug in stream.php. I've found that it creates a socket zms.######w.sock and it shows up in the sock subdir - for about 2 seconds and goes away. Everything I find on the web says it's an Apache config problem - in fact I found a post I made 4 years ago, same problem, solved by removing "ScriptAlias" from the zoneminder.conf. Not fixing now.

<about an hour+ later>
[SOLVED ... well sort of...]
httpd/error_log had "script not found or unable to stat: /var/www/cgi-bin/zm" with or without the ScriptAlias in zoneminder.conf. and httpd.conf has "IncludeOptional conf.d/*.conf".
So I copied nph-zms zms to /var/www/cgi-bin/zm/... and TA-DA Life-R-Good!

Hmmm should the apache Include be the full path /etc/httpd/conf.d/*.conf ????? I'll try if I get time.
[ later...] Nope.

Thanks for the support - av'a beer on me.
Locked