Error compiling httpsegmenter

Forum for questions and support relating to the 1.24.x releases only.
Locked
Tiggy
Posts: 62
Joined: Tue Mar 11, 2008 7:47 pm
Location: Belgium

Error compiling httpsegmenter

Post by Tiggy »

Hi,

I am sure this should be very easy ...

I follewed the manual on here somewhere to do a clean install with 11.04 and all works fine except the httpsegmenter compiling part; ffmpeg has been compiled with shared libraries.

Here is the output:

root@gecko:/usr/src/zm_xml_p2fs3/httpsegmenter# make
gcc -Wall -g segmenter.c -o segmenter -lavformat -lavcodec -lavutil
segmenter.c: In function âadd_output_streamâ:
segmenter.c:57:14: error: âCODEC_TYPE_AUDIOâ undeclared (first use in this function)
segmenter.c:57:14: note: each undeclared identifier is reported only once for each function it appears in
segmenter.c:69:14: error: âCODEC_TYPE_VIDEOâ undeclared (first use in this function)
segmenter.c: In function âmainâ:
segmenter.c:278:9: warning: implicit declaration of function âguess_formatâ
segmenter.c:278:14: warning: assignment makes pointer from integer without a cast
segmenter.c:297:18: error: âCODEC_TYPE_VIDEOâ undeclared (first use in this function)
segmenter.c:302:18: error: âCODEC_TYPE_AUDIOâ undeclared (first use in this function)
segmenter.c:313:5: warning: âav_set_parametersâ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1368)
segmenter.c:318:5: warning: âdump_formatâ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1471)
segmenter.c:332:5: warning: âurl_fopenâ is deprecated (declared at /usr/local/include/libavformat/avio.h:279)
segmenter.c:359:67: error: âPKT_FLAG_KEYâ undeclared (first use in this function)
segmenter.c:370:13: warning: âput_flush_packetâ is deprecated (declared at /usr/local/include/libavformat/avio.h:293)
segmenter.c:371:13: warning: âurl_fcloseâ is deprecated (declared at /usr/local/include/libavformat/avio.h:280)
segmenter.c:391:13: warning: âurl_fopenâ is deprecated (declared at /usr/local/include/libavformat/avio.h:279)
segmenter.c:433:5: warning: âurl_fcloseâ is deprecated (declared at /usr/local/include/libavformat/avio.h:280)
make: *** [all] Error 1

Any ideas?
User avatar
asturgeon
Posts: 23
Joined: Fri Apr 15, 2011 12:10 am

Re: Error compiling httpsegmenter

Post by asturgeon »

FFMPEG made some changes lately which broke a lot of dependencies, including segmenter. Can you try checking out the 'oldabi' branch of FFMPEG and recompiling? It should work with httpsegmenter. You can do it using:

Code: Select all

git clone git://git.videolan.org/ffmpeg.git
cd ffmpeg/
git checkout oldabi
Native iPhone and iPad control for ZoneMinder with eyeZm, the premiere iOS app for use with ZoneMinder.

Visit http://eyezm.com for more info, and subscribe to our RSS feed at http://eyezm.com/rssfeed.xml for news and updates.
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: Error compiling httpsegmenter

Post by mastertheknife »

Some of these are simple to fix:
change all those CODEC_* defines to AVMEDIA_*
change PKT_FLAG_KEY to AV_PKT_FLAG_KEY

mastertheknife.
Kfir Itzhak.
elusive
Posts: 14
Joined: Wed Oct 22, 2008 4:53 am

Re: Error compiling httpsegmenter

Post by elusive »

Hello,

Here is how I fixed that issue :

Code: Select all

sed -i 's/CODEC_TYPE_/AVMEDIA_TYPE_/g' segmenter.c
sed -i 's/PKT_FLAG_KEY/AV_PKT_FLAG_KEY/g' segmenter.c
sed -i 's/dump_format/av_dump_format/g' segmenter.c
sed -i 's/guess_format/av_guess_format/g' segmenter.c
sed -i 's/put_flush_packet/avio_flush/g' segmenter.c
sed -i 's/url_f/avio_/g' segmenter.c
Moreover I made some tries in order to get the audio on my iPhone using EyeZM while streaming in H264 but no luck until now (only video working) :

First I compiled the segmenter with audio support (Makefile) :
gcc -Wall -g segmenter.c -o segmenter -lavformat -lavcodec -lavutil -lbz2 -lm -lz -lfaac -lmp3lame -lx264 -lfaad
Then I recompiled ffmpeg with all the necessary codecs and finaly I made that change in the skins/xml/includes/functions.php file :

$ffparms = "-analyzeduration 0 -acodec libfaac -ac 2 -ar 48000 -ab 192k";

-> line 203 from SVN revision 3400

I guess some more changes would be necessary from the RTSP input stream files (I'm using Y-CAM Black cameras in RTSP MPEG-4 streaming mode which has audio enabled on the cameras side) but I really don't know how to make this ... does someone have an idea ?

Best regards.
Last edited by elusive on Tue Jun 14, 2011 12:58 pm, edited 1 time in total.
Tiggy
Posts: 62
Joined: Tue Mar 11, 2008 7:47 pm
Location: Belgium

Re: Error compiling httpsegmenter

Post by Tiggy »

Thx for the answers dudes :)

elusives substitution lines made it work and made it easy lol :)

I now just have to try it out ...

As for ffmpeg; I downloaded and compiled the latest yesterday so that couldn't be the problem :)
User avatar
asturgeon
Posts: 23
Joined: Fri Apr 15, 2011 12:10 am

Re: Error compiling httpsegmenter

Post by asturgeon »

Tiggy wrote:Thx for the answers dudes :)

elusives substitution lines made it work and made it easy lol :)

I now just have to try it out ...
elusive submitted his patch to us recently and we are in the process of evaluating it, but it looks good, so thanks! Looks like it worked for you as well..
As for ffmpeg; I downloaded and compiled the latest yesterday so that couldn't be the problem :)
It actually is the problem... the latest versions broke this in httpsegmenter, but they maintained a branch called 'oldabi' which still worked with httpsegmenter. Once we finish validating elusives patch, we will update httpsegmenter to handle both versions of ffmpeg.
Native iPhone and iPad control for ZoneMinder with eyeZm, the premiere iOS app for use with ZoneMinder.

Visit http://eyezm.com for more info, and subscribe to our RSS feed at http://eyezm.com/rssfeed.xml for news and updates.
Locked