[FFmpeg-user] compiling ffmpeg with swscale

kev2m at voila.fr kev2m at voila.fr
Tue Jul 10 16:46:45 CEST 2012


For a scholar internship, I need to use ffmpeg and the swscale library. And I think I have trouble with the installation of the swscale library. I'm using Ubuntu 11.10.

I have download the last version of ffmpeg with the command "git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg"
I have configure the installation with the command "./configure --enable-swscale --enable-shared --enable-gpl --enable-libx264 --prefix=/usr/local" (I know a lot of these options are useless, I just add them to be sure...)
Then I "make", "make install" and "ldconfig".
Everything works fine until I try to compile my project.

In my project, we can find these lines :
> #include 

> [...]
> struct SwsContext* convertCtx = sws_getContext(W_fen, H_fen, PIX_FMT_RGB24, W_fen, H_fen, PIX_FMT_YUV420P, SWS_FAST_BILINEAR, NULL, NULL, NULL); 
> [...]
> sws_scale(convertCtx, &image, &srcstride, 0, H_fen, enc->input.img.plane, enc->input.img.i_stride);

When I compile it with the command : 
> g++ -Wl,-O1 -o main main.o mesh.o -L/usr/lib/i386-linux-gnu -L/usr/X11R6/lib -lglut -lQtOpenGL -lQtGui -lQtCore -lGLU -lGL -lpthread -L/usr/local/lib/ -lswscale -lx264

I get the error :
> main.o: In function `dessiner()':
> main.cpp:(.text+0xccb): undefined reference to `sws_getContext(int, int, PixelFormat, int, int, PixelFormat, int, SwsFilter*, SwsFilter*, double const*)'
> main.cpp:(.text+0xd1c): undefined reference to `sws_scale(SwsContext*, unsigned char const* const*, int const*, int, int, unsigned char* const*, int const*)'

And yet, the files /usr/local/include/libswscale/swscale.h and /usr/local/lib/libswscale{.a, .so, .so.2, .so.2.1.100} exist.

I guess (I'm not sure of that) that's because the swscale library is not properly installed. And I would like some advice to install it or to be sure of what the problem is.

Thank you in advance,

Native e-King
Obligatoire au 1er juillet, achetez votre éthylotest sur Voila.fr http://shopping.voila.fr/thematique/ethylotest

More information about the ffmpeg-user mailing list