1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
--- config.h.in	2011-08-23 17:10:56.000000000 +0200
+++ config.h.in	2013-02-26 20:32:00.962662599 +0100
@@ -77,9 +77,6 @@
 /* Define to 1 if you have the <libavcodec/avcodec.h> header file. */
 #undef HAVE_LIBAVCODEC_AVCODEC_H
 
-/* Define to 1 if you have the `avcore' library (-lavcore). */
-#undef HAVE_LIBAVCORE
-
 /* Define to 1 if you have the `avdevice' library (-lavdevice). */
 #undef HAVE_LIBAVDEVICE
 
--- configure.ac	2013-02-26 18:52:55.218261914 +0100
+++ configure.ac	2013-02-26 20:11:51.277010292 +0100
@@ -277,9 +277,11 @@
 AC_CHECK_LIB(x264,x264_predict_16x16_init)
 AC_CHECK_LIB(avutil,av_malloc,,AC_MSG_WARN(libavutil.a may be required for MPEG streaming))
 # Don't bother to warn about this one
-AC_CHECK_LIB(avcore,av_image_copy,,)
-AC_CHECK_LIB(avcodec,avcodec_init,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming))
-AC_CHECK_LIB(avformat,av_new_stream,,AC_MSG_WARN(libavformat.a is required for MPEG streaming))
+AC_CHECK_LIB(avutil,av_image_copy,,)
+AC_CHECK_LIB(avcodec,avcodec_open2,,AC_MSG_WARN(libavcodec.a is required 
+for MPEG streaming))
+AC_CHECK_LIB(avformat,avformat_new_stream,,AC_MSG_WARN(libavformat.a is 
+required for MPEG streaming))
 AC_CHECK_LIB(avdevice,avdevice_register_all,,AC_MSG_WARN(libavdevice.a may be required for MPEG streaming))
 AC_CHECK_LIB(swscale,sws_scale,,,-lswscale)
 AC_CHECK_LIB(bz2,BZ2_bzCompress,,AC_MSG_WARN(zm requires libbz2.a for recent versions of ffmpeg))
--- src/zm_ffmpeg_camera.cpp	2011-06-21 09:40:13.000000000 +0200
+++ src/zm_ffmpeg_camera.cpp	2013-02-26 21:05:05.868768108 +0100
@@ -91,11 +91,11 @@
     Info( "Priming capture from %s", mPath.c_str() );
 
     // Open the input, not necessarily a file
-    if ( av_open_input_file( &mFormatContext, mPath.c_str(), NULL, 0, NULL ) !=0 )
+    if ( avformat_open_input( &mFormatContext, mPath.c_str(), NULL, NULL ) !=0 )
         Fatal( "Unable to open input %s due to: %s", mPath.c_str(), strerror(errno) );
 
     // Locate stream info from input
-    if ( av_find_stream_info( mFormatContext ) < 0 )
+    if ( avformat_find_stream_info( mFormatContext, NULL ) < 0 )
         Fatal( "Unable to find stream info from %s due to: %s", mPath.c_str(), strerror(errno) );
     
     // Find first video stream present
@@ -122,7 +122,7 @@
         Fatal( "Can't find codec for video stream from %s", mPath.c_str() );
 
     // Open the codec
-    if ( avcodec_open( mCodecContext, mCodec ) < 0 )
+    if ( avcodec_open2( mCodecContext, mCodec, NULL ) < 0 )
         Fatal( "Unable to open codec for video stream from %s", mPath.c_str() );
 
     // Allocate space for the native video frame
--- src/zm_mpeg.cpp	2011-05-15 22:39:06.000000000 +0200
+++ src/zm_mpeg.cpp	2013-02-26 19:53:34.068795115 +0100
@@ -77,7 +77,7 @@
 	ost = NULL;
 	if (of->video_codec != CODEC_ID_NONE)
 	{
-		ost = av_new_stream(ofc, 0);
+		ost = avformat_new_stream(ofc, 0);
 		if (!ost)
 		{
 			Panic( "Could not alloc stream" );
@@ -130,10 +130,12 @@
 {
 	/* set the output parameters (must be done even if no
 	   parameters). */
-	if ( av_set_parameters(ofc, NULL) < 0 )
+	/*
+     * Removed in last ffmpeg
+     * if ( av_set_parameters(ofc, NULL) < 0 )
 	{
 		Panic( "Invalid output format parameters" );
-	}
+	}*/
 	//dump_format(ofc, 0, filename, 1);
 }
 
@@ -176,7 +178,7 @@
 		}
 
 		/* open the codec */
-		if ( avcodec_open(c, codec) < 0 )
+		if ( avcodec_open2(c, codec, NULL ) < 0 )
 		{
 			Panic( "Could not open codec" );
 		}
@@ -222,7 +224,7 @@
 	if ( !(of->flags & AVFMT_NOFILE) )
 	{
 #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1)
-		if ( avio_open(&ofc->pb, filename, URL_WRONLY) < 0 )
+		if ( avio_open(&ofc->pb, filename, AVIO_FLAG_WRITE) < 0 )
 #else
 		if ( url_fopen(&ofc->pb, filename, URL_WRONLY) < 0 )
 #endif
@@ -241,7 +243,7 @@
 	}
 
 	/* write the stream header, if any */
-	av_write_header(ofc);
+	avformat_write_header(ofc, NULL);
 }
 
 VideoStream::VideoStream( const char *filename, const char *format, int bitrate, double frame_rate, int colours, int width, int height )
--- src/zm_remote_camera_rtsp.cpp	2011-06-21 11:19:10.000000000 +0200
+++ src/zm_remote_camera_rtsp.cpp	2013-02-26 19:30:56.585803600 +0100
@@ -145,7 +145,7 @@
         Panic( "Unable to locate codec %d decoder", codecContext->codec_id );
 
     // Open codec
-    if ( avcodec_open( codecContext, codec ) < 0 )
+    if ( avcodec_open2( codecContext, codec, NULL ) < 0 )
         Panic( "Can't open codec" );
 
     picture = avcodec_alloc_frame();
--- src/zm_sdp.cpp	2011-05-15 22:39:06.000000000 +0200
+++ src/zm_sdp.cpp	2013-02-27 09:38:07.320493179 +0100
@@ -334,7 +334,7 @@
     for ( int i = 0; i < mMediaList.size(); i++ )
     {
         const MediaDescriptor *mediaDesc = mMediaList[i];
-        AVStream *stream = av_new_stream( formatContext, i );
+        AVStream *stream = avformat_new_stream( formatContext, NULL );
 
         Debug( 1, "Looking for codec for %s payload type %d / %s",  mediaDesc->getType().c_str(), mediaDesc->getPayloadType(), mediaDesc->getPayloadDesc().c_str() );
 #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1)