Coder Social home page Coder Social logo

wang-bin / avbuild Goto Github PK

View Code? Open in Web Editor NEW
525.0 40.0 105.0 895 KB

ffmpeg花式编译. build tool for all platforms: iOS, android, raspberry pi, win32, uwp, linux, macOS etc.

Home Page: https://sourceforge.net/projects/avbuild/files

License: GNU Lesser General Public License v3.0

Shell 89.87% Batchfile 10.13%
ffmpeg ios android msvc mingw clang windows-phone macos linux raspberry-pi

avbuild's Introduction

It's a tool to build ffmpeg for almost all platforms.

How: https://github.com/wang-bin/avbuild/wiki

Download prebuilt packages

Totoal Downloads

Lite build of FFmpeg master branch (recommended):

Android, iOS, macOS, Linux, VS2022 Desktop, VS2022 UWP, Clang Windows Desktop

FFmpeg releases and others: https://sourceforge.net/projects/avbuild/files

Build Details:

Linux, android, macOS, iOS, raspberry pi(legacy OSes), windows build:Build status github Build Status, CircleCI

Features

  • Support single FFmpeg shared library: ffmpeg.dll, libffmpeg.so, libffmpeg.dylib
  • modern toolchain support: clang+lld, cross build for almost all platforms on any host OS
  • multiple targets build and configure simultaneously
  • ssl
  • enable all gpu decoders and encoders if possible
  • nvidia driver version is not limited(nvcuvid, nvdec, nvenc)
  • ffmpeg patches
  • Universal binaries for apple platforms, including apple sillicon support

Build Matrix

CC/H?X/OS Linux Android macOS iOS RPi Win32 WinStore WinPhone
Clang H C A+H A+C H+C
Clang+LLD H C ? A+H+C A+H+C.
MINGW or VCRT120+
A+H+C A+C
GCC H C H H+C H+C
VS2013/15 H H C
VS2017+ H H
  • A: Apple clang
  • H: host build. Clang is open source clang
  • C: cross build (for example, build win32 from linux/macOS using mingw, build rpi from windows/linux/macOS using gcc and clang)
  • ?: in plan
  • Empty: won't support

TODO

  • Azure pipeline/github action: vs2022+WSL

avbuild's People

Contributors

0xfelix avatar wang-bin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

avbuild's Issues

Cross build using mingw fails on both MSYS2 and Ubuntu 16.04

Having successfully built FFmpeg 2.1.5 on Ubuntu 16.04, I installed mingw (sudo apt-get install mingw-w64) and issued the build command given in the wiki (./avbuild.sh mingw x86_64) and the script fails quickly with the following output:

FFmpeg build tool for all platforms. Author: [email protected] 2013-2018
https://github.com/wang-bin/avbuild
Usage:
  export FFSRC=/path/to/ffmpeg
./avbuild.sh [target_platform [target_architecture[-clang*/gcc*]]]
target_platform can be: ios|android|rpi|sunxi|vc|win|winrt|uwp|winphone|mingw
target_architecture can be: x86, x86_64, armv5, armv6, armv7, armv8, arm64
Build for host if no parameter is set.
Use a shortcut in tools dir if build for windows using MSVC.
Environment vars: USE_TOOLCHAIN(clang, gcc etc.), USE_LD(clang, lld etc.), USER_OPT, ANDROID_NDK, SYSROOT, ONECORE(="onecore")
Add options via USER_OPT, ${platform}_OPT
config.sh and config-.sh is automatically included. config-lite.sh is for building smaller libraries.
FFSRC=ffmpeg-src
/home/nick/project/ffmpeg-lgpl/avbuild-master
PATH: /home/nick/project/ffmpeg-lgpl/avbuild-master/ffmpeg-src:/home/nick/project/ffmpeg-lgpl/avbuild-master/tools/gas-preprocessor:/home/nick/bin:/home/nick/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
/home/nick/project/ffmpeg-lgpl/avbuild-master
FFmpeg/Libav version: 2.1  git: false
>>>>>archs: x86_64
waiting for all configure jobs(1) finished...
mingw cross build for x86_64
Package libmfx was not found in the pkg-config search path.
Perhaps you should add the directory containing `libmfx.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libmfx' found
INSTALL_DIR: sdk-mingw-x86_64-gcc
configure --extra-version=QtAV --disable-doc --disable-debug --enable-shared --enable-runtime-cpudetect --disable-iconv --enable-avresample --disable-postproc --enable-cross-compile --cross-prefix=x86_64-w64-mingw32- --target-os=mingw64 --arch=x86_64 --enable-pic --extra-ldflags="-static-libgcc -Wl,-Bstatic"
configuration changes
Unknown OS 'mingw64'.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.

real	0m0.192s
user	0m0.158s
sys	0m0.057s
x86_64-w64-mingw32-gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -std=c99 -D_LARGEFILE_SOURCE -c -o /tmp/ffconf.9zTYmDBy.o /tmp/ffconf.nIG1bqww.c
check_host_cflags -std=c99
check_host_cc -std=c99
BEGIN /tmp/ffconf.nIG1bqww.c
    1	int x;
END /tmp/ffconf.nIG1bqww.c
gcc -O3 -g -std=c99 -c -o /tmp/ffconf.9zTYmDBy.o /tmp/ffconf.nIG1bqww.c
check_host_cflags -Wall
check_host_cc -Wall
BEGIN /tmp/ffconf.nIG1bqww.c
    1	int x;
END /tmp/ffconf.nIG1bqww.c
gcc -O3 -g -std=c99 -Wall -c -o /tmp/ffconf.9zTYmDBy.o /tmp/ffconf.nIG1bqww.c
check_code cc  int test[2*(sizeof(void *) > 4) - 1]
check_cc
BEGIN /tmp/ffconf.nIG1bqww.c
    1	int main(void) { int test[2*(sizeof(void *) > 4) - 1]; return 0; }
END /tmp/ffconf.nIG1bqww.c
x86_64-w64-mingw32-gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -std=c99 -c -o /tmp/ffconf.9zTYmDBy.o /tmp/ffconf.nIG1bqww.c
Unknown OS 'mingw64'.

Installed MSYS2 on Windows 10, Installed requisites as instructed using pacman, issued the build command given in the wiki (./avbuild.sh) and it fails with the following output:

FFmpeg build tool for all platforms. Author: [email protected] 2013-2018
https://github.com/wang-bin/avbuild
Usage:
  export FFSRC=/path/to/ffmpeg
./avbuild.sh [target_platform [target_architecture[-clang*/gcc*]]]
target_platform can be: ios|android|rpi|sunxi|vc|win|winrt|uwp|winphone|mingw
target_architecture can be: x86, x86_64, armv5, armv6, armv7, armv8, arm64
Build for host if no parameter is set.
Use a shortcut in tools dir if build for windows using MSVC.
Environment vars: USE_TOOLCHAIN(clang, gcc etc.), USE_LD(clang, lld etc.), USER_OPT, ANDROID_NDK, SYSROOT, ONECORE(="onecore")
Add options via USER_OPT, ${platform}_OPT
config.sh and config-.sh is automatically included. config-lite.sh is for building smaller libraries.
FFSRC=ffmpeg-src
/home/Nick/avbuild-master
PATH: /home/Nick/avbuild-master/ffmpeg-src:/home/Nick/avbuild-master/tools/gas-preprocessor:/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/
/home/Nick/avbuild-master
FFmpeg/Libav version: 2.1  git: false
install msys2 packages: pacman -Sy --needed make diffutils gawk patch pkg-config nasm yasm gcc
./avbuild.sh: line 596: gcc: command not found
mingw host build for
mingw cross build for
Package libmfx was not found in the pkg-config search path.
Perhaps you should add the directory containing `libmfx.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libmfx' found
INSTALL_DIR: sdk-mingw--gcc
configure --extra-version=QtAV --disable-doc --disable-debug --enable-shared --enable-runtime-cpudetect --disable-iconv --enable-avresample --disable-postproc --cc=-w64-mingw32-gcc --target-os=mingw --enable-cross-compile --cross-prefix=-w64-mingw32- --target-os=mingw --arch= --enable-pic --extra-ldflags="-static-libgcc -Wl,-Bstatic"
configuration changes
Must specify target arch and OS when cross-compiling

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.

