Page 1 of 1

Compilation Error ZM 1.24.3

Posted: Mon May 02, 2011 8:38 am
by Ninux
Hi

I try to compile ZM 1.24.3 with ffmpeg, x264 and EyeZM
I have this message when I try to compile ZM

Code: Select all

configure: WARNING: libavutil/avutil.h: present but cannot be compiled
configure: WARNING: libavutil/avutil.h:     check for missing prerequisite headers?
configure: WARNING: libavutil/avutil.h: see the Autoconf documentation
configure: WARNING: libavutil/avutil.h:     section "Present But Cannot Be Compiled"
configure: WARNING: libavutil/avutil.h: proceeding with the compiler's result
configure: WARNING:     ## ------------------------------------- ##
configure: WARNING:     ## Report this to support@zoneminder ##
configure: WARNING:     ## ------------------------------------- ##
configure: WARNING: libavcodec/avcodec.h: present but cannot be compiled
configure: WARNING: libavcodec/avcodec.h:     check for missing prerequisite headers?
configure: WARNING: libavcodec/avcodec.h: see the Autoconf documentation
configure: WARNING: libavcodec/avcodec.h:     section "Present But Cannot Be Compiled"
configure: WARNING: libavcodec/avcodec.h: proceeding with the compiler's result
configure: WARNING:     ## ------------------------------------- ##
configure: WARNING:     ## Report this to support@zoneminder ##
configure: WARNING:     ## ------------------------------------- ##
configure: WARNING: libavformat/avformat.h: present but cannot be compiled
configure: WARNING: libavformat/avformat.h:     check for missing prerequisite headers?
configure: WARNING: libavformat/avformat.h: see the Autoconf documentation
configure: WARNING: libavformat/avformat.h:     section "Present But Cannot Be Compiled"
configure: WARNING: libavformat/avformat.h: proceeding with the compiler's result
configure: WARNING:     ## ------------------------------------- ##
configure: WARNING:     ## Report this to support@zoneminder ##
configure: WARNING:     ## ------------------------------------- ##
configure: WARNING: libswscale/swscale.h: present but cannot be compiled
configure: WARNING: libswscale/swscale.h:     check for missing prerequisite headers?
configure: WARNING: libswscale/swscale.h: see the Autoconf documentation
configure: WARNING: libswscale/swscale.h:     section "Present But Cannot Be Compiled"
configure: WARNING: libswscale/swscale.h: proceeding with the compiler's result
configure: WARNING:     ## ------------------------------------- ##
configure: WARNING:     ## Report this to support@zoneminder ##
configure: WARNING:     ## ------------------------------------- ##

Code: Select all

make[2]: Entering directory `/usr/src/zm/src'
g++ -DHAVE_CONFIG_H -I. -I..  -I/usr/include -Iyes/include -Wall -Wno-sign-compare -fno-inline -Iyes/include   -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:26,
                 from zmc.cpp:28:
zm_ffmpeg.h:33: error: #error "No location for avutils.h found"
zm_ffmpeg.h:40: error: #error "No location for avcodec.h found"
zm_ffmpeg.h:47: error: #error "No location for avformat.h found"
zm_ffmpeg.h:55: error: #error "No location for swscale.h found"
In file included from zm_stream.h:27,
                 from zm_event.h:39,
                 from zm_zone.h:27,
                 from zm_monitor.h:26,
                 from zmc.cpp:28:
zm_mpeg.h:43: error: use of enum âPixelFormatâ without previous declaration
zm_mpeg.h:44: error: ISO C++ forbids declaration of âAVOutputFormatâ with no type
zm_mpeg.h:44: error: expected â;â before â*â token
zm_mpeg.h:45: error: ISO C++ forbids declaration of âAVFormatContextâ with no type
zm_mpeg.h:45: error: expected â;â before â*â token
zm_mpeg.h:46: error: ISO C++ forbids declaration of âAVStreamâ with no type
zm_mpeg.h:46: error: expected â;â before â*â token
zm_mpeg.h:47: error: ISO C++ forbids declaration of âAVFrameâ with no type
zm_mpeg.h:47: error: expected â;â before â*â token
zm_mpeg.h:48: error: ISO C++ forbids declaration of âAVFrameâ with no type
zm_mpeg.h:48: error: expected â;â before â*â token
make[2]: *** [zmc.o] Error 1
make[2]: Leaving directory `/usr/src/zm/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/zm'
make: *** [all] Error 2
X264 from git videolan
./configure --enable-shared


