ffmpeg problem [SOLVED]

Forum for questions and support relating to the 1.24.x releases only.
liviab
Posts: 87
Joined: Wed Oct 15, 2008 11:54 am
Location: Brazil [MG]

ffmpeg problem [SOLVED]

Post by liviab »

Hii!!

I'm having problem with ffmpeg. I have it installed at /usr/include/ffmpeg.
(The directories libavformat, libavutil, and so on, are at /usr/include/ffmpeg/include).
I'm doing:

./configure --with-webdir=/var/www/html/zm --with-cgidir=/var/www/cgi-bin --with-ffmpeg=/usr/include/ffmpeg ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zmuser ZM_DB_PASS=zmpass --enable-debug=yes

I'm getting:

...
checking for ffmpeg... yes
checking for ffmpeg... /usr/bin/ffmpeg
checking for pnmscale... no
checking for pnmscale... no
...
checking libavutil/avutil.h usability... no
checking libavutil/avutil.h presence... no
checking for libavutil/avutil.h... no
checking ffmpeg/avutil.h usability... no
checking ffmpeg/avutil.h presence... no
checking for ffmpeg/avutil.h... no
checking libavcodec/avcodec.h usability... no
checking libavcodec/avcodec.h presence... no
checking for libavcodec/avcodec.h... no
checking ffmpeg/avcodec.h usability... no
checking ffmpeg/avcodec.h presence... no
checking for ffmpeg/avcodec.h... no
checking libavformat/avformat.h usability... no
checking libavformat/avformat.h presence... no
checking for libavformat/avformat.h... no
checking ffmpeg/avformat.h usability... no
checking ffmpeg/avformat.h presence... no
checking for ffmpeg/avformat.h... no
checking libswscale/swscale.h usability... no
checking libswscale/swscale.h presence... no
checking for libswscale/swscale.h... no
checking ffmpeg/swscale.h usability... no
checking ffmpeg/swscale.h presence... no
checking for ffmpeg/swscale.h... no
checking pcre/pcre.h usability... no
checking pcre/pcre.h presence... no
checking for pcre/pcre.h... no
...

The makefile is generated. When I do "make", I get:

...
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include/ffmpeg/include -Wall -Wno-sign-compare -fno-inline -frepo -g -O2 -MT zmc.o -MD -MP -MF .deps/zmc.Tpo -c -o zmc.o zmc.cpp
In file included from zm_mpeg.h:23,
from zm_stream.h:27,
from zm_event.h:39,
from zm_zone.h:27,
from zm_monitor.h:27,
from zmc.cpp:28:
zm_ffmpeg.h:33:2: error: #error "No location for avutils.h found"
zm_ffmpeg.h:40:2: error: #error "No location for avcodec.h found"
zm_ffmpeg.h:47:2: error: #error "No location for avformat.h found"
zm_ffmpeg.h:55:2: error: #error "No location for swscale.h found"
...

Why is it occuring? The ZoneMinder is search for the files in the wrong directory?
Am I doing something wrong?
:(
Last edited by liviab on Mon Dec 08, 2008 1:03 pm, edited 1 time in total.
nuck
Posts: 148
Joined: Tue Nov 11, 2008 1:43 am
Location: Canada

Post by nuck »

>> Am I doing something wrong?

Yup, you are. You've got your include directories all messed up. By default (if I'm not mistaken) ffmpeg will install it's header files into separate directories just where from the look of the output of your configure run, the configure script is looking for them.

Solution? Reinstall ffmpeg and allow it to put the headers in their default location, _or_ manually put the header files where (create the directories) the configure script expects to find them.

Secondly, until you get a clean configure run there is no point in trying to run make. Even if you do get a successful build it'll likely be broken anyway.
liviab
Posts: 87
Joined: Wed Oct 15, 2008 11:54 am
Location: Brazil [MG]

[resolved] ffmpeg problem

Post by liviab »

The ZoneMinder was searching for the files in a directory that they weren't. So I created links and it find them.

Thanks nuck!!
johnnytolengo
Posts: 184
Joined: Tue Oct 14, 2008 5:59 pm

which folder ?

Post by johnnytolengo »

Hi, could you explain me what do you exactly did?

It seems that zoneminder can't find that files as you wrote up here.

my question is, where is zoneminder searching for this files? in which folder?

thanks in advance.

J.
liviab
Posts: 87
Joined: Wed Oct 15, 2008 11:54 am
Location: Brazil [MG]

Post by liviab »

Hi Johnny,

