I am trying to build ffmpeg with libx264 support. Configure and compilation is successful but when I am running the ffmpeg the application is crashing.
ffmpeg configure option : ./configure --enable-static --enable-libx264 --enable-pthreads --enable-gpl --disable-doc --enable-memalign-hack --extra-ldflags="-L/usr/local/lib"
gcc --version 4.3.4
Here is gdb dump,
$gdb ffmpeg_g.exe
GNU gdb(GDB) 7.2
Copyright(c) 2010 Free Software Foundation
This GDB has configured as mingw32
Reading symbols from C:\work\ffmpeg25jan2011\ffmpeg\ffmpeg_g.exe.....done
(gdb) break main
BreakPoint 1 at 0x40a120 : file ffmpeg.c, line 4317
(gdb) run -V
Starting program: C:\work\ffmpeg25jan2011\ffmpeg\ffmpeg_g.exe
[New Thread]
gdb: Unknown Target exception 0xc0000022 at 0x7c96671e
**During startup program exited with code 0xc0000022**
Anybody has any clue, How this can be resolved?
Windows error code 0xc0000022 means "The Application Failed to initialize." It usually indicates that your build is broken. There are lots of things that could have gone wrong, but here are some things to check:
You should build all libraries you link to with the same toolchain. It may be possible to link a Cygwin-built ffmpeg to a VC++-built libx264, but since there's no good reason to do that, you shouldn't.
Try the "head" version of ffmpeg and its dependencies from the source repository
You show Windows paths, but claim to be using Cygwin. Try to use an all-Cygwin environment: build from a Cygwin bash shell, use POSIX paths, etc. In particular, this will help ensure that libraries get installed in places the build tools can find them.
You may need to install some libraries in /usr/lib, rather than the default, /usr/local/lib.
Try a complete rebuild: make clean && make
Related
I'm building ffmpeg version 5.0.1 from source, but for some reason I don't get it to cross-compile against aarch64 as I want to run ffmpeg on a Khadas VIM4 which is a ARMv8 CPU, to be specific the CPU is an Amlogic A311D2 with non-free codecs..
To build ffmpeg from source, I have setup a build-suite put together from various sources which currently works fine with x86_64 and can be obtained here: https://github.com/venomone/ffmpeg_build_suite
Simply run trigger.sh from the terminal, make sure docker is installed on your host if you are interested. The script will output ffprobe and ffmpeg in a folder called /build
From my understanding, the ffmpeg configuration part must get extended by the following lines:
--enable-cross-compile \
--target-os=linux \
--arch=arm64 \
--cross-prefix=aarch64-linux-gnu- \
--enable-shared \
But even with these settings, I'm running into the following error:
#11 938.3 aarch64-linux-gnu-gcc is unable to create an executable file.
#11 938.3 C compiler test failed.
Is somebody able to provide me a hint, what might be the problem here?
all I am trying to --enable-protocol=SRT of ffmpeg. What I do as the following:
1.Check current configuration of ffmpeg which shows it doesn't suppport protocol of SRT.
2.So I trying to use msys64 to compile ffmpeg with --enable-protocol=SRT,and the command
$ ./configure --toolchain=msvc --arch=x64 --enable-yasm --enable-asm --enable-shared --enable-protocol=SRT
but the result as the following:
it's showing that the config is no use.Can you help me,thanks!
SRT is provided via an external library, so you'll need that library available for linking via pkg-config.
configure flags are --enable-protocol=libsrt --enable-libsrt. The former flag is only needed if you have disabled all components or protocols. Won't hurt to keep it, though.
Summary: when I try cross-compiling a .go source file that includes a C file somewhere in the file chain, targeting Windows AMD64 from a Mac host, I get:
/usr/local/go/src/runtime/cgo/gcc_windows_amd64.c:8:10: fatal error: 'windows.h' file not found
Purely Go code seems to cross compile without error; is there a way to get the proper header files for cross compilation when C files are involved?
More details: I installed LiteIDE on my Mac for working on some .go projects, and LiteIDE makes it relatively simple to target other platforms as build targets. I tested it on a small test project I had, purely Go, and it seemed to run without error.
Later I tried it on a current, larger project and had to adjust several env settings in the IDE to get it to work (complaints about C files without CGO enabled, and GOPATH not set properly even though it's set in .bash_profile and verified in echo $VARIABLE just fine.) The result is
/usr/local/go/src/runtime/cgo/gcc_windows_amd64.c:8:10: fatal error: 'windows.h' file not found
Trying to target Linux (os linux, arch amd64) gives
# runtime/cgo
ld: unknown option: --build-id=none
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've double checked I have XCode installed; gcc is installed:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr with-gxx-include- dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
...and Go is the latest version:
go version go1.6.2 darwin/amd64
I also checked that this isn't just from LiteIDE (since LiteIDE seems to override env settings and ignore what's in the terminal?); an example attempt at the console gives:
MyUsername$ env GOOS=windows GOARCH=amd64 CGO_ENABLED=1 go build -v
golang.org/x/net/html/atom
runtime/cgo
golang.org/x/crypto/ssh/terminal
golang.org/x/net/html
github.com/howeyc/gopass
# runtime/cgo
/usr/local/go/src/runtime/cgo/gcc_windows_amd64.c:8:10: fatal error: 'windows.h' file not found
github.com/andybalholm/cascadia
github.com/PuerkitoBio/goquery
I suspect this is because the application uses networking libraries in Go and I think the native libraries are still calling some C files to fill in gaps. Is there a way to get the proper libraries for building on Linux/Windows or does this need to be done on the target platforms in order to work?
Building native applications on the host platform seems to work without issue.
To enable cross-compiling for CGO you need to have a local toolchain that can compile C code for that target.
I'm not very familiar with Mac OS X, but on Arch Linux all I had to do was install mingw-w64-toolchain and compile my go code with:
env GOOS="windows" GOARCH="386" CGO_ENABLED="1" CC="i686-w64-mingw32-gcc" go build
// or to target win 64
env GOOS="windows" GOARCH="amd64" CGO_ENABLED="1" CC="x86_64-w64-mingw32-gcc" go build
On OSX, you can install mingw with homebrew: brew install mingw-w64
About the other error message though, ld: unknown option: --build-id=none seems like a bug, you might want to report that on the Go issue tracker.
I am building ffmpeg on ubuntu. I could able to build yasm-1.2.0, and next i tried building x264. x264 requires minumum of yasm-1.2.0, Hence i tried the below command to build x264.
./configure --prefix=<myprefix> --bindir=<mybindir> --extracflgs=<Include directory of yasm-1.2.0> --extra-ldflags=<libdirectory of yasm-1.2.0>
I got the below error:
No working C compiler found.
Not sure what error i commited. Could someone kindly tell me what do i have to do?
You misuse --extra-cflags and --extra-ldflags options and so C compiler gives you error (you can look at exact error in config.log file). This are additional flags that are passed to GCC (C compiler) and have nothing to do with YASM (assembler). All what you need to do with YASM is to have it in one of the $PATH directories i.e. it should run in shell/console from any current working dir with simple yasm --version.
While installing ffmpeg on Ubuntu 12.04
I am getting following error
libavcodec/libavcodec.a(libx264.o): In function `X264_init':
/root/ffmpeg/libavcodec/libx264.c:492: undefined reference to `x264_encoder_open_125'
collect2: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1
I am following the instructions given at
http://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide
Do anyone have idea about this error?
This is a typical problem for people who already have x264 installed through the package management system. You can solve this in at least 2 ways:
Uninstall the already existing x264 from your system, through the package management system:
# apt-get remove x264
and compile your new x264 from source
Don't uninstall the x264 package, but compile your new x264 and then compile your ffmpeg, telling it to use that newly compiled x264 library, by specifying that directory where your compiled x264 library is, using the mentioned LD_LIBRARY_PATH environment variable:
LD_LIBRARY_PATH=/path/to/my/compiled/x264/library ./configure --enable-libx264 ...
More info can be found on these links:
problem with --enable-libx264 option in ffmpeg
Compiling FFmpeg
add the header and lib path
gcc x264_test1.c -o x264_encoder -I/usr/local/include -L/usr/local/lib -lpthread -lm -lx264
Generally the error means that the library binary libx264.so picked up by the linker does not match the version in the header file x264.h. See the following lines of code in this header file:
/* Force a link error in the case of linking against an incompatible API version.
* Glue #defines exist to force correct macro expansion; the final output of the macro
* is x264_encoder_open_##X264_BUILD (for purposes of dlopen). */
#define x264_encoder_glue1(x,y) x##y
#define x264_encoder_glue2(x,y) x264_encoder_glue1(x,y)
#define x264_encoder_open x264_encoder_glue2(x264_encoder_open_,X264_BUILD)
The solution usually does not require building libx264 yourself,
just make sure that you installed libx264-dev properly without interference with other versions, which may also be in /usr/local/lib or the like.
I had the same issue with version 155:
undefined reference to 'x264_encoder_open_155'.
In my case this was because I had in /usr/lib/x86_64-linux-gnu and unsuitable copy of libx264.so (which I had produced myself and uncleanly copied there).
So all I had to do was sudo apt-get install --reinstall libx264-dev.