ServerTune

Browse by category

Search    |    Advanced search

FFmpeg :: make: *** [libavcodec/imgresample.o] Error 1

If you get the following error message when trying to compile ffmpeg:

[exec] make: *** [libavcodec/imgresample.o] Error 1

You need to apply the following patch to compile ffmpeg successfully.

Use your favorite Linux text editor, such as vi or pico, to create the following file:

Insert the following text and then save the file:

Index: libavcodec/imgresample.c
===================================================================
--- libavcodec/imgresample.c	(revision 16975)
+++ libavcodec/imgresample.c	(working copy)
@@ -517,10 +517,10 @@
 
 static const AVClass context_class = { "imgresample", context_to_name, NULL };
 
-struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat,
-                                  int dstW, int dstH, int dstFormat,
+struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
+                                  int dstW, int dstH, enum PixelFormat dstFormat,
                                   int flags, SwsFilter *srcFilter,
-                                  SwsFilter *dstFilter, double *param)
+                                  SwsFilter *dstFilter, const double *param)
 {
     struct SwsContext *ctx;
 
@@ -575,9 +575,10 @@
  * asumed to remain valid.
  */
 struct SwsContext *sws_getCachedContext(struct SwsContext *ctx,
-                        int srcW, int srcH, int srcFormat,
-                        int dstW, int dstH, int dstFormat, int flags,
-                        SwsFilter *srcFilter, SwsFilter *dstFilter, double *param)
+                                        int srcW, int srcH, enum PixelFormat srcFormat,
+                                        int dstW, int dstH, enum PixelFormat dstFormat,
+                                        int flags, SwsFilter *srcFilter,
+                                        SwsFilter *dstFilter, const double *param)
 {
     if (ctx != NULL) {
         if ((ctx->resampling_ctx->iwidth != srcW) ||

Then run the following command to apply the patch:



If you get the following error message even after applying the patch given above:

libavcodec/i386/mmx.h:24:2: warning: #warning Everything in this header is deprecated, use plain asm()! New code using this header will be rejected.
libavcodec/imgresample.c:607: error: conflicting types for ‘sws_scale’
./libswscale/swscale.h:196: error: previous declaration of ‘sws_scale’ was here
libavcodec/imgresample.c: In function ‘sws_scale’:
libavcodec/imgresample.c:639: warning: implicit declaration of function ‘img_convert’
make: *** [libavcodec/imgresample.o] Error 1

According to ffmpeg-php.sourceforge.net:

ffmpeg-php is not compatible with ffmpeg's swscaler. Enabling swscaler in ffmpeg disables the img_convert functions that ffmpeg-php needs to do its thing. Ffmpeg must be configured and compiled without the '--enable-swscale' flag.

It is unfortunate that FFmpeg's swscaler is enabled by default. Try the following solution:

  1. Edit the following file, using your favorite Linux editor:
    /path_to_ffmpeg_directory/libswscale/swscale.h
  2. Find the following directive, and comment out the declaration of sws_scale.

From:

int sws_scale(struct SwsContext *context, const uint8_t* const srcSlice[], const int srcStride[], int srcSliceY, int srcSliceH, uint8_t* const dst[], const int dstStride[]);

To:

#int sws_scale(struct SwsContext *context, const uint8_t* const srcSlice[], const int srcStride[], int srcSliceY, int srcSliceH, uint8_t* const dst[], const int dstStride[]);

Then run the command /bin/make again to re-compile FFmpeg.

If none of the above solutions worked, and you are one of our clients, login to your account and submit a technical support request.

 
 
Add comment
 
Views: 1079
 
Votes: 0
 
Comments: 0
 

Other articles in this Category

RSS