real    0m3.969s
user    0m0.579s
sys     0m1.358s
yop_decoder=yes
yop_demuxer=yes
yuv4_decoder=yes
yuv4_encoder=yes
yuv4mpegpipe_demuxer=yes
yuv4mpegpipe_muxer=yes
zero12v_decoder=yes
zerocodec_decoder=yes
zerocodec_decoder_select=zlib
zlib_decoder=yes
zlib_decoder_select=zlib
zlib_encoder=yes
zlib_encoder_select=zlib
zmbv_decoder=yes
zmbv_decoder_select=zlib
zmbv_encoder=yes
zmbv_encoder_select=zlib
zmq_filter=yes
zmq_filter_deps=libzmq
Must specify target arch and OS when cross-compiling

If I instead use ./avbuild.sh mingw x86_64 it fails the same way as with linux above.

Attempted this in Windows using VS2015 as well:

bash
export FFSRC=ffmpeg-src
./avbuild.sh

...results in a linux build.

./avbuild.sh vc

...fails with 'c/configure: c99wrap: not found'

Is there any help you can give to get me on the way to create a windows 64 bit build of my required version of FFmpeg?

Sets NDK_ROOT automatically

Although I have specified NDK_ROOT before your script "config-android.sh" overwrites my value. I had to remove the statement to use my own NDK_ROOT path.

MacOS builds successfully but fails at runtime with Symbol not found: _av_get_dict

I'm using the libraries with QtAV on MacOS SDK 10.12. Building against FFmpeg 4.1 is successful but fails during execution with symbol not found. Another user with similar setup wang-bin/QtAV#1161 has the same problem.

The issue seems to be resolved by removing -flat_namespace EXTRA_LDFLAGS inside avbuild.sh setup_macos_env(). This was introduced in 24b7098.

Do you happen to remember the original purpose of the flag? From Apple's documentation, it "Changes from a two-level to a single-level (flat) namespace." Not sure how its removal will affect QtAV, if at all.

Errors on glibc when trying to link with FFmpeg builds for Linux

Using the builds ffmpeg-4.2-linux-gcc-lite.tar.xz and ffmpeg-4.1-linux-gcc-lite.tar.xz for Linux in sourceforge gives me this error related to glibc:

libavcodec.so: undefined reference to `powf@GLIBC_2.27'
libavformat.so: undefined reference to `glob64@GLIBC_2.27'
libavcodec.so: undefined reference to `log2f@GLIBC_2.27'
libavcodec.so: undefined reference to `expf@GLIBC_2.27'
libavcodec.so: undefined reference to `exp2f@GLIBC_2.27'
libavcodec.so: undefined reference to `logf@GLIBC_2.27'

Where as using ffmpeg-4.0.3-linux-gcc-lite.tar.xz compiles normally.
It seems that the newer versions are built against glibc 2.27, while I have glibc 2.23 on my Ubuntu 16.04. Is there any solution to this?

Cannot build armv7-clang with Android NDK r19

STEPS TO REPRODUCE:

  1. Install Android NDK r19c and ffmpeg 3.4.6
  2. Run ./avbuild.sh android19 "armv7-clang"

ERROR LOG:

https://github.com/wang-bin/avbuild
Usage:
  export FFSRC=/path/to/ffmpeg
