I use this to configure ffmpeg:
./configure --enable-shared --enable-yasm --enable-openssl --enable-gpl --enable-libx264 --prefix=/mnt/newdatadrive/apps/ffmpeg/ffmpeg-master
But it returned a error:
OpenSSL <3.0.0 is incompatible with the gpl
But i need both of them, how to resolve this?
It seems to be that openSSL 3.0 is not compatible with GPL 2.0. My guess is that you should try using GPL 3.0 or higher instead. The issue seems to be that the apache license is not compatible with GPL 2.0.
You can try using --enable-gpl with --enable-version3 build params which should help.
You can try using --enable-nonfree as well. Not sure if this is useful though
You should consider looking into ./configure --help for more details on what you're doing.
Try to Use.
./configure --enable-shared --enable-yasm --enable-openssl --enable-gpl --enable-libx264 --enable-nonfree --prefix=/mnt/newdatadrive/apps/ffmpeg/ffmpeg-master
Related
I'am trying to run the LibSourcey to use the Webrtc Streaming Server.
The thing is that i can't seem to make it work.
I struggled to cmake the project on my Ubuntu 16.04(Regexp in cmake files) but now its fixed .
The problem that i actually got is a shared object bug at compiling time :
usr/bin/ld: /home/kimmie/ffmpeg_build/lib/libswresample.a(options.o):
relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object;
recompile with -fPIC
/home/kimmie/ffmpeg_build/lib/libswresample.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
av/CMakeFiles/av.dir/build.make:783: recipe for target 'av/libscy_av.so.1.0.2' failed
Any help would be very much appreciated as i don't know what to do now.
I hit this same error on Ubuntu 16.04.
I ended up recompiling FFmpeg with flags to build the shared libraries. Following the code example boxes in the FFmpeg Compilation Guide, I added the following two flags to the ./configure lines where applicable:
--enable-pic
--enable-shared
I removed the --disable-shared flags as well.
I added --enable-pic and --enable-shared to every component and removed the flag if it returned a message that it was unrecognized for that component. At least libx264, libfdk-acc, and libmp3lame needed --enable-shared. And then for the final FFmpeg (copy and pasted from FFmpeg guide linked to above):
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
--prefix="$HOME/ffmpeg_build" \
--pkg-config-flags="--static" \
--extra-cflags="-I$HOME/ffmpeg_build/include" \
--extra-ldflags="-L$HOME/ffmpeg_build/lib" \
--bindir="$HOME/bin" \
--enable-gpl \
--enable-libass \
--enable-libfdk-aac \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopus \
--enable-libtheora \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--enable-nonfree \
--enable-pic \
--enable-shared
Note the last two lines in my example are different than the FFmpeg
guide.
After you do all of that, it's probably best to delete the Libsourcey source and build folder and start over with that.
It took me about 4-5 days off and on to finally compile and successfully build Libsourcey with FFmpeg and WebRTC dependencies. I hit some other snags as well, so be sure to tag me if you have other questions. Note: I am noob at Linux building and not solid on all of the concepts; this is just what worked for me and perhaps it will work for you.
You have a linkage error, not a compilation error. You haven't run into a bug,
you have just attempted a linkage that cannot work.
You are trying to build a shared library libscy_av.so. All the object
files that are linked in a shared library must consist of Position Independent
Code. To generate
such an object file with gcc, you compile with the option -fPIC.
The linker discovers that your shared libary requires the object file
options.o, which is a member of the static library libswresample.a. It then
discovers that this options.o is not PIC, and so cannot be linked in
a shared library. The linkage fails and the linker advises you that
options.o must be recompiled with the -fPIC compiler option.
To comply with that advice, you would have to rebuild the static library libswresample.a from source, with -fPIC added to the compiler flags.
You might do that, but it is unusual for object files in a static library to
be PIC, and there is an easier option. Your mistake was in linking against
the static version of libswresample (libswresample.a) rather than the
shared version (libswresample.so), which will be PIC. Just correct that mistake. If you install
libswresample.a from a dev package provided by your package manager, then
it will also provide libswresample.so. If you have built libswresample
from source, then the build system will also build both.
ffmpeg build configuration is such that I have disabled everything and selectively enabled decoders and encoders and demuxers for the formats that I need. I want to use the vorbis_parser.h for parsing the extradata, I tried using the --enable-parser=vorbis but this does not work. In the include folder of libavcodec there shows no file named vorbis_parser.h. What option should I set so that I can use vorbis_parser.h
As far as i know, the ./configure script for ffmpeg looks like this :
./configure --prefix="$HOME/ffmpeg_build" \
--extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
--bindir="$HOME/bin" --extra-libs="-ldl" --enable-gpl --enable-libass --enable-libfdk-aac \
--enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx \
--enable-libx264 --enable-nonfree --enable-x11grab
(Source : http://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide)
To me it seems like you just have to --enable-gpl and --enable-libvorbis in your ./configure script.
Nevertheless there may be options to be enabled and disabled in the libvorbis ./configure script. I hope this may help.
Have a nice day ;)
I realized that the functions beginning with avpriv are the private functions of the FFmpeg and those are not included in the header files that are exposed. So probably we cannot include the file vorbis_parser.h
Does anybody know how can I build libav static libraries (.lib) for use them in my projects?
Before compiling LibAV one needs to configure LibAV by 'configure' script. Use '--enable-static' :
./configure --enable-static
The script 'configure' generates make-files according to chosen or default parameters, example of LibAV configuration parameters:
./configure --target-os=mingw32 --arch=x86 --enable-shared --enable-static --enable-dxva2 --disable-encoders --enable-hwaccel=dxva2 --extra-cflags=-O3 --enable-pthreads
I get this error when attempting to compile ffmpeg on a 64bit CentOS machine.
Here are my ./configure options:
./configure --enable-shared --enable-gpl --enable-nonfree --enable-postproc --enable-swscale --enable-pthreads --enable-libx264 --enable-libxvid --enable-libvorbis --enable-libfaac --enable-libmp3lame --enable-libvpx
make
I get the following error when compiling the source:
/usr/bin/ld: /usr/local/lib/libvpx.a(vpx_codec.c.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libvpx.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libavcodec/libavcodec.so.54] Error 1
How do I get around this error, and get libvpx up and running with the latest ffmpeg on my 64-bit CentOS box?
Since you configured FFMPEG with "--enable-shared", you also need to configure some of it's other libraries with "--enable-shared" also, and they must all use the same setting.
This error message is basically telling you to compile libvpx again with "--enable-shared" added to the configure command, then try compiling FFMPEG again (also configured with "--enable-shared"). Chances are that you will then get the same error but it will say "libx264" or "libmp3lame" instead of "libvpx", so you will also need to recompile those libs with "--enable-shared" in the configure command.
I got a similar error while compiling ffmpeg on an x86_64 machine running Oracle Linux 6.3. Oracle Linux is based on Red Hat and is thus similar to CentOS in the original question.
configure:
./configure --enable-shared --enable-nonfree --enable-libmp3lame --enable-libfaac --enable-libx264 --enable-encoder=x264 --enable-gpl
make:
/usr/bin/ld: /usr/local/lib/libx264.a(common.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libx264.a: could not read symbols: Bad value
In my case, this answer, although partly specific to Ubuntu, shed more light on the underlying issue with respect to x86_64 systems in general:
"I believe if you enable-shared on FFmpeg you have to do the same on
x264 on x86_64 systems, otherwise you'll have a PIC shared FFmpeg and
non-PIC static x264."
The fix was to ensure the x264 sources which I originally compiled using the "--enable-static" flag with configure (which generated "/usr/local/lib/libx264.a") was re-compiled using the "--enable-shared" flag which generates the correct target of "/usr/local/lib/libx264.so":
1st Attempt:
1. cd /tmp
2. wget ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
3. tar xfv last_x264.tar.bz2;
4. cd x264-snapshot-xxxxxx
5. ./configure --enable-static
6. make && make install
2nd Attempt:
1. cd /tmp/x264-snapshot-xxxxxx
2. make distclean
3. ./configure --enable-shared
4. make && make install
Try
CFLAGS=-fPIC ./configure ...<your config options>...
To add the flag that the error mentions is missing.
(And the question is...?)
Shared libraries must be composed of PIC object code, but ffmpeg failed to do so.
Did you compile your libvpx with --shared and -fPIC so it generated libvpx.so*?
If not, you can try comment #6 and #7 in this issue.
I had this problem in MythTV build with libx264.a
I downloaded and built as Saheed suggested.
The only thing is that /usr/local/lib/libx264.a was not changed when I did "make install". I had to do "make install-lib-static"
How can I add SPEEX support to my FFMPEG installation? I need to extract the audio from a FLV created by FMS.
I just installed it using: app-get install ffmpeg.
ffmpeg -version
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm --enable-dc1394 --disable-debug --enable-shared --prefix=/usr
libavutil version: 1d.49.3.0
libavcodec version: 1d.51.38.0
libavformat version: 1d.51.10.0
built on Apr 23 2010 15:11:13, gcc: 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
ffmpeg SVN-rUNKNOWN
libavutil 3212032
libavcodec 3352064
libavformat 3344896
I could get it working without libspeex. I found that if I don't change the mix rate of the flash/flex application, I can extract the audio from it using mp3lame!!!