Motion - Support Question 2007x 06x 27x 185737

motion: symbol lookup error: motion: undefined symbol: av_init_packet

Question

Hi,

Motion runs just fine, but when it detects movement I get the following and motion terminates:

motion: symbol lookup error: motion: undefined symbol: av_init_packet

I'm using motion 3.2.7 on Fedora FC7

Can you help!?

Thanks

Paste in your error messages, config settings, terminal window output etc in this text field.

Environment

Motion version: 3.2.7
ffmpeg version: SVN-r9431
Libraries: ffmpeg, mysql, postgresql
Server OS: FC7

-- ChrisHarris - 27 Jun 2007

Follow Up

How did you compile ffmpeg ? i think you follow the FAQ .

Seems that motion cannot load shared libraries , so maybe you didn't setup properly ffmpeg shared libraries ( ldconfig and ld.so.conf could help you).

Anyway try to upgrade to http://www.lavrsen.dk/twiki/bin/view/Motion/MotionRelease3x2x8beta1 and reproduce your problem .

-- AngelCarpintero - 28 Jun 2007

Answer

It is a real problem. I also get it with a recent SVN checkout of ffmpeg.

Those suckers has changed API again.

Bloody amateurs. The ffmpeg developers are a bunch of kids. Not making proper releases cause this pain again and again.

If I could find an alternative to ffmpeg I would change Motion to the alternative.

-- KennethLavrsen - 19 Jul 2007

I have investigated this a bit

The change in ffmpeg that causes the touble is

# svn diff -r9210:9212
Index: libavformat/avformat.h
===================================================================
--- libavformat/avformat.h      (revision 9210)
+++ libavformat/avformat.h      (revision 9212)
@@ -56,17 +56,12 @@
  */
 void av_destruct_packet(AVPacket *pkt);

-/* initialize optional fields of a packet */
-static inline void av_init_packet(AVPacket *pkt)
-{
-    pkt->pts   = AV_NOPTS_VALUE;
-    pkt->dts   = AV_NOPTS_VALUE;
-    pkt->pos   = -1;
-    pkt->duration = 0;
-    pkt->flags = 0;
-    pkt->stream_index = 0;
-    pkt->destruct= av_destruct_packet_nofree;
-}
+/**
+ * Initialize optional fields of a packet to default values.
+ *
+ * @param pkt packet
+ */
+void av_init_packet(AVPacket *pkt);

 /**
  * Allocate the payload of a packet and intialized its fields to default values.
Index: libavformat/utils.c
===================================================================
--- libavformat/utils.c (revision 9210)
+++ libavformat/utils.c (revision 9212)
@@ -176,6 +176,17 @@
     pkt->data = NULL; pkt->size = 0;
 }

+void av_init_packet(AVPacket *pkt)
+{
+    pkt->pts   = AV_NOPTS_VALUE;
+    pkt->dts   = AV_NOPTS_VALUE;
+    pkt->pos   = -1;
+    pkt->duration = 0;
+    pkt->flags = 0;
+    pkt->stream_index = 0;
+    pkt->destruct= av_destruct_packet_nofree;
+}
+
 int av_new_packet(AVPacket *pkt, int size)
 {
     uint8_t *data;

So they moved the code from libavformat/avformat.h to libavformat/utils.c and replaced it by a function prototype in avformat.h

That all seems pretty OK. So why does Motion barf the minute it needs to use ffmpeg after this change?

One difference is that the declaration changed from static inline void to just void

But in my text book that should mean that it should be invisible outside the file before and now should be visible. Strange.

I keep on searching. If anyone has inputs be welcome..

-- KennethLavrsen - 22 Jul 2007

I know why now. And it is me who fooled around.

When I uninstalled the ffmpeg rpm I uninstalled the ffmpeg and ffmpeg-devel. I had forgotten that I also had installed an rpm called ffmpeg-libs. So now I ended up with Motion being built from a header file from the latest ffmpeg SVN and a library .so file from the rpm.

Once I had removed the ffmpeg-libs and run ldconfig again and rebuilt Motion again it all works.

So Motion works fine with SVN 9778 2007-07-22 17:59:10 which is good.

Things would be so much easier if ffmpeg was being released now and then so we all run with a stable known version instead of this mess.

So to answer Chris. You probably have same problem.

Try ldconfig -p

Does it tell you that is knows where to find libavformat? Like libavformat.so (libc6) => /usr/local/lib/libavformat.so

And is this where it is expected to be?

If it points to /usr/lib/libavformat.so and you built ffmpeg in /usr/local/ffmpeg as suggested in the Motion Guide then you probably have some ffmpeg package installed that you do not know about.

Then I propose you stay with the rpm so your other programs that depend on ffmpeg still will work. Install the packages ffmpeg and ffmpeg-devel from Livna and try to rebuild Motion.

-- KennethLavrsen - 22 Jul 2007

 

SupportForm edit

TopicTitle motion: symbol lookup error: motion: undefined symbol: av_init_packet
SupportStatus AnsweredQuestions
AssignedQuestionTo
SubmittedBy ChrisHarris
Topic revision: r5 - 22 Jul 2007, KennethLavrsen
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.