./avbuild.sh [target_platform [target_architecture[-clang*/gcc*]]]
target_platform can be: ios|android|rpi|sunxi|vc|win|winrt|uwp|winphone|mingw
target_architecture can be: x86, x86_64, armv5, armv6, armv7, armv8, arm64
Build for host if no parameter is set.
Use a shortcut in tools dir if build for windows using MSVC.
Environment vars: USE_TOOLCHAIN(clang, gcc etc.), USE_LD(clang, lld etc.), USER_OPT, ANDROID_NDK, SYSROOT, ONECORE(="onecore")
Add options via USER_OPT, ${platform}_OPT
config.sh and config-.sh is automatically included. config-lite.sh is for building smaller libraries.
FFSRC=ffmpeg-3.4.6
/Users/alex/37
PATH: /Users/alex/37/ffmpeg-3.4.6:/Users/alex/37/tools/gas-preprocessor:/Users/alex/Library/Android/sdk/platform-tools:/Users/alex/Library/Android/sdk/build-tools/28.0.3:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
FFmpeg/Libav version: 3.4  git: false
/Users/alex/37
>>>>>archs: armv7-clang
waiting for all configure jobs(1) finished...
g++: , clang++: /Users/alex/Projects/Android/android-ndk-r19c/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ IS_CLANG:true, ld_lld: /Users/alex/Projects/Android/android-ndk-r19c/toolchains/llvm/prebuilt/darwin-x86_64/bin/ld.lld
./avbuild.sh: line 226: lld: command not found
compiler is clang: true, apple clang: false, cl: false, have lld: true
ANDROID_TOOLCHAIN_DIR=
ANDROID_LLVM_DIR=/Users/alex/Projects/Android/android-ndk-r19c/toolchains/llvm/prebuilt/darwin-x86_64/
lto is disabled when build static libs to get better compatibility
INSTALL_DIR: sdk-android-armv7-clang
configure --extra-version=QtAV --disable-doc --disable-debug --enable-shared --enable-runtime-cpudetect --enable-mediacodec --enable-jni --disable-v4l2_m2m --disable-indevs --enable-indev=android_camera --disable-outdevs --enable-avresample --disable-postproc --enable-thumb --enable-neon --target-os=android --arch=arm --enable-cross-compile --cross-prefix=arm-linux-androideabi- --cc=clang --extra-ldexeflags="-Wl,--gc-sections -Wl,-z,nocopyreloc -pie -fPIE" --enable-pic --extra-cflags="-fPIC -Wa,--noexecstack -fdata-sections -ffunction-sections -fstack-protector-strong -ffast-math -fstrict-aliasing -march=armv7-a -mtune=cortex-a8 -mfloat-abi=softfp -mfpu=vfpv3-d16 -D__ANDROID_API__=19 --sysroot $SYSROOT -iwithsysroot /usr/include/arm-linux-androideabi -fno-integrated-as -gcc-toolchain $NDK_ROOT/ --target=armv7a-linux-androideabi19" --extra-ldflags="-Wl,--gc-sections -Wl,-z,relro -Wl,-z,now --sysroot $NDK_ROOT/platforms/android-19/arch-arm -fuse-ld=lld -rtlib=compiler-rt --target=armv7a-linux-androideabi19" --disable-shared --enable-static --disable-everything --disable-ffplay --disable-ffmpeg --disable-ffprobe --disable-avfilter --disable-avdevice --enable-decoder=hevc,h264,mjpeg,mpeg4,wmv3,amrnb,aac,adpcm_ima_wav --enable-demuxer=hevc,h264,rtsp,asf,hls,flv,mjpeg --enable-parser=hevc,h264,mpegvideo,mjpeg --enable-protocol=tcp,mmsh,rtmp,hls --enable-network
export PATH=/bin:/Users/alex/Projects/Android/android-ndk-r19c/toolchains/llvm/prebuilt/darwin-x86_64//bin:/Users/alex/37/ffmpeg-3.4.6:/Users/alex/37/tools/gas-preprocessor:/Users/alex/Library/Android/sdk/platform-tools:/Users/alex/Library/Android/sdk/build-tools/28.0.3:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
configuration changes
clang is unable to create an executable file.
C compiler test failed.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.

real	0m2.586s
user	0m1.220s
sys	0m1.185s
1 error generated.
check_cpp_condition stddef.h defined __ARM_ARCH_7A__ || defined __TARGET_ARCH_7_A
check_cpp
BEGIN /var/folders/j0/g_fng2pn6_z9x7bpbvhd2b8c0000gn/T//ffconf.bCvGxKH0/test.c
    1	#include <stddef.h>
    2	#if !(defined __ARM_ARCH_7A__ || defined __TARGET_ARCH_7_A)
    3	#error "unsatisfied condition: defined __ARM_ARCH_7A__ || defined __TARGET_ARCH_7_A"
    4	#endif
END /var/folders/j0/g_fng2pn6_z9x7bpbvhd2b8c0000gn/T//ffconf.bCvGxKH0/test.c
clang -fPIC -Wa,--noexecstack -fdata-sections -ffunction-sections -fstack-protector-strong -ffast-math -fstrict-aliasing -march=armv7-a -mtune=cortex-a8 -mfloat-abi=softfp -mfpu=vfpv3-d16 -D__ANDROID_API__=19 --sysroot /Users/alex/Projects/Android/android-ndk-r19c/sysroot -iwithsysroot /usr/include/arm-linux-androideabi -fno-integrated-as -gcc-toolchain /Users/alex/Projects/Android/android-ndk-r19c/ --target=armv7a-linux-androideabi19 -E -o /var/folders/j0/g_fng2pn6_z9x7bpbvhd2b8c0000gn/T//ffconf.bCvGxKH0/test.o /var/folders/j0/g_fng2pn6_z9x7bpbvhd2b8c0000gn/T//ffconf.bCvGxKH0/test.c
clang: warning: argument unused during compilation: '-Wa,--noexecstack' [-Wunused-command-line-argument]
check_ld cc
check_cc
BEGIN /var/folders/j0/g_fng2pn6_z9x7bpbvhd2b8c0000gn/T//ffconf.bCvGxKH0/test.c
    1	int main(void){ return 0; }