I don't remember clearly how I did it, but I will try to help you.

Firstly, the ZoneMinder shows where it is searching the files during the beginning of the compilation, if I'm not wrong, in the first line:

g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include/ffmpeg/include -Wall -Wno-sign-compare -fno-inline -frepo -g -O2 -MT zmc.o -MD -MP -MF .deps/zmc.Tpo -c -o zmc.o zmc.cpp

About the link, I used the command ln. I created the folder include in the folder ffmpeg, and, after that, I created the links in this way:

ln -s /usr/include/ffmpeg/libavcodec /usr/include/ffmpeg/include

You have to create links to all folders that are in the folder ffmpeg (libavcodec, libavdevice, ....)

Try to do it and tell me if it works.

:wink:
johnnytolengo
Posts: 184
Joined: Tue Oct 14, 2008 5:59 pm

no way

Post by johnnytolengo »

I did the ln -s and i got the same, see you:

checking ffmpeg/avutil.h usability... no
checking ffmpeg/avutil.h presence... no
checking for ffmpeg/avutil.h... no
checking libavcodec/avcodec.h usability... yes
checking libavcodec/avcodec.h presence... yes
checking for libavcodec/avcodec.h... yes
checking ffmpeg/avcodec.h usability... no
checking ffmpeg/avcodec.h presence... no
checking for ffmpeg/avcodec.h... no
checking libavformat/avformat.h usability... yes
checking libavformat/avformat.h presence... yes
checking for libavformat/avformat.h... yes
checking ffmpeg/avformat.h usability... no
checking ffmpeg/avformat.h presence... no
checking for ffmpeg/avformat.h... no
checking libswscale/swscale.h usability... yes
checking libswscale/swscale.h presence... yes
checking for libswscale/swscale.h... yes
checking ffmpeg/swscale.h usability... no
checking ffmpeg/swscale.h presence... no
checking for ffmpeg/swscale.h... no
checking pcre/pcre.h usability... no
checking pcre/pcre.h presence... no


horrible BUUGG !! its the second day i am around it.

Thanks for you reply.

J.
liviab
Posts: 87
Joined: Wed Oct 15, 2008 11:54 am
Location: Brazil [MG]

Post by liviab »

But Johnny, did you stop the compilation because this no's? This is not an error. When you do make, does the compilation stop anytime?

Moreover, the ZoneMinder found the library files. These no's is because it searchs in two different places, and, in your case, it found it in one, but not in the other.
johnnytolengo
Posts: 184
Joined: Tue Oct 14, 2008 5:59 pm

recompilation

Post by johnnytolengo »

i got this errors with my MAKE:

make[2]: *** [zmc] Error 1
make[2]: Leaving directory `/usr/share/zoneminder/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/share/zoneminder'
make: *** [all] Error 2


thank you one more time.

J.
liviab
Posts: 87
Joined: Wed Oct 15, 2008 11:54 am
Location: Brazil [MG]

Post by liviab »

No, with this I can't get what happened.
Show me more lines.
:)
johnnytolengo
Posts: 184
Joined: Tue Oct 14, 2008 5:59 pm

so long

Post by johnnytolengo »

sorry :)

zm_signal.cpp: In function âvoid zm_die_handler(int, sigcontext)â:
zm_signal.cpp:112: warning: format not a string literal and no format arguments
zm_signal.cpp:112: warning: format not a string literal and no format arguments
zm_signal.cpp:126: warning: format not a string literal and no format arguments
mv -f .deps/zm_signal.Tpo .deps/zm_signal.Po
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include -frepo -g -O2 -MT zm_stream.o -MD -MP -MF .deps/zm_stream.Tpo -c -o zm_stream.o zm_stream.cpp
mv -f .deps/zm_stream.Tpo .deps/zm_stream.Po
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include -frepo -g -O2 -MT zm_thread.o -MD -MP -MF .deps/zm_thread.Tpo -c -o zm_thread.o zm_thread.cpp
mv -f .deps/zm_thread.Tpo .deps/zm_thread.Po
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include -frepo -g -O2 -MT zm_time.o -MD -MP -MF .deps/zm_time.Tpo -c -o zm_time.o zm_time.cpp
mv -f .deps/zm_time.Tpo .deps/zm_time.Po
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include -frepo -g -O2 -MT zm_timer.o -MD -MP -MF .deps/zm_timer.Tpo -c -o zm_timer.o zm_timer.cpp
mv -f .deps/zm_timer.Tpo .deps/zm_timer.Po
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include -frepo -g -O2 -MT zm_user.o -MD -MP -MF .deps/zm_user.Tpo -c -o zm_user.o zm_user.cpp
mv -f .deps/zm_user.Tpo .deps/zm_user.Po
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include -frepo -g -O2 -MT zm_utils.o -MD -MP -MF .deps/zm_utils.Tpo -c -o zm_utils.o zm_utils.cpp
mv -f .deps/zm_utils.Tpo .deps/zm_utils.Po
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include -frepo -g -O2 -MT zm_zone.o -MD -MP -MF .deps/zm_zone.Tpo -c -o zm_zone.o zm_zone.cpp
mv -f .deps/zm_zone.Tpo .deps/zm_zone.Po
g++ -frepo -g -O2 -L/usr/lib -L/usr/lib/mysql -o zmc zmc.o zm_box.o zm_buffer.o zm_camera.o zm_comms.o zm_config.o zm_coord.o zm.o zm_db.o zm_debug.o zm_event.o zm_exception.o zm_file_camera.o zm_ffmpeg_camera.o zm_image.o zm_jpeg.o zm_local_camera.o zm_monitor.o zm_ffmpeg.o zm_mpeg.o zm_poly.o zm_regexp.o zm_remote_camera.o zm_remote_camera_http.o zm_remote_camera_rtsp.o zm_rtp.o zm_rtp_ctrl.o zm_rtp_data.o zm_rtp_source.o zm_rtsp.o zm_signal.o zm_stream.o zm_thread.o zm_time.o zm_timer.o zm_user.o zm_utils.o zm_zone.o -lbz2 -lswscale -lavformat -lavcodec -lavutil -lpcre -lgnutls-openssl -lmysqlclient -lpthread -ldl -lz -ljpeg
collect: recompiling zm_utils.cpp
collect: recompiling zm_rtsp.cpp
zm_rtsp.cpp: In constructor âRtspThread::RtspThread(int, RtspThread::RtspMethod, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&)â:
zm_rtsp.cpp:183: warning: âAVFormatContext* av_alloc_format_context()â is deprecated (declared at /usr/local/include/libavformat/avformat.h:787)
zm_rtsp.cpp:183: warning: âAVFormatContext* av_alloc_format_context()â is deprecated (declared at /usr/local/include/libavformat/avformat.h:787)
collect: recompiling zm_thread.cpp
collect: recompiling zm_rtp_source.cpp
collect: recompiling zm_rtp_ctrl.cpp
collect: recompiling zm_monitor.cpp
collect: recompiling zm_local_camera.cpp
collect: recompiling zm_event.cpp
collect: recompiling zm_comms.cpp
collect: relinking
collect: recompiling zm_utils.cpp
collect: recompiling zm_rtsp.cpp
zm_rtsp.cpp: In constructor âRtspThread::RtspThread(int, RtspThread::RtspMethod, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&)â:
zm_rtsp.cpp:183: warning: âAVFormatContext* av_alloc_format_context()â is deprecated (declared at /usr/local/include/libavformat/avformat.h:787)
zm_rtsp.cpp:183: warning: âAVFormatContext* av_alloc_format_context()â is deprecated (declared at /usr/local/include/libavformat/avformat.h:787)
collect: recompiling zm_rtp_ctrl.cpp
collect: recompiling zm_monitor.cpp
collect: recompiling zm_event.cpp
collect: recompiling zm_comms.cpp
collect: relinking
collect: recompiling zm_utils.cpp
collect: recompiling zm_rtsp.cpp
zm_rtsp.cpp: In constructor âRtspThread::RtspThread(int, RtspThread::RtspMethod, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&)â:
zm_rtsp.cpp:183: warning: âAVFormatContext* av_alloc_format_context()â is deprecated (declared at /usr/local/include/libavformat/avformat.h:787)
zm_rtsp.cpp:183: warning: âAVFormatContext* av_alloc_format_context()â is deprecated (declared at /usr/local/include/libavformat/avformat.h:787)
collect: recompiling zm_monitor.cpp
collect: recompiling zm_event.cpp
collect: recompiling zm_rtp_ctrl.cpp
collect: recompiling zm_comms.cpp
collect: relinking
collect: recompiling zm_rtp_ctrl.cpp
collect: recompiling zm_monitor.cpp
collect: recompiling zm_rtsp.cpp
zm_rtsp.cpp: In constructor âRtspThread::RtspThread(int, RtspThread::RtspMethod, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&)â:
zm_rtsp.cpp:183: warning: âAVFormatContext* av_alloc_format_context()â is deprecated (declared at /usr/local/include/libavformat/avformat.h:787)
zm_rtsp.cpp:183: warning: âAVFormatContext* av_alloc_format_context()â is deprecated (declared at /usr/local/include/libavformat/avformat.h:787)
collect: recompiling zm_event.cpp
collect: recompiling zm_utils.cpp
collect: recompiling zm_comms.cpp
collect: relinking
collect: recompiling zm_utils.cpp
collect: recompiling zm_rtsp.cpp
zm_rtsp.cpp: In constructor âRtspThread::RtspThread(int, RtspThread::RtspMethod, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&)â:
zm_rtsp.cpp:183: warning: âAVFormatContext* av_alloc_format_context()â is deprecated (declared at /usr/local/include/libavformat/avformat.h:787)
zm_rtsp.cpp:183: warning: âAVFormatContext* av_alloc_format_context()â is deprecated (declared at /usr/local/include/libavformat/avformat.h:787)
collect: recompiling zm_monitor.cpp
collect: recompiling zm_event.cpp
collect: recompiling zm_rtp_ctrl.cpp
collect: recompiling zm_comms.cpp
collect: relinking
collect: recompiling zm_utils.cpp
collect: recompiling zm_rtsp.cpp
zm_rtsp.cpp: In constructor âRtspThread::RtspThread(int, RtspThread::RtspMethod, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&)â:
zm_rtsp.cpp:183: warning: âAVFormatContext* av_alloc_format_context()â is deprecated (declared at /usr/local/include/libavformat/avformat.h:787)
zm_rtsp.cpp:183: warning: âAVFormatContext* av_alloc_format_context()â is deprecated (declared at /usr/local/include/libavformat/avformat.h:787)
collect: recompiling zm_rtp_ctrl.cpp
collect: recompiling zm_event.cpp
collect: recompiling zm_comms.cpp
collect: relinking
collect: recompiling zm_rtsp.cpp
zm_rtsp.cpp: In constructor âRtspThread::RtspThread(int, RtspThread::RtspMethod, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&)â:
zm_rtsp.cpp:183: warning: âAVFormatContext* av_alloc_format_context()â is deprecated (declared at /usr/local/include/libavformat/avformat.h:787)
zm_rtsp.cpp:183: warning: âAVFormatContext* av_alloc_format_context()â is deprecated (declared at /usr/local/include/libavformat/avformat.h:787)
collect: recompiling zm_rtp_ctrl.cpp
collect: recompiling zm_event.cpp
collect: recompiling zm_comms.cpp
collect: relinking
collect: recompiling zm_rtsp.cpp
zm_rtsp.cpp: In constructor âRtspThread::RtspThread(int, RtspThread::RtspMethod, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&)â:
zm_rtsp.cpp:183: warning: âAVFormatContext* av_alloc_format_context()â is deprecated (declared at /usr/local/include/libavformat/avformat.h:787)
zm_rtsp.cpp:183: warning: âAVFormatContext* av_alloc_format_context()â is deprecated (declared at /usr/local/include/libavformat/avformat.h:787)
collect: recompiling zm_rtp_ctrl.cpp
collect: recompiling zm_comms.cpp
collect: relinking
collect: recompiling zm_comms.cpp
collect: relinking
zm_ffmpeg_camera.o: In function `FfmpegCamera::Capture(Image&)':
/usr/share/zoneminder/src/zm_ffmpeg_camera.cpp:172: undefined reference to `av_free_packet'
collect2: ld returned 1 exit status
make[2]: *** [zmc] Error 1
make[2]: Leaving directory `/usr/share/zoneminder/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/share/zoneminder'
make: *** [all] Error 2
liviab
Posts: 87
Joined: Wed Oct 15, 2008 11:54 am
Location: Brazil [MG]