ffmpeg from git gideolan
./configure --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab


ZM from svn
./configure --with-webdir=/var/www --with-cgidir=/usr/lib/cgi-bin ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zmuser ZM_DB_PASS=zmpass --enable-debug=yes --with-webgroup=www-data --with-webuser=www-data --with-ffmpeg

Re: Compilation Error ZM 1.24.3

Posted: Tue May 03, 2011 4:06 pm
by DREMA
On what distribution are you?

Try with this configuration line for zm

./configure --with-webdir=/var/www/zm --with-cgidir=/usr/lib/cgi-bin \
ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zmuser \
ZM_DB_PASS=zmpass ZM_SSL_LIB=openssl --enable-debug=no \
--with-webgroup=www-data --with-webuser=www-data --enable-mmap CPPFLAGS="-D__STDC_CONSTANT_MACROS ${CPPFLAGS}"

Re: Compilation Error ZM 1.24.3

Posted: Wed May 04, 2011 11:32 am
by Ninux
I'm in Ubuntu 10.10 Maverick

When I use your configure option

Code: Select all

g++ -DHAVE_CONFIG_H -I. -I..  -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include -D__STDC_CONSTANT_MACROS   -g -O2 -MT zm_ffmpeg_camera.o -MD -MP -MF .deps/zm_ffmpeg_camera.Tpo -c -o zm_ffmpeg_camera.o zm_ffmpeg_camera.cpp
zm_ffmpeg_camera.cpp: In member function âvirtual int FfmpegCamera::PrimeCapture()â:
zm_ffmpeg_camera.cpp:105: error: âCODEC_TYPE_VIDEOâ was not declared in this scope
make[2]: *** [zm_ffmpeg_camera.o] Error 1
make[2]: Leaving directory `/usr/src/zm/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/zm'
make: *** [all] Error 2

Re: Compilation Error ZM 1.24.3

Posted: Fri May 06, 2011 6:35 pm
by laurenti
Hi, I am seeing a similar error.

(Debian squeeze amd64)

Code: Select all

x264
./configure --enable-shared

libvpx
./configure

ffmpeg.git
./configure --enable-libmp3lame --enable-libtheora --enable-libx264 \
--enable-libgsm --enable-postproc --enable-libxvid --enable-libfaac \
--enable-shared --enable-pthreads --enable-libvorbis \
--enable-gpl --enable-x11grab --enable-nonfree


trunk zm
echo "Checked out revision 3337." > XXX_SVN_3337.txt
./configure --with-webdir=/home/www/zm --with-cgidir=/usr/lib/cgi-bin \
ZM_DB_HOST=localhost ZM_DB_NAME=lnt_videosrv ZM_DB_USER=lnt_zm ZM_DB_PASS=lnt@vs \
--with-libarch=lib64 --with-ffmpeg=/usr/local --enable-debug=yes --with-webgroup=www-data --with-webuser=www-data \
--enable-mmap CPPFLAGS="-D__STDC_CONSTANT_MACROS ${CPPFLAGS}"


....
g++ -DHAVE_CONFIG_H -I. -I..  -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline -I/usr/include -D__STDC_CONSTANT_MACROS   -g -O2 -MT zm_ffmpeg_camera.o -MD -MP -MF .deps/zm_ffmpeg_camera.Tpo -c -o zm_ffmpeg_camera.o zm_ffmpeg_camera.cpp
zm_ffmpeg_camera.cpp: In member function ‘virtual int FfmpegCamera::PrimeCapture()’:
zm_ffmpeg_camera.cpp:105: error: ‘CODEC_TYPE_VIDEO’ was not declared in this scope
make[2]: *** [zm_ffmpeg_camera.o] Error 1
make[2]: Leaving directory `/opt/zm-tools/zm_trunk/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/zm-tools/zm_trunk'
make: *** [all] Error 2

Re: Compilation Error ZM 1.24.3

Posted: Fri May 06, 2011 7:05 pm
by mastertheknife
Seems like a ffmpeg issue.
Please try reinstalling ffmpeg 0.6 or newer.