END /var/folders/j0/g_fng2pn6_z9x7bpbvhd2b8c0000gn/T//ffconf.bCvGxKH0/test.c
clang -fPIC -Wa,--noexecstack -fdata-sections -ffunction-sections -fstack-protector-strong -ffast-math -fstrict-aliasing -march=armv7-a -mtune=cortex-a8 -mfloat-abi=softfp -mfpu=vfpv3-d16 -D__ANDROID_API__=19 --sysroot /Users/alex/Projects/Android/android-ndk-r19c/sysroot -iwithsysroot /usr/include/arm-linux-androideabi -fno-integrated-as -gcc-toolchain /Users/alex/Projects/Android/android-ndk-r19c/ --target=armv7a-linux-androideabi19 -march=armv7-a -c -o /var/folders/j0/g_fng2pn6_z9x7bpbvhd2b8c0000gn/T//ffconf.bCvGxKH0/test.o /var/folders/j0/g_fng2pn6_z9x7bpbvhd2b8c0000gn/T//ffconf.bCvGxKH0/test.c
clang: error: unsupported option '--noexecstack'
clang: error: assembler command failed with exit code 1 (use -v to see invocation)
C compiler test failed.```

ADDITIONAL NOTES:
1. `./avbuild.sh android19 "armv7-clang"` works with Android r18 perfectly.
2. No problems when compiling arm64-clang, x86-clang, x86_64-clang against Android r19.
 

Unable to create mkv containers on Android using lite version

When using the built FFmpeg 4.2 Lite on Windows and Linux I can create mkv containers using avformat_alloc_output_context2. But using the built FFmpeg 4.2 Lite (armeabi-v7a) on Android, trying to create mkv containers for the same video gives me error:

[FFmpeg:NULL] Unable to find a suitable output format for '/data/data/Sample/files/1.mkv'

But using mp4 is fine on Android. Is this feature for mkv turned off for Android?

Recent sysroot build failure

Thanks for this great build tool!
I think your recent commit 5fd5204 broke my build. It will complain about the sysroot, which is also changed in the commit. Could you tell me whether I am using your tool wrong?

FFSRC=/home/user/FFmpeg ./avbuild.sh android21 arm64

I think this is the interesing part of the log:

>>>>>archs: arm64
waiting for all configure jobs(1) finished...
g++: /opt/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-g++, clang++: /opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ IS_CLANG:false, ld_lld: /opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/ld.lld, as: /opt/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-as
./avbuild.sh: line 228: lld: command not found
compiler is clang: true, apple clang: false, cl: false, have lld: true
ANDROID_GCC_DIR=/opt/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/
ANDROID_LLVM_DIR=/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/
ls: cannot access '/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64//sysroot': No such file or directory
lto is disabled when build static libs to get better compatibility
INSTALL_DIR: sdk-android-arm64-clang
configure --extra-version=QtAV --disable-doc --disable-debug --enable-shared --enable-runtime-cpudetect --enable-mediacodec --enable-jni --disable-v4l2-m2m --disable-indevs --enable-indev=android_camera --disable-outdevs --enable-avresample --disable-postproc --target-os=android --arch=arm64 --enable-cross-compile --cross-prefix=aarch64-linux-android- --cc=clang --extra-ldexeflags="-Wl,--gc-sections -Wl,-z,nocopyreloc -pie -fPIE " --enable-pic --extra-cflags="-Wa,--noexecstack -fdata-sections -ffunction-sections -fstack-protector-strong -ffast-math -fstrict-aliasing -D__ANDROID_API__=21 --sysroot $SYSROOT -iwithsysroot /usr/include/aarch64-linux-android --target=aarch64-none-linux-android21" --extra-ldflags="-Wl,--gc-sections -Wl,-z,relro -Wl,-z,now --sysroot $SYSROOT -fuse-ld=lld -rtlib=compiler-rt --target=aarch64-none-linux-android21"
export PATH=/opt/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64//bin:/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64//bin:/home/user/FFmpeg:/home/user/avbuild/tools/gas-preprocessor:/opt/cmake/bin:/opt/Qt/5.13.2/android_aarch64/bin:/opt/android-sdk/tools:/opt/android-sdk/tools/bin:/opt/android-sdk/platform-tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
configuration changes
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
clang is unable to create an executable file.
C compiler test failed.

If you are interested, you can view the full build log here: https://gitlab.com/caspermeijn/docker-images/-/jobs/430747103

【疑问】FFmpeg的调用约定是什么?

我想使用C#调用FFmpeg,但是不知道FFmpeg的调用约定是什么?

备注:我看过FFmpeg的头文件,没有见到调用约定的关键字和导入导出C函数的关键字。

error build ffmpeg for android ndk r16

Hi,
it is impossible to build ffmpeg for android with ndk r16.
the error is the following:
fatal error: jni.h: No such file or directory
#include <jni.h>

with r15c it is possible.
Thanks

想问下这个脚本适合ndk r19吗

遇到报错
/bin/sh: error while loading shared libraries: libc.so.6: cannot open shared object file: Error 24
应该是找不到库,我的环境就配置了俩:

export FFSRC=../ffmpeg-4.1
export ANDROID_NDK=../android-ndk-r19
./avbuild.sh android "armv7"

Not working

Getting error :

FFmpeg build tool for all platforms. Author: [email protected] 2013-2016
Usage:
  export FFSRC=/path/to/ffmpeg
  ./build_ffmpeg.sh [ios|android|maemo5|maemo6|vc|x86|winstore|winpc|winphone [arch]]
(optional) set var in config-xxx.sh, xxx is ios, android, maemo5, maemo6, vc, x86, winstore, winpc, winphone
var can be: INSTALL_DIR, NDK_ROOT, MAEMO5_SYSROOT, MAEMO6_SYSROOT
FFSRC=../ffmpeg
  --enable-videotoolbox    enable VideoToolbox code [autodetect]
/Users/ChristopheCVB/Downloads/ffmpeg/ffmpeg_builder
FFmpeg/Libav version: 3.0
ANDROID_TOOLCHAIN_DIR=/tmp/ndk-arm-linux-androideabi-4.9
TOOLCHAIN_OPT= --enable-thumb --enable-neon
--enable-shared --disable-static
../../ffmpeg/configure --extra-version=QtAV --disable-doc --disable-debug --enable-shared --disable-static --enable-pic --enable-runtime-cpudetect --disable-muxers --disable-encoders --disable-avdevice --enable-hwaccels --enable-avresample --disable-postproc --enable-cross-compile --cross-prefix=arm-linux-androideabi- --sysroot=/tmp/ndk-arm-linux-androideabi-4.9/sysroot --target-os=android --arch=arm --enable-thumb --enable-neon --enable-lto --extra-cflags=" -ffast-math -fstrict-aliasing -Werror=strict-aliasing -Wa,--noexecstack -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16"
/Users/ChristopheCVB/Downloads/ffmpeg/ffmpeg_builder/build_sdk-android-arm
Out of tree builds are impossible with config.h in source dir.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solve the problem.

real    0m0.070s
user    0m0.044s
sys 0m0.023s

要启用GuardCF,链接器也需要传一个参数

如果想要启用GuardCF这个特性,不仅需要给编译器传/guard:cf这个参数,链接器也需要传一个相同的参数/guard:cf,链接器缺少这个参数的话这个特性其实是没有启用的。

从下面的两幅图片也可以看出,图一是MDK自带的ffmpeg,就是用这个仓库的脚本编译的,我看了您写的脚本,发现您已经传了-guard:cf-cfguard参数,看得出来您是想启用这个特性的,但是您没有给链接器也传这个参数,所以实际上最终得到的文件是没有启用这个特性的。

而图二是我自己用clang-cl + lld-link编译的ANGLE,从图里能看到,特性里多了GuardCF这个关键词,这才是真正启用了,而您自己编译的不管是MDK还是ffmpeg,都没有这个关键词,也就是都没有真正启用这个特性。

picture1

picture2

Android SSL problem

Hi and thanks for this project.
When I called https urls, I get SSL errors. How can I build ffmpeg for android with SSL support?

multiple architectures as script arguments

archs are separated by +. appends -compiler to switch compiler.

./avbuild.sh ios                       # use default archs: armv7+arm64+x86+x86_64
./avbuild.sh android                   # use default archs: gcc armv5+armv7+arm64+x86
./avbuild.sh android armv7+arm64-clang # use gcc armv7 and clang arm64

ios.sh can be removed.

Windows编译ffmpeg报错

按以下步骤在windows平台下编译ffmpeg报错。

  1. 通过msys2_shell.cmd 启动 msys2
  2. cd到avbuild目录,执行./avbuild.sh mingw "x86_64"
    报以下错误
    configure --extra-version=QtAV --disable-doc --disable-debug --enable-shared --enable-runtime-cpudetect --disable-iconv --disable-postproc --cc=x86_64-w64-mingw32-gcc --target-os=mingw64 --enable-pic --extra-ldflags="-static-libgcc -Wl,-Bstatic" --enable-gpl --enable-nonfree --enable-version3
    .env.sh: line 1: syntax error near unexpected token (' .env.sh: line 1: export PATH=/mingw64/bin:/mingw64/bin:/d/Code/OpenSource/ffmpeg/ffmpeg-4.2.3:/d/code/opensource/avbuild/tools/gas-preprocessor:/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64:/c/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/VC/VCPackages:/c/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/TestWindow:/c/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer:/c/Program Files (x86)/Microsoft Visual Studio/2017/Community/MSBuild/15.0/bin/Roslyn:/c/Program Files (x86)/Microsoft Visual Studio/2017/Community/Team Tools/Performance Tools/x64:/c/Program Files (x86)/Microsoft Visual Studio/2017/Community/Team Tools/Performance Tools:/c/Program Files (x86)/Microsoft Visual Studio/Shared/Common/VSPerfCollectionTools/x64:/c/Program Files (x86)/Microsoft Visual Studio/Shared/Common/VSPerfCollectionTools:/c/Program Files (x86)/Microsoft SDKs/Windows/v10.0A/bin/NETFX 4.6.1 Tools/x64:/c/Program Files (x86)/HTML Help Workshop:/c/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x64:/c/Program Files (x86)/Windows Kits/10/bin/x64:/c/Program Files (x86)/Microsoft Visual Studio/2017/Community/MSBuild/15.0/bin:/c/Windows/Microsoft.NET/Framework64/v4.0.30319:/c/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE:/c/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/Tools:/c/Python39/Scripts:/c/Python39:/c/Program Files (x86)/IntelSWTools/Intel(R) Media SDK 2020 R1/Software Development Kit/bin/x64:/c/Program Files (x86)/IntelSWTools/Intel(R) Media SDK 2020 R1/Software Development Kit/bin/win32:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1/bin:/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1/libnvvp:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/c/Program Files/CMake/bin:/c/Program Files/Git/cmd:/c/Program Files/TortoiseGit/bin:/c/Program Files/dotnet:/d/gstreamer/1.0/msvc_x86_64/bin:/c/Program Files/NVIDIA Corporation/NVSMI:/c/Program Files/NVIDIA Corporation/Nsight Compute 2020.2.0:/c/ProgramData/chocolatey/bin:/c/Program Files (x86)/nodejs:/c/Program Files/TortoiseSVN/bin:/c/Users/25218/AppData/Local/Microsoft/WindowsApps:/d/gstreamer/1.0/msvc_x86_64/bin:/c/Users/25218/AppData/Local/Programs/Microsoft VS Code/bin:/c/Program Files/JetBrains/PyCharm Community Edition 2021.1.1/bin:/c/Users/25218/AppData/Roaming/npm:/c/Program Files (x86)/Windows Kits/10/bin/x64:/c/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin:/c/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl'
    configuration changes
    Out of tree builds are impossible with config.h in source dir.

building for Windows from macOS, Clang+LLD

Hello to you all, can someone give me some hints?

My macOS host build works fine. Now I am trying to make build for Windows and I am out of ideas how to proceed. I managed (hopefully successfully) integrate lld-link as I can see it in the log being used --ld="/Users/matousvencl/projects/llvm/build/bin/lld-link ".

I wonder what those two options do:

-DEFAULTLIB:msvcrt" 
--extra-libs="oldnames.lib"

as I can see there is error related to them in the log:

lld-link: error: could not open oldnames.lib: No such file or directory
lld-link: error: could not open msvcrt.lib: No such file or directory
FFmpeg build tool for all platforms. Author: [email protected] 2013-2018
https://github.com/wang-bin/avbuild
Usage:
  export FFSRC=/path/to/ffmpeg
./avbuild.sh [target_platform [target_architecture[-clang*/gcc*]]]
target_platform can be: ios|android|rpi|sunxi|vc|win|winrt|uwp|winphone|mingw
target_architecture can be: x86, x86_64, armv5, armv6, armv7, armv8, arm64
Build for host if no parameter is set.
Use a shortcut in tools dir if build for windows using MSVC.
Environment vars: USE_TOOLCHAIN(clang, gcc etc.), USE_LD(clang, lld etc.), USER_OPT, ANDROID_NDK, SYSROOT, ONECORE(="onecore")
Add options via USER_OPT, ${platform}_OPT
config.sh and config-.sh is automatically included. config-lite.sh is for building smaller libraries.
FFSRC=../FFmpeg
/Users/matousvencl/projects/avbuild
PATH: /Users/matousvencl/projects/FFmpeg:/Users/matousvencl/projects/avbuild/tools/gas-preprocessor:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/CMake.app/Contents/bin:/Users/matousvencl/projects/llvm/build/bin:/Users/matousvencl/.nvm/versions/node/v10.6.0/bin
/Users/matousvencl/projects/avbuild
FFmpeg/Libav version: 3.4  git: false
>>>>>archs: x86
waiting for all configure jobs(1) finished...
compiler is clang: true, apple clang: true, cl: false, have lld: true
compiler is clang: true, apple clang: true, cl: false, have lld: true
using (clang)lld as linker...
IS_STORE=false
PKG_CONFIG_PATH_MFX_UNIX= PKG_CONFIG_PATH_MFX=
Package libmfx was not found in the pkg-config search path.
Perhaps you should add the directory containing `libmfx.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libmfx' found
INSTALL_DIR: sdk-win7-x86-clang
configure --extra-version=QtAV --disable-doc --disable-debug --enable-shared --enable-runtime-cpudetect --enable-avresample --disable-postproc --ar=llvm-ar --nm=llvm-nm --ranlib=llvm-ranlib --cc=clang --ld="/Users/matousvencl/projects/llvm/build/bin/lld-link " --enable-cross-compile --arch=x86 --target-os=win32 --enable-pic --extra-cflags="-flto --target=i386-pc-windows-msvc19 -DWIN32 -D_WIN32 -D_WIN32_WINNT=0x0600 -Wno-nonportable-include-path -Wno-deprecated-declarations" --extra-ldflags="-MACHINE:x86 -OPT:REF -SUBSYSTEM:CONSOLE -NODEFAULTLIB:libcmt -DEFAULTLIB:msvcrt" --extra-libs="oldnames.lib" --enable-small --disable-symver --disable-swscale-alpha --disable-doc --disable-ffplay --disable-ffprobe --disable-avdevice --disable-network --disable-postproc --disable-filters --enable-filter=aresample --disable-muxers --enable-muxer=mp4 --disable-demuxers --enable-demuxer=matroska --disable-encoders --enable-encoder=aac,mpeg4 --disable-decoders --enable-decoder=opus,vp8 --disable-parsers --enable-parser=opus,vp8
export INCLUDE="/include;/Include//shared;/Include//ucrt;/Include//um;/Include//winrt"
export LIB="/lib//x86/;/Lib//ucrt/x86;/Lib//um/x86"
export AR=llvm-ar
export NM=llvm-nm
export V=1 # FFmpeg BUG: AR is overriden in common.mak and becomes an invalid command in makedef(@printf is works in makefiles but not sh scripts)
configuration changes
clang is unable to create an executable file.
C compiler test failed.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.