Post by liviab »

Jonny,

the "real" error is:

Code: Select all

zm_ffmpeg_camera.o: In function `FfmpegCamera::Capture(Image&)':
/usr/share/zoneminder/src/zm_ffmpeg_camera.cpp:172: undefined reference to `av_free_packet' 
and, unfortunately, I can't help you. I've never seen this error and I don't know so much about ffmpeg.
Verify if your ffmpeg is updated or if there is some version indicated for the ZoneMinder you are installing.
johnnytolengo
Posts: 184
Joined: Tue Oct 14, 2008 5:59 pm

version 2

Post by johnnytolengo »

here i did the MAKE with the original src/zm_rtsp.cpp (avformat_alloc_conterxt() )the post before was with :av_alloc_format_context()

*******************************************
http://www.zoneminder.com/forums/viewtopic.php?p=49597

- mFormatContext = avformat_alloc_context();
+ mFormatContext = av_alloc_format_context();
*******************************************

here the new log, still with errors:

o zm_signal.o zm_signal.cpp
zm_signal.cpp: In function âvoid zm_die_handler(int, sigcontext)â:
zm_signal.cpp:112: warning: format not a string literal and no format arguments
zm_signal.cpp:112: warning: format not a string literal and no format arguments
zm_signal.cpp:126: warning: format not a string literal and no format arguments
mv -f .deps/zm_signal.Tpo .deps/zm_signal.Po
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include -frepo -g -O2 -MT zm_stream.o -MD -MP -MF .deps/zm_stream.Tpo -c -o zm_stream.o zm_stream.cpp
mv -f .deps/zm_stream.Tpo .deps/zm_stream.Po
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include -frepo -g -O2 -MT zm_thread.o -MD -MP -MF .deps/zm_thread.Tpo -c -o zm_thread.o zm_thread.cpp
mv -f .deps/zm_thread.Tpo .deps/zm_thread.Po
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include -frepo -g -O2 -MT zm_time.o -MD -MP -MF .deps/zm_time.Tpo -c -o zm_time.o zm_time.cpp
mv -f .deps/zm_time.Tpo .deps/zm_time.Po
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include -frepo -g -O2 -MT zm_timer.o -MD -MP -MF .deps/zm_timer.Tpo -c -o zm_timer.o zm_timer.cpp
mv -f .deps/zm_timer.Tpo .deps/zm_timer.Po
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include -frepo -g -O2 -MT zm_user.o -MD -MP -MF .deps/zm_user.Tpo -c -o zm_user.o zm_user.cpp
mv -f .deps/zm_user.Tpo .deps/zm_user.Po
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include -frepo -g -O2 -MT zm_zone.o -MD -MP -MF .deps/zm_zone.Tpo -c -o zm_zone.o zm_zone.cpp
mv -f .deps/zm_zone.Tpo .deps/zm_zone.Po
g++ -frepo -g -O2 -L/usr/lib -L/usr/lib/mysql -o zmc zmc.o zm_box.o zm_buffer.o zm_camera.o zm_comms.o zm_config.o zm_coord.o zm.o zm_db.o zm_debug.o zm_event.o zm_exception.o zm_file_camera.o zm_ffmpeg_camera.o zm_image.o zm_jpeg.o zm_local_camera.o zm_monitor.o zm_ffmpeg.o zm_mpeg.o zm_poly.o zm_regexp.o zm_remote_camera.o zm_remote_camera_http.o zm_remote_camera_rtsp.o zm_rtp.o zm_rtp_ctrl.o zm_rtp_data.o zm_rtp_source.o zm_rtsp.o zm_signal.o zm_stream.o zm_thread.o zm_time.o zm_timer.o zm_user.o zm_utils.o zm_zone.o -lbz2 -lswscale -lavformat -lavcodec -lavutil -lpcre -lgnutls-openssl -lmysqlclient -lpthread -ldl -lz -ljpeg
zm_ffmpeg_camera.o: In function `FfmpegCamera::Capture(Image&)':
/usr/share/zoneminder/src/zm_ffmpeg_camera.cpp:172: undefined reference to `av_free_packet'
collect2: ld returned 1 exit status
make[2]: *** [zmc] Error 1
make[2]: Leaving directory `/usr/share/zoneminder/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/share/zoneminder'
make: *** [all] Error 2


thanks.

J.
liviab
Posts: 87
Joined: Wed Oct 15, 2008 11:54 am
Location: Brazil [MG]

Post by liviab »

Your change made the things better because now there are no warnings, however, the error is the same.

:?
jeanpierre
Posts: 1
Joined: Tue Jul 14, 2009 2:12 pm

SOLVED!

Post by jeanpierre »

error : av_free_packet not found !


add in end file src/zm_ffmpeg_camera.cpp to resolve problem.



void av_free_packet(AVPacket *pkt)
{
if (pkt) {
if (pkt->destruct) pkt->destruct(pkt);
pkt->data = NULL; pkt->size = 0;
}
}
[/u]
johnnytolengo
Posts: 184
Joined: Tue Oct 14, 2008 5:59 pm

Post by johnnytolengo »

I can't find out where src/zm_ffmpeg_camera.cpp is :(


Thank you very much.
Locked