mastertheknife

Re: Compilation Error ZM 1.24.3

Posted: Fri May 06, 2011 11:11 pm
by brian360
laurenti wrote: zm_ffmpeg_camera.cpp:105: error: ‘CODEC_TYPE_VIDEO’ was not declared in this scope
make[2]: *** [zm_ffmpeg_camera.o] Error 1
make[2]: Leaving directory `/opt/zm-tools/zm_trunk/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/zm-tools/zm_trunk'
make: *** [all] Error 2
[/code]
I recently compiled against ffmpeg's latest git revision and they changed all the "CODEC_*" type constants to "AVMEDIA_*" constants.

In my case, I had to:
- Edit src/zm_ffmpeg_camera.cpp and change “CODEC_TYPE_VIDEO” to “AVMEDIA_TYPE_VIDEO”
- Edit src/zm_mpeg.cpp and change “PKT_FLAG_KEY” to “AV_PKT_FLAG_KEY”
- Edit src/zm_mpeg.cpp and change “CODEC_TYPE_VIDEO” to “AVMEDIA_TYPE_VIDEO”
- Edit src/zm_remote_camera_rtsp.cpp and change as before
- Edit src/zm_rtsp.cpp and change as before
- Edit src/zm_sdp.cpp and change all CODEC_TYPE_ to AVMEDIA_TYPE_ and change “enum CodecType” to “enum AVMediaType”

Good luck!

Re: Compilation Error ZM 1.24.3

Posted: Sat May 07, 2011 8:01 am
by laurenti
mastertheknife wrote:Seems like a ffmpeg issue.
Please try reinstalling ffmpeg 0.6 or newer.

mastertheknife
Yes, with ffmpeg from debian-multimedia (5:0.6.1+svn20101128-0.2) everything is fine.

Re: Compilation Error ZM 1.24.3

Posted: Sat May 07, 2011 8:22 am
by mastertheknife
brian360 wrote:
laurenti wrote: zm_ffmpeg_camera.cpp:105: error: ‘CODEC_TYPE_VIDEO’ was not declared in this scope
make[2]: *** [zm_ffmpeg_camera.o] Error 1
make[2]: Leaving directory `/opt/zm-tools/zm_trunk/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/zm-tools/zm_trunk'
make: *** [all] Error 2
[/code]
I recently compiled against ffmpeg's latest git revision and they changed all the "CODEC_*" type constants to "AVMEDIA_*" constants.

In my case, I had to:
- Edit src/zm_ffmpeg_camera.cpp and change “CODEC_TYPE_VIDEO” to “AVMEDIA_TYPE_VIDEO”
- Edit src/zm_mpeg.cpp and change “PKT_FLAG_KEY” to “AV_PKT_FLAG_KEY”
- Edit src/zm_mpeg.cpp and change “CODEC_TYPE_VIDEO” to “AVMEDIA_TYPE_VIDEO”
- Edit src/zm_remote_camera_rtsp.cpp and change as before
- Edit src/zm_rtsp.cpp and change as before
- Edit src/zm_sdp.cpp and change all CODEC_TYPE_ to AVMEDIA_TYPE_ and change “enum CodecType” to “enum AVMediaType”

Good luck!
Okay, i did some investigation.
It seems that ffmpeg renamed these somewhere around early 2011 and the older names (e.g. CODEC_TYPE_VIDEO) were #defined to the new ones (AVMEDIA_TYPE_VIDEO) to keep old programs compatible, but in the latest ffmpeg git revisions, the #defines to keep old programs compatible were removed.
So ZM needs to use the new names but this will require everyone to use ffmpeg from around early 2011 or newer.
Best approach would be to use the new names, but based on ffmpeg version, #define the new names to the old ones, that way it will be compatible with old ffmpeg versions.

mastertheknife.

Re: Compilation Error ZM 1.24.3

Posted: Sat May 07, 2011 3:37 pm
by mastertheknife
Here is a patch against the SVN version.
Simply save to a file, go to ZM folder (the one that contains the folders: web, src and scripts) and run: patch -p1 -i thepatchfile

Code: Select all

diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp
index a4a4ae0..055a2da 100644
--- a/src/zm_ffmpeg_camera.cpp
+++ b/src/zm_ffmpeg_camera.cpp
@@ -118,7 +118,7 @@ int FfmpegCamera::PrimeCapture()
     mVideoStreamId = -1;
     for ( int i=0; i < mFormatContext->nb_streams; i++ )
     {
-        if ( mFormatContext->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO )
+        if ( mFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO )
         {
             mVideoStreamId = i;
             break;
diff --git a/src/zm_mpeg.cpp b/src/zm_mpeg.cpp
index 0d74212..c359730 100644
--- a/src/zm_mpeg.cpp
+++ b/src/zm_mpeg.cpp
@@ -90,7 +90,7 @@ void VideoStream::SetupCodec( int colours, int width, int height, int bitrate, d
 #endif
 
 		c->codec_id = of->video_codec;
-		c->codec_type = CODEC_TYPE_VIDEO;
+		c->codec_type = AVMEDIA_TYPE_VIDEO;
 
 		/* put sample parameters */
 		c->bit_rate = bitrate;
@@ -343,7 +343,7 @@ double VideoStream::EncodeFrame( const uint8_t *buffer, int buffer_size, bool ad
 		AVPacket pkt;
 		av_init_packet( &pkt );
 
-		pkt.flags |= PKT_FLAG_KEY;
+		pkt.flags |= AV_PKT_FLAG_KEY;
 		pkt.stream_index = ost->index;
 		pkt.data = (uint8_t *)opicture_ptr;
 		pkt.size = sizeof(AVPicture);
diff --git a/src/zm_remote_camera_rtsp.cpp b/src/zm_remote_camera_rtsp.cpp
index f1f9995..43af6b7 100644
--- a/src/zm_remote_camera_rtsp.cpp
+++ b/src/zm_remote_camera_rtsp.cpp
@@ -124,7 +124,7 @@ int RemoteCameraRtsp::PrimeCapture()
     // Find the first video stream
     int videoStream=-1;
     for ( int i = 0; i < formatContext->nb_streams; i++ )
-        if ( formatContext->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO )
+        if ( formatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO )
         {
             videoStream = i;
             break;
diff --git a/src/zm_rtsp.cpp b/src/zm_rtsp.cpp
index dcf1878..3aec863 100644
--- a/src/zm_rtsp.cpp
+++ b/src/zm_rtsp.cpp
@@ -335,7 +335,7 @@ int RtspThread::run()
         for ( int i = 0; i < mFormatContext->nb_streams; i++ )
         {
             SessionDescriptor::MediaDescriptor *mediaDesc = sessDesc->getStream( i );
-            if ( mFormatContext->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO )
+            if ( mFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO )
             {
                 trackUrl += "/"+mediaDesc->getControlUrl();
                 rtpClock = mediaDesc->getClock();
diff --git a/src/zm_sdp.cpp b/src/zm_sdp.cpp
index f34c397..5dc7d71 100644
--- a/src/zm_sdp.cpp
+++ b/src/zm_sdp.cpp
@@ -24,40 +24,40 @@
 #include "zm_sdp.h"
 
 SessionDescriptor::StaticPayloadDesc SessionDescriptor::smStaticPayloads[] = {
-    { 0, "PCMU",   CODEC_TYPE_AUDIO,   CODEC_ID_PCM_MULAW,  8000,  1 },
-    { 3, "GSM",    CODEC_TYPE_AUDIO,   CODEC_ID_NONE,       8000,  1 },
-    { 4, "G723",   CODEC_TYPE_AUDIO,   CODEC_ID_NONE,       8000,  1 },
-    { 5, "DVI4",   CODEC_TYPE_AUDIO,   CODEC_ID_NONE,       8000,  1 },
-    { 6, "DVI4",   CODEC_TYPE_AUDIO,   CODEC_ID_NONE,       16000, 1 },
-    { 7, "LPC",    CODEC_TYPE_AUDIO,   CODEC_ID_NONE,       8000,  1 },
-    { 8, "PCMA",   CODEC_TYPE_AUDIO,   CODEC_ID_PCM_ALAW,   8000,  1 },
-    { 9, "G722",   CODEC_TYPE_AUDIO,   CODEC_ID_NONE,       8000,  1 },
-    { 10, "L16",   CODEC_TYPE_AUDIO,   CODEC_ID_PCM_S16BE,  44100, 2 },
-    { 11, "L16",   CODEC_TYPE_AUDIO,   CODEC_ID_PCM_S16BE,  44100, 1 },
-    { 12, "QCELP", CODEC_TYPE_AUDIO,   CODEC_ID_QCELP,      8000,  1 },
-    { 13, "CN",    CODEC_TYPE_AUDIO,   CODEC_ID_NONE,       8000,  1 },
-    { 14, "MPA",   CODEC_TYPE_AUDIO,   CODEC_ID_MP2,        -1,    -1 },
-    { 14, "MPA",   CODEC_TYPE_AUDIO,   CODEC_ID_MP3,        -1,    -1 },
-    { 15, "G728",  CODEC_TYPE_AUDIO,   CODEC_ID_NONE,       8000,  1 },
-    { 16, "DVI4",  CODEC_TYPE_AUDIO,   CODEC_ID_NONE,       11025, 1 },
-    { 17, "DVI4",  CODEC_TYPE_AUDIO,   CODEC_ID_NONE,       22050, 1 },
-    { 18, "G729",  CODEC_TYPE_AUDIO,   CODEC_ID_NONE,       8000,  1 },
-    { 25, "CelB",  CODEC_TYPE_VIDEO,   CODEC_ID_NONE,       90000, -1 },
-    { 26, "JPEG",  CODEC_TYPE_VIDEO,   CODEC_ID_MJPEG,      90000, -1 },
-    { 28, "nv",    CODEC_TYPE_VIDEO,   CODEC_ID_NONE,       90000, -1 },
-    { 31, "H261",  CODEC_TYPE_VIDEO,   CODEC_ID_H261,       90000, -1 },
-    { 32, "MPV",   CODEC_TYPE_VIDEO,   CODEC_ID_MPEG1VIDEO, 90000, -1 },
-    { 32, "MPV",   CODEC_TYPE_VIDEO,   CODEC_ID_MPEG2VIDEO, 90000, -1 },
-    { 33, "MP2T",  CODEC_TYPE_DATA,    CODEC_ID_MPEG2TS,    90000, -1 },
-    { 34, "H263",  CODEC_TYPE_VIDEO,   CODEC_ID_H263,       90000, -1 },
-    { -1, "",      CODEC_TYPE_UNKNOWN, CODEC_ID_NONE,       -1,    -1 }
+    { 0, "PCMU",   AVMEDIA_TYPE_AUDIO,   CODEC_ID_PCM_MULAW,  8000,  1 },
+    { 3, "GSM",    AVMEDIA_TYPE_AUDIO,   CODEC_ID_NONE,       8000,  1 },
+    { 4, "G723",   AVMEDIA_TYPE_AUDIO,   CODEC_ID_NONE,       8000,  1 },
+    { 5, "DVI4",   AVMEDIA_TYPE_AUDIO,   CODEC_ID_NONE,       8000,  1 },
+    { 6, "DVI4",   AVMEDIA_TYPE_AUDIO,   CODEC_ID_NONE,       16000, 1 },
+    { 7, "LPC",    AVMEDIA_TYPE_AUDIO,   CODEC_ID_NONE,       8000,  1 },
+    { 8, "PCMA",   AVMEDIA_TYPE_AUDIO,   CODEC_ID_PCM_ALAW,   8000,  1 },
+    { 9, "G722",   AVMEDIA_TYPE_AUDIO,   CODEC_ID_NONE,       8000,  1 },
+    { 10, "L16",   AVMEDIA_TYPE_AUDIO,   CODEC_ID_PCM_S16BE,  44100, 2 },
+    { 11, "L16",   AVMEDIA_TYPE_AUDIO,   CODEC_ID_PCM_S16BE,  44100, 1 },
+    { 12, "QCELP", AVMEDIA_TYPE_AUDIO,   CODEC_ID_QCELP,      8000,  1 },
+    { 13, "CN",    AVMEDIA_TYPE_AUDIO,   CODEC_ID_NONE,       8000,  1 },
+    { 14, "MPA",   AVMEDIA_TYPE_AUDIO,   CODEC_ID_MP2,        -1,    -1 },
+    { 14, "MPA",   AVMEDIA_TYPE_AUDIO,   CODEC_ID_MP3,        -1,    -1 },
+    { 15, "G728",  AVMEDIA_TYPE_AUDIO,   CODEC_ID_NONE,       8000,  1 },
+    { 16, "DVI4",  AVMEDIA_TYPE_AUDIO,   CODEC_ID_NONE,       11025, 1 },
+    { 17, "DVI4",  AVMEDIA_TYPE_AUDIO,   CODEC_ID_NONE,       22050, 1 },
+    { 18, "G729",  AVMEDIA_TYPE_AUDIO,   CODEC_ID_NONE,       8000,  1 },
+    { 25, "CelB",  AVMEDIA_TYPE_VIDEO,   CODEC_ID_NONE,       90000, -1 },
+    { 26, "JPEG",  AVMEDIA_TYPE_VIDEO,   CODEC_ID_MJPEG,      90000, -1 },
+    { 28, "nv",    AVMEDIA_TYPE_VIDEO,   CODEC_ID_NONE,       90000, -1 },
+    { 31, "H261",  AVMEDIA_TYPE_VIDEO,   CODEC_ID_H261,       90000, -1 },
+    { 32, "MPV",   AVMEDIA_TYPE_VIDEO,   CODEC_ID_MPEG1VIDEO, 90000, -1 },
+    { 32, "MPV",   AVMEDIA_TYPE_VIDEO,   CODEC_ID_MPEG2VIDEO, 90000, -1 },
+    { 33, "MP2T",  AVMEDIA_TYPE_DATA,    CODEC_ID_MPEG2TS,    90000, -1 },
+    { 34, "H263",  AVMEDIA_TYPE_VIDEO,   CODEC_ID_H263,       90000, -1 },
+    { -1, "",      AVMEDIA_TYPE_UNKNOWN, CODEC_ID_NONE,       -1,    -1 }
 };
 
 SessionDescriptor::DynamicPayloadDesc SessionDescriptor::smDynamicPayloads[] = {
-    { "MP4V-ES", CODEC_TYPE_VIDEO, CODEC_ID_MPEG4 },
-    { "mpeg4-generic", CODEC_TYPE_AUDIO, CODEC_ID_AAC },
-    { "H264", CODEC_TYPE_VIDEO, CODEC_ID_H264 },
-    { "AMR", CODEC_TYPE_AUDIO, CODEC_ID_AMR_NB }
+    { "MP4V-ES", AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG4 },
+    { "mpeg4-generic", AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC },
+    { "H264", AVMEDIA_TYPE_VIDEO, CODEC_ID_H264 },
+    { "AMR", AVMEDIA_TYPE_AUDIO, CODEC_ID_AMR_NB }
 };
 
 SessionDescriptor::ConnInfo::ConnInfo( const std::string &connInfo ) :
@@ -299,9 +299,9 @@ AVFormatContext *SessionDescriptor::generateFormatContext() const
 
         Debug( 1, "Looking for codec for %s payload type %d / %s",  mediaDesc->getType().c_str(), mediaDesc->getPayloadType(), mediaDesc->getPayloadDesc().c_str() );
         if ( mediaDesc->getType() == "video" )
-            stream->codec->codec_type = CODEC_TYPE_VIDEO;
+            stream->codec->codec_type = AVMEDIA_TYPE_VIDEO;
         else if ( mediaDesc->getType() == "audio" )
-            stream->codec->codec_type = CODEC_TYPE_AUDIO;
+            stream->codec->codec_type = AVMEDIA_TYPE_AUDIO;
 
         if ( mediaDesc->getPayloadType() < PAYLOAD_TYPE_DYNAMIC )
         {
diff --git a/src/zm_sdp.h b/src/zm_sdp.h
index f2ba775..bf5bc02 100644
--- a/src/zm_sdp.h
+++ b/src/zm_sdp.h
@@ -40,7 +40,7 @@ protected:
     {
         int payloadType;
         const char payloadName[6];
-        enum CodecType codecType;
+        enum AVMediaType codecType;
         enum CodecID codecId;
         int clockRate;
         int autoChannels;
@@ -49,7 +49,7 @@ protected:
     struct DynamicPayloadDesc
     {
         const char payloadName[32];
-        enum CodecType codecType;
+        enum AVMediaType codecType;
         enum CodecID codecId;
         //int clockRate;
         //int autoChannels;