real    0m3.844s
user    0m1.425s
sys     0m2.082s
zlib=yes
zlib_decoder_select=zlib
zlib_encoder_select=zlib
zmbv_decoder_select=zlib
zmbv_encoder_select=zlib
zmq_filter_deps=libzmq
zoompan_filter_deps=swscale
zscale_filter_deps='libzimg const_nan'
mktemp -u XXXXXX
UCsi4J
check_ld cc
check_cc
BEGIN /var/folders/sz/183fs_x10k95t9np3nybh9w40000gp/T//ffconf.trUosmA0/test.c
    1   int main(void){ return 0; }
END /var/folders/sz/183fs_x10k95t9np3nybh9w40000gp/T//ffconf.trUosmA0/test.c
clang -flto --target=i386-pc-windows-msvc19 -DWIN32 -D_WIN32 -D_WIN32_WINNT=0x0600 -Wno-nonportable-include-path -Wno-deprecated-declarations -c -o /var/folders/sz/183fs_x10k95t9np3nybh9w40000gp/T//ffconf.trUosmA0/test.o /var/folders/sz/183fs_x10k95t9np3nybh9w40000gp/T//ffconf.trUosmA0/test.c
/Users/matousvencl/projects/llvm/build/bin/lld-link -MACHINE:x86 -OPT:REF -SUBSYSTEM:CONSOLE -NODEFAULTLIB:libcmt -DEFAULTLIB:msvcrt -out:/var/folders/sz/183fs_x10k95t9np3nybh9w40000gp/T//ffconf.trUosmA0/test.exe /var/folders/sz/183fs_x10k95t9np3nybh9w40000gp/T//ffconf.trUosmA0/test.o oldnames.lib
lld-link: error: could not open oldnames.lib: No such file or directory
lld-link: error: could not open msvcrt.lib: No such file or directory
C compiler test failed.

Build for android

Hello,

What does these tools build ? a library or an executable ? Also does it use GPL parts of ffmpeg or only LGPL ?

I need to build FFMPEG for a commercial product on Android but the ones on the internet are built for android using GPL source code, and are not up to date (current one i use is 2.4 version)

Thanks in advance

FFmpeg changed the version.sh script to ffbuild sub dir

FFmpeg moved version.sh to ffbuild sub dir in version 4.1, the avbuild.sh script will not run correctly when excute under mac osx. To solve this, change the script to following will work:

cd $FFSRC
if [ -e `version.sh` ];
then
FFVERSION_FULL=`./ffbuild/version.sh`
FFMAJOR=`./ffbuild/version.sh |sed 's,[a-zA-Z]*\([0-9]*\)\..*,\1,'`
FFMINOR=`./ffbuild/version.sh |sed 's,[a-zA-Z]*[0-9]*\.\([0-9]*\).*,\1,'`
else
FFVERSION_FULL=`./version.sh`
FFMAJOR=`./version.sh |sed 's,[a-zA-Z]*\([0-9]*\)\..*,\1,'`
FFMINOR=`./version.sh |sed 's,[a-zA-Z]*[0-9]*\.\([0-9]*\).*,\1,'`
fi
FFGIT=false

android gcc如何编译?

以下是输入的命令:
export FFSRC=D:/zzxs/codes/FFmpeg-master ./avbuild.sh android "armv7-gcc"

sh文件中添加:
USE_TOOLCHAIN = gcc ANDROID_GCC_DIR=D:/UserApps/Programs/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/arm-linux-androideabi/bin

build失败,如下:
configuration changes clang is unable to create an executable file. C compiler test failed. ...... ...... /d/zzxs/codes/FFmpeg-master/configure: line 984: clang: command not found C compiler test failed.

创建了文件夹:build_sdk-android-armv7-clang

请问armv7-gcc如何正确编译?

android上无法使用硬解

在avcodec_open2时返回错误 "Generic error in an external library"

src: ffmepg release 4.1
ndk: r19
api-level: 19

arm-linux-androideabi-gcc: not found

I downloaded fresh FFmpeg and placed it in avbuild folder.
I downloaded fresh Android NDK for linux and set ANDROID_NDK env var.

Shortly after I call:
./avbuild.sh android "armv7"

I get this error:
/home/maxest/Desktop/avbuild-master/ffmpeg/configure: 952: /home/maxest/Desktop/avbuild-master/ffmpeg/configure: arm-linux-androideabi-gcc: not found
C compiler test failed.

config-macos10.14.4.sh enable ffplay not work

hi super man :
I want to build ffmpeg with ffplay ,but not work, I add config-macos10.14.4.sh in ./avbuild/

USER_OPT="--enable-small --disable-avresample \
--disable-filters \
--enable-filter=*fade,*fifo,*format,*resample,aeval,all*,atempo,color*,convolution,draw*,eq*,framerate,hw*,null,volume \
--disable-muxers \
--disable-encoders \
--disable-decoders \
--enable-decoder=*sub*,*text*,*web*,aac*,ac3*,alac*,ape,ass,cc_dec,cook,dca,eac3*,truehd,flv,flac,gif,h264*,hevc*,mp[1-3]*,*peg*,mlp,mpl2,nellymoser,opus,pcm*,rawvideo,rv*,sami,srt,ssa,v210*,vc1*,vorbis,vp[6-9],wm*,wrapped_avframe \
--disable-demuxers \
--enable-demuxer=*sub*,*text*,*ac3,*ac,*peg*,*web*,ape,ass,avi,concat,dts*,*dash*,*flv,gif,hls,h264,hevc,matroska,mlv,mov,mp3,mxf,nsv,nut,ogg,pcm*,rawvideo,rt*p,spdif,srt,vc1,v210*,wav,*pipe \
--disable-parsers --enable-parser=*sub*,aac*,ac3,cook,flac,h26[3-4],hevc,m*,opus,rv*,vc1,vorbis,vp[8-9] \
--enable-ffplay \
$USER_OPT
"
ENC_OPT="--enable-encoder=aac,gif,h26[3-4]*,hevc*,mjpeg,mpeg[2-4]*,nellymoser,nvenc*,opus,pcm*,rawvideo,vorbis,vp*,wrapped_avframe"
MUX_OPT="--enable-muxer=dash,fifo,flv,gif,h264,hevc,hls,mjpeg,matroska*,mov,mp4,mpegts,nu*,og*,pcm*,rawvideo,spdif,wav,webm,*pipe"
ENC_OPT_MOBILE="--enable-encoder=aac,gif,h264*,nellymoser,opus,pcm*"
MUX_OPT_MOBILE="--enable-muxer=gif,hls,mov,mp4,mpegts,wav"
#android_OPT="--disable-avdevice"

only add one line

--enable-ffplay \

and compile with command

./avbuild.sh macos10.14.4 "x86_64"

as a success result find no ffplay command

image

can't I build ffmpeg with ffplay for macos ?

dlopen failed: invalid ELF file android

Hi,
when I use the master prebuilt libraries I have the following error
dlopen failed: invalid ELF file /usr/arm64/libswscale.so.
I don't have this error with the 4.2 libraries.
I need the master because I have to compile for x86_64 for android and in 4.2 prebuilt zip there are not the x86_64 libs.
Thank you very much
Angelo

Issue Adding FFmpeg to Android Studio

Hello,

I added the prebuilt package to my Android project and I got this error below. I placed the file in the jnilib directory also in other places but it is not picking it up. Below I am sending you my gradle file. Do you know what the issue may be?

CANNOT LINK EXECUTABLE "/data/user/0/com.github.hiteshsondhi88.sampleffmpeg/files/ffmpeg": library "libavdevice.so" not found

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: "com.jfrog.bintray"

// This is the library version used when deploying the artifact
version = VERSION_NAME

android {
compileSdkVersion 28
buildToolsVersion rootProject.ext.buildToolsVersion as String
defaultConfig {
minSdkVersion 19
targetSdkVersion 28
versionName rootProject.ext.versionName as String
}
sourceSets.main {
assets.srcDirs = ['assets']
jni.srcDirs = [] //disable automatic ndk-build
jniLibs.srcDirs = ['libs']
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildToolsVersion '27.0.3'
productFlavors {
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile 'com.squareup.assertj:assertj-android:1.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
implementation 'com.android.support.constraint:constraint-layout:2.0.0-alpha1'
implementation 'com.android.support:design:28.0.0-rc01'
implementation 'com.android.support.test:runner:1.0.2'
implementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:design:28.0.0-rc01'
}

group = GROUP

install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging POM_PACKAGING

            // Add your description here
            name 'FFmpeg Android'
            description = POM_DESCRIPTION
            url POM_URL

            // Set your license
            licenses {
                license {
                    name POM_LICENCE_NAME
                    url POM_LICENCE_URL
                }
            }
            developers {
                developer {
                    id POM_DEVELOPER_ID
                    name POM_DEVELOPER_NAME
                    email '[email protected]'
                }
            }
            scm {
                connection POM_SCM_URL
                developerConnection POM_SCM_URL
                url POM_URL

            }
        }
    }
}

}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

// https://github.com/bintray/gradle-bintray-plugin
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")

configurations = ['archives']
pkg {
    repo = "maven"
    // it is the name that appears in bintray when logged
    name = "ffmpeg-android"
    websiteUrl = POM_URL
    vcsUrl = POM_SCM_URL
    licenses = ["GPL-3.0"]
    publish = true
    version {
        gpg {
            sign = true
            passphrase = properties.getProperty("bintray.gpg.password")
        }
        mavenCentralSync {
            sync = true
            user = properties.getProperty("bintray.oss.user") //OSS user token
            password = properties.getProperty("bintray.oss.password") //OSS user password
            close = '1'
        }
    }
}

}

Build failed under macos Mojave

grep: /source.properties: No such file or directory
grep: /source.properties: No such file or directory
./avbuild.sh: line 777: [: -gt: unary operator expected
grep: /source.properties: No such file or directory
./avbuild.sh: line 777: [: -gt: unary operator expected
./avbuild.sh: line 777: [: -gt: unary operator expected
find: /toolchains/llvm/prebuilt: No such file or directory
g++: , clang++: IS_CLANG:true, ld_lld: , as:
find: /toolchains/llvm/prebuilt: No such file or directory
find: /toolchains/llvm/prebuilt: No such file or directory
g++: , clang++: IS_CLANG:true, ld_lld: , as:
g++: , clang++: IS_CLANG:true, ld_lld: , as:
./avbuild.sh: line 226: -print-prog-name=lld: command not found
./avbuild.sh: line 228: -flavor: command not found
./avbuild.sh: line 230: -print-prog-name=ld.lld: command not found
./avbuild.sh: line 231: -flavor: command not found
compiler is clang: true, apple clang: false, cl: false, have lld: false
ANDROID_GCC_DIR=
ANDROID_LLVM_DIR=
./avbuild.sh: line 226: -print-prog-name=lld: command not found
./avbuild.sh: line 226: -print-prog-name=lld: command not found
./avbuild.sh: line 228: -flavor: command not found
./avbuild.sh: line 228: -flavor: command not found
./avbuild.sh: line 230: -print-prog-name=ld.lld: command not found
./avbuild.sh: line 230: -print-prog-name=ld.lld: command not found
./avbuild.sh: line 231: -flavor: command not found
./avbuild.sh: line 231: -flavor: command not found

No OS X build option?

Trying to build QtAV with FFmpeg with libx264 enabled. But I can't seem to find option for OS X? Why? And how do I enable specific codecs?

Thank you!

Android arch x86_64 cannot be used

Your script expects the path "android-ndk-r12b/toolchains/x86_64-linux-android-4.8". The NDK path is actually "android-ndk-r12b/toolchains/x86_64-4.8", so it does not find the compiler. For the arch "aarch64" it works since here the folder has your specified path in the NDK.

ffmpeg4.2 Android arm64-v8a 版本无法加载libswscale 报错:invalid ELF file

参考:https://stackoverflow.com/questions/60850313/invalid-elf-file
我遇到了和如上链接相同的错误:
我按照WIKI上Android的编译步骤,成功编译出了arm64-v8a 和 armeabi-v7a版本的 QtAV so库
其中 armeabi-v7a 能够正常加载并且运行一切正常
后来我需要把编译的目标 ABI 切换到 arm64-v8a 发现这个错误,起初怀疑是下载的so库有问题,后来重新下载了ffmpeg4.2的两个目前最新的版本:ffmpeg-4.2-android.tar.xz 和 ffmpeg-4.2-android-lite.tar.xz
报错都是和上边一样的,怀疑是libswscale这个库arm64编译出的文件或编译配置有问题?求助如何能够解决此问题。
java.lang.UnsatisfiedLinkError: dlopen failed: invalid ELF file “/data/app/xxxx.xxxx/lib/arm64/libswscale.so” load segment[4]: p_offset (0x6f000) + p_filesz (0x0) ( = 0x6f000) past end of file (0x6e910)
at java.lang.Runtime.load0(Runtime.java:928)
at java.lang.System.load(System.java:1633)
at org.qtproject.qt5.android.QtNative$2.run(QtNative.java:199)
at org.qtproject.qt5.android.QtThread$2.run(QtThread.java:87)
at org.qtproject.qt5.android.QtThread$1.run(QtThread.java:61)
at java.lang.Thread.run(Thread.java:764)

build ffmpeg and after QtAV with clang

Hi, I want to know if it is possible to compile ffmpeg with your script avbuild.sh and after QtAV with clang for android.
In ndk r14 gcc is deprecated and it is impossible to compile ffmpeg with gcc.
Thank you very much
Angelo

pkg-config uses wrong prefix

Hi, thanks for the great build scripts.
I use avbuild to build ffmpeg for android. I want to use pkgconfig to find the libraries, however the pkgconfig files use /usr/local as the prefix instead of the actual path where the libraries are installed.
I can fix it by running the following command, but I would prefer it to be fixed upstream :-)
sed -i 's#/usr/local#/home/user/avbuild/sdk-android-armv7-clang#g' /home/user/avbuild/sdk-android-armv7-clang/lib/pkgconfig/*

windows-desktop的静态库不能用了

今年五六月份我曾经用过您编译的静态库,能完美使用,但最新的不行了。

最近您更新的静态库,突然就需要libmfx了,而且不链接这个库会报错,必须要链接它,但我明确记得以前是不用链接这个库的。

我使用的是您上传的libmfx,Qt是我自己编译的静态版,QtAV和自带的examples都能编译成功,但都无法正常运行,打开是能打开,但只要播放媒体文件就会立即崩溃。无法上传日志,因为来不及写入日志,程序就崩了,日志文件都是空的。我曾经试过英特尔官网的libmfx,也能正常编译,但同样会崩掉。

我感觉应该不是Qt配置的问题,我编译时用的都是默认的配置,opengl 是 dynamic,VC运行时是 -MD。而且编译其他程序都没问题,运行也都很正常。难道与VS版本有关?我用的是最新版的VS2017(目前是15.8.8),但VS2017已经更新好几次了,每次重新编译的程序都会崩掉,感觉跟VS版本也没多大关系。

CONFIG += static_ffmpeg 我加上了,而且看编译后的二进制文件大小,ffmpeg应该是链接进去了的,这个没什么问题,就是程序总是会崩掉。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.