GithubHelp home page GithubHelp logo

zimbatm / ffmpeg-static Goto Github PK

View Code? Open in Web Editor NEW
495.0 29.0 246.0 92 KB

Scripts to build ffmpeg with all the deps statically (webm + h264 included)

License: ISC License

Shell 71.21% Perl 24.94% Dockerfile 3.85%

ffmpeg-static's Introduction

FFmpeg static build

STATUS: community-supported

Three scripts to make a static build of ffmpeg with all the latest codecs (webm + h264).

Just follow the instructions below. Once you have the build dependencies, run ./build.sh, wait and you should get the ffmpeg binary in target/bin

Build dependencies

# Debian & Ubuntu
$ apt-get install build-essential curl tar libass-dev libtheora-dev libvorbis-dev libtool cmake automake autoconf

# OS X
# 1. install XCode
# 2. install XCode command line tools
# 3. install homebrew
# brew install openssl frei0r sdl2 wget

Build & "install"

$ ./build.sh [-j <jobs>] [-B] [-d]
# ... wait ...
# binaries can be found in ./target/bin/

Ubuntu users can download dependencies and and install in one command:

$ sudo ./build-ubuntu.sh

If you have built ffmpeg before with build.sh, the default behaviour is to keep the previous configuration. If you would like to reconfigure and rebuild all packages, use the -B flag. -d flag will only download and unpack the dependencies but not build.

NOTE: If you're going to use the h264 presets, make sure to copy them along the binaries. For ease, you can put them in your home folder like this:

$ mkdir ~/.ffmpeg
$ cp ./target/share/ffmpeg/*.ffpreset ~/.ffmpeg

Build in docker

$ docker build -t ffmpeg-static .
$ docker run -it ffmpeg-static
$ ./build.sh [-j <jobs>] [-B] [-d]

The binaries will be created in /ffmpeg-static/bin directory. Method of getting them out of the Docker container is up to you. /ffmpeg-static is a Docker volume.

Debug

On the top-level of the project, run:

$ . env.source

You can then enter the source folders and make the compilation yourself

$ cd build/ffmpeg-*
$ ./configure --prefix=$TARGET_DIR #...
# ...

Remaining links

I'm not sure it's a good idea to statically link those, but it probably means the executable won't work across distributions or even across releases.

# On Ubuntu 10.04:
$ ldd ./target/bin/ffmpeg
not a dynamic executable

# on OSX 10.6.4:
$ otool -L ffmpeg
ffmpeg:
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)

Community, bugs and reports

This repository is community-supported. If you make a useful PR then you will be added as a contributor to the repo. All changes are assumed to be licensed under the same license as the project (ISC).

As a contributor you can do whatever you want. Help maintain the scripts, upgrade dependencies and merge other people's PRs. Just be responsible and make an issue if you want to introduce bigger changes so we can discuss them beforehand.

TODO

  • Add some tests to check that video output is correctly generated this would help upgrading the package without too much work
  • OSX's xvidcore does not detect yasm correctly
  • remove remaining libs (?)

Related projects

License

This project is licensed under the ISC. See the LICENSE file for the legalities.

ffmpeg-static's People

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

ffmpeg-static's Issues

libmp3lame compile error

Tested on 32-bit Ubuntu Server 16.04 and 17.04. Gives a bunch of errors like this:

In file included from xmm_quantize_sub.c:37:0:
/usr/lib/gcc/i686-linux-gnu/6/include/xmmintrin.h:895:1: error: inlining failed in call to always_inline '_mm_set_ps1': target specific option mismatch
 _mm_set_ps1 (float __F)
 ^~~~~~~~~~~
xmm_quantize_sub.c:74:21: note: called from here
     vec_sum._m128 = _mm_set_ps1(0);
                     ^~~~~~~~~~~~~~

Disabling libmp3lame in build.sh results in everything being compiled and built nicely.

Build fails on Ubuntu 18.04, gcc-8 (building nasm)

$ ./build-ubuntu.sh

[...snip...]

*** Building nasm ***
gcc -c -I/home/norru/Projects/3rdParty/ffmpeg-static/target/include -L/home/norru/Projects/3rdParty/ffmpeg-static/target/lib -fwrapv -U__STRICT_ANSI__ -fno-common -Werror=attributes -W -Wall -pedantic -Wc90-c99-compat -Wno-long-long -Werror=implicit -Werror=missing-braces -Werror=return-type -Werror=trigraphs -Werror=pointer-arith -Werror=missing-prototypes -Werror=missing-declarations -Werror=comment -Werror=vla -DHAVE_CONFIG_H -I. -I. -I./include -I./include -I./x86 -I./x86 -I./asm -I./asm -I./disasm -I./disasm -I./output -I./output -o asm/nasm.o asm/nasm.c
gcc -c -I/home/norru/Projects/3rdParty/ffmpeg-static/target/include -L/home/norru/Projects/3rdParty/ffmpeg-static/target/lib -fwrapv -U__STRICT_ANSI__ -fno-common -Werror=attributes -W -Wall -pedantic -Wc90-c99-compat -Wno-long-long -Werror=implicit -Werror=missing-braces -Werror=return-type -Werror=trigraphs -Werror=pointer-arith -Werror=missing-prototypes -Werror=missing-declarations -Werror=comment -Werror=vla -DHAVE_CONFIG_H -I. -I. -I./include -I./include -I./x86 -I./x86 -I./asm -I./asm -I./disasm -I./disasm -I./output -I./output -o stdlib/snprintf.o stdlib/snprintf.c
In file included from ./include/nasm.h:44,
                 from asm/nasm.c:48:
./include/nasmlib.h:194:1: error: ‘pure’ attribute on function returning ‘void’ [-Werror=attributes]
 void pure_func seg_init(void);
 ^~~~
In file included from stdlib/snprintf.c:13:
./include/nasmlib.h:194:1: error: ‘pure’ attribute on function returning ‘void’ [-Werror=attributes]
 void pure_func seg_init(void);
 ^~~~


Opus won't link on OSX 10.6.8

By default, I can't get Opus to link on OSX 10.6.8. Seems to be because I didn't have pkg-config installed. I just used homebrew to install it, so not familiar with whether or not it can be included in build.sh. Maybe just update documentation to indicate needing to install it?

build on MacOS

./build.sh -j 4 -B
..........................
install -m 644 libx264.a /Volumes/SD/1/ffmpeg-static/target/lib
ranlib /Volumes/SD/1/ffmpeg-static/target/lib/libx264.a
*** Building x265 ***
rm: ./CMakeFiles/3.13.4: No such file or directory

MacOS: 10.14.3

libpng not building

...
clangclang: : warning: warning: argument unused during compilation: '-L/Users/az/Programmierung/ffmpeg-static/target/lib'argument unused during compilation: '-L/Users/az/Programmierung/ffmpeg-static/target/lib'

In file included from pngerror.c:19:
./pngpriv.h:768:4: error: ZLIB_VERNUM != PNG_ZLIB_VERNUM "-I (include path) error: see the notes in pngpriv.h"
In file included from png.c:14:
./pngpriv.h:768:4: error: ZLIB_VERNUM != PNG_ZLIB_VERNUM "-I (include path) error: see the notes in pngpriv.h"
#  error ZLIB_VERNUM != PNG_ZLIB_VERNUM \
   ^
#  error ZLIB_VERNUM != PNG_ZLIB_VERNUM \
   ^
1 error generated.
make[1]: *** [pngerror.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
1 error generated.
make[1]: *** [png.lo] Error 1
make: *** [all] Error 2

I guess it includes the wrong zlib.h? But why?

Libpng ftp url

The file in FTP ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.2.49.tar.gz is no longer exists please replace it with ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.2.50.tar.gz in ./build.sh

Also change folder name in line 48 at ./build.sh to cd "$BUILD_DIR/libpng-1.2.50" instead of cd "$BUILD_DIR/libpng-1.2.49"

Unsuccessful build on centos

c++: Internal error: Killed (program cc1plus) Please submit a full bug report. See <http://bugzilla.redhat.com/bugzilla> for instructions. make[2]: *** [common/CMakeFiles/common.dir/pixel.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [common/CMakeFiles/common.dir/all] Error 2 make: *** [all] Error 2

I don’t know what caused it.

fixes to work on OSX

To get it building on OSX 10.8 with Xcode 4.5 I had to:

add:

if [ -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk" ]; then
osx_sdk_dir="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"
fi

To of libvpx-v1.0.0/build/make/configure.sh

Change the includes in libvpx-v1.0.0/build/make/gen_asm_deps.sh to:

includes=$(LC_ALL=C egrep -i "include +"[a-z0-9_/]+.${sfx}" $srcfile |

Get the latest libyasm and install it.

And add --cc=clang to the ffmpeg configure line in build.sh

FFmpeg does not build

*** Building FFmpeg ***
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
gcc is unable to create an executable file.
If gcc is a cross-compiler, use the --enable-cross-compile option.
Only do this if you know what cross compiling means.
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 "config.log" produced by configure as this will help
solving the problem.

config.log:

...
check_cc
BEGIN /var/folders/fk/mt9zfm3n2853v1pcy0q3y25h0000gp/T//ffconf.iqXjAyiA.c
    1   int main(void){ return 0; }
END /var/folders/fk/mt9zfm3n2853v1pcy0q3y25h0000gp/T//ffconf.iqXjAyiA.c
gcc -I/Users/az/Programmierung/ffmpeg-static/target/include -I/Users/az/Programmierung/ffmpeg-static/target/include -static --static -c -o /var/folders/fk/mt9zfm3n2853v1pcy0q3y25h0000gp/T//ffconf.pZYEfFwm.o /var/folders/fk/mt9zfm3n2853v1pcy0q3y25h0000gp/T//ffconf.iqXjAyiA.c
gcc -L/Users/az/Programmierung/ffmpeg-static/target/lib -lm -L/Users/az/Programmierung/ffmpeg-static/target/lib -lm -static -o /var/folders/fk/mt9zfm3n2853v1pcy0q3y25h0000gp/T//ffconf.9l7nvoI1 /var/folders/fk/mt9zfm3n2853v1pcy0q3y25h0000gp/T//ffconf.pZYEfFwm.o
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
C compiler test failed.

https support via gnutls (solution inside)

Simply add code below to build.sh and add --enable-gnutls to ffmpeg's configure.

download \
  "gmp-6.1.2.tar.xz" \
  "" \
  "f58fa8001d60c4c77595fbbb62b63c1d" \
  "https://gmplib.org/download/gmp/"


download \
  "nettle-3.3.tar.gz" \
  "" \
  "10f969f78a463704ae73529978148dbe" \
  "https://ftp.gnu.org/gnu/nettle"

download \
  "gnutls-3.5.9.tar.xz" \
  "" \
  "0ab25eb6a1509345dd085bc21a387951" \
  "https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5"

# must be compiled before libnettle                                                                                                                                                                                                           
echo "*** Building libgmp ***"
cd $BUILD_DIR/gmp*
[ $rebuild -eq 1 -a -f Makefile ] && make distclean || true
[ ! -f config.status ] && PATH="$BIN_DIR:$PATH" ./configure --prefix=$TARGET_DIR --bindir=$BIN_DIR --disable-shared  --with-pic
PATH="$BIN_DIR:$PATH" make -j $jval
make install

echo "*** Building libnettle ***"
cd $BUILD_DIR/nettle*
[ $rebuild -eq 1 -a -f Makefile ] && make distclean || true
[ ! -f config.status ] && PATH="$BIN_DIR:$PATH" ./configure --prefix=$TARGET_DIR --bindir=$BIN_DIR --disable-shared --enable-pic
PATH="$BIN_DIR:$PATH" make -j $jval
make install

echo "*** Building libgnutls  ***"
cd $BUILD_DIR/gnutls*
[ $rebuild -eq 1 -a -f Makefile ] && make distclean || true
[ ! -f config.status ] && PATH="$BIN_DIR:$PATH" ./configure --prefix=$TARGET_DIR --bindir=$BIN_DIR --enable-static --disable-shared --with-pic --with-included-libtasn1 --with-included-unistring --without-p11-kit --disable-doc --disable-c\
xx --disable-tools
PATH="$BIN_DIR:$PATH" make -j $jval
make install


Build fails on Debian 11.0 and 12.0

I have tried the install build command and in both Debian 11.0 (Bullseye) and 12.0 (Bookworm) it fails the Ffmpeg static build stage with the same error frei0r.h not found :

...
config.status: executing summary commands
SDL2 Configure Summary:
Building Static Libraries
...
mkdir -p -- /app/ffmpeg-static/target/lib/cmake/SDL2
/usr/bin/install -c -m 644 sdl2-config.cmake /app/ffmpeg-static/target/lib/cmake/SDL2
/usr/bin/install -c -m 644 sdl2-config-version.cmake /app/ffmpeg-static/target/lib/cmake/SDL2
*** Building FFmpeg ***
ERROR: frei0r.h not found

Build error

curl http://downloads.openwrt.org/sources/last_x264.tar.bz2 -I -L
HTTP/1.1 301 Moved Permanently
Server: nginx/1.10.3
Date: Fri, 03 Jan 2020 13:04:39 GMT
Content-Type: text/html
Content-Length: 185
Connection: keep-alive
Location: http://sources.openwrt.org/last_x264.tar.bz2
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, Content-Type, Content-Range, Range

HTTP/1.1 404 Not Found
Server: nginx/1.10.3
Date: Fri, 03 Jan 2020 13:04:40 GMT
Content-Type: text/html
Content-Length: 169
Connection: keep-alive

`set -e` not working?

It seems that a few packages aren't compiling but it just continues:

...
clangclang: : warning: warning: argument unused during compilation: '-L/Users/az/Programmierung/ffmpeg-static/target/lib'argument unused during compilation: '-L/Users/az/Programmierung/ffmpeg-static/target/lib'

In file included from pngerror.c:19:
./pngpriv.h:768:4: error: ZLIB_VERNUM != PNG_ZLIB_VERNUM "-I (include path) error: see the notes in pngpriv.h"
In file included from png.c:14:
./pngpriv.h:768:4: error: ZLIB_VERNUM != PNG_ZLIB_VERNUM "-I (include path) error: see the notes in pngpriv.h"
#  error ZLIB_VERNUM != PNG_ZLIB_VERNUM \
   ^
#  error ZLIB_VERNUM != PNG_ZLIB_VERNUM \
   ^
1 error generated.
make[1]: *** [pngerror.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
1 error generated.
make[1]: *** [png.lo] Error 1
make: *** [all] Error 2
*** Building libogg ***
...

or

...
grammierung/ffmpeg-static/target/lib/libvorbis.a /Users/az/Programmierung/ffmpeg-static/target/lib/libogg.a -lm
undef: ___sincos_stret
Undefined symbols for architecture x86_64:
  "___sincos_stret", referenced from:
      _mdct_init in lto.o
      _drft_init in lto.o
      _dradfg in lto.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [encoder_example] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
*** Building livpx ***
...

or

...
gcc -I/Users/az/Programmierung/ffmpeg-static/target/include -o faac main.o input.o  -L/Users/az/Programmierung/ffmpeg-static/target/lib ../libfaac/.libs/libfaac.a ../common/mp4v2/libmp4v2.a -lm -lstdc++
ld: library not found for -lc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [faac] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
*** Building x264 ***
Unknown option --disable-sha
...

or

...


  D: =build
  C: ./decoder.c
install: mkdir =build: File exists
make: *** [=build] Error 71
make: *** Waiting for unfinished jobs....
clang: warning: argument unused during compilation: '-L/Users/az/Programmierung/ffmpeg-static/target/lib'
*** Building lame ***
...

And some more.

My /bin/sh is GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13). I'm on MacOSX 10.9.

Error on build.sh

When i run over Debian server, shows me that error

--2015-09-09 21:00:36--  http://mirror2.openwrt.org/sources/last_x264.tar.bz2
Resolving mirror2.openwrt.org (mirror2.openwrt.org)... 46.4.11.11
Connecting to mirror2.openwrt.org (mirror2.openwrt.org)|46.4.11.11|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2015-09-09 21:00:36 ERROR 404: Not Found.

Download failed.
--2015-09-09 21:00:36--  http://downloads.openwrt.org/sources/last_x264.tar.bz2
Resolving downloads.openwrt.org (downloads.openwrt.org)... 78.24.191.177
Connecting to downloads.openwrt.org (downloads.openwrt.org)|78.24.191.177|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2015-09-09 21:00:37 ERROR 404: Not Found.

``

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

dockerfile
Dockerfile
  • ubuntu noble

  • Check this box to trigger a request for Renovate to run again on this repository

fontconfig issue

Hi,

I'm getting an error while building on CentOS 7:
configure: error: Either DirectWrite (on Windows), CoreText (on OSX), or Fontconfig (Linux, other) is required. If you really want to compile without a system font provider, add --disable-require-system-font-provider
Thank you.

Maybe need libsndio.a static build?

i tried to build static ffmpeg on lubuntu 17.04 but failed.
Maybe need libsndio.a static build?

LD ffmpeg_g
LD ffprobe_g
libavfilter/libavfilter.a(vf_frei0r.o): In function load_path': /home/kuh3h3/ffmpeg-static/build/FFmpeg-n3.2.4/libavfilter/vf_frei0r.c:174: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libglib-2.0.a(libglib_2_0_la-gutils.o): In function g_get_user_database_entry':
(.text+0x26d): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libglib-2.0.a(libglib_2_0_la-gutils.o): In function g_get_user_database_entry': (.text+0xdc): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libglib-2.0.a(libglib_2_0_la-gutils.o): In function g_get_user_database_entry':
(.text+0x114): warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
libavformat/libavformat.a(rtpproto.o): In function rtp_resolve_host': /home/kuh3h3/ffmpeg-static/build/FFmpeg-n3.2.4/libavformat/rtpproto.c:138: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /home/kuh3h3/ffmpeg-static/target/lib/librtmp.a(rtmp.o): In function add_addr_info.isra.3':
rtmp.c:(.text+0x62c): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
libavdevice/libavdevice.a(sndio_dec.o): In function audio_read_packet': /home/kuh3h3/ffmpeg-static/build/FFmpeg-n3.2.4/libavdevice/sndio_dec.c:68: undefined reference to sio_read'
/home/kuh3h3/ffmpeg-static/build/FFmpeg-n3.2.4/libavdevice/sndio_dec.c:69: undefined reference to sio_eof' libavdevice/libavdevice.a(sndio_enc.o): In function audio_write_trailer':
/home/kuh3h3/ffmpeg-static/build/FFmpeg-n3.2.4/libavdevice/sndio_enc.c:75: undefined reference to sio_write' libavdevice/libavdevice.a(sndio_enc.o): In function audio_write_packet':
/home/kuh3h3/ffmpeg-static/build/FFmpeg-n3.2.4/libavdevice/sndio_enc.c:60: undefined reference to sio_write' /home/kuh3h3/ffmpeg-static/build/FFmpeg-n3.2.4/libavdevice/sndio_enc.c:61: undefined reference to sio_eof'
libavdevice/libavdevice.a(sndio.o): In function ff_sndio_close': /home/kuh3h3/ffmpeg-static/build/FFmpeg-n3.2.4/libavdevice/sndio.c:117: undefined reference to sio_close'
libavdevice/libavdevice.a(sndio.o): In function ff_sndio_open': /home/kuh3h3/ffmpeg-static/build/FFmpeg-n3.2.4/libavdevice/sndio.c:43: undefined reference to sio_open'
/home/kuh3h3/ffmpeg-static/build/FFmpeg-n3.2.4/libavdevice/sndio.c:49: undefined reference to sio_initpar' /home/kuh3h3/ffmpeg-static/build/FFmpeg-n3.2.4/libavdevice/sndio.c:61: undefined reference to sio_setpar'
/home/kuh3h3/ffmpeg-static/build/FFmpeg-n3.2.4/libavdevice/sndio.c:61: undefined reference to sio_getpar' /home/kuh3h3/ffmpeg-static/build/FFmpeg-n3.2.4/libavdevice/sndio.c:92: undefined reference to sio_onmove'
/home/kuh3h3/ffmpeg-static/build/FFmpeg-n3.2.4/libavdevice/sndio.c:94: undefined reference to sio_start' /home/kuh3h3/ffmpeg-static/build/FFmpeg-n3.2.4/libavdevice/sndio.c:107: undefined reference to sio_close'
collect2: error: ld returned 1 exit status
Makefile:131: 'ffmpeg_g' 타겟에 대한 명령이 실패했습니다
make: *** [ffmpeg_g] 오류 1
make: *** 끝나지 않은 작업을 기다리고 있습니다....

There are sed command errors in build.sh

modify bugs in build.sh

line276:
sed -i '' 's/-lgcc_s/-lgcc_eh/g' x265.pc
-->
sed -i 's/-lgcc_s/-lgcc_eh/g' x265.pc

line344:
sed -i "" "s/prefix=./prefix=${TARGET_DIR_SED}/" ./Makefile
-->
sed -i "s/prefix=.
/prefix=${TARGET_DIR_SED}/" ./Makefile

line361:
sed -i "" "s/vidstab SHARED/vidstab STATIC/" ./CMakeLists.txt
-->
sed -i "s/vidstab SHARED/vidstab STATIC/" ./CMakeLists.txt

x265 not supporting 10 and 12 bit

build.sh is executing multilib.sh, but x265 lib is not capable of 10 and 12 bit processing.

Running ffmpeg -h encoder=libx265 shows only support for 8 bit.

Not actually static?

When I run this on a debian jessie machine, and run ldd bin/ffmpeg, it doesn't look like this is actually generating a statically compiled binary. Tons of libraries are getting dynamically linked in.

If it were a totally static binary, ldd would return not a dynamic executable.

I was hoping this project would result in a completely portable 64-bit binary but it doesn't appear to. Have I got this wrong? Thanks in advance.

Option to not rebuid existing binaries

Hi @zimbatm.

I think it would be a welcome addition to have an option to avoid rebuilding existing files. For example, if a build stops before it was partially done, we could avoid recompiling everything by having tar not replace existing files and only run ./configure again if it didn't complete successfully. I've been experimenting with this and it seems to work fine.

The way I see it, there are two ways to implement this: we could make what I described above the default behaviour and provide a full rebuild option (similar to make -B), or the other way around, where the user could request to not rebuild existing binaries. Personally, I would go for the first option because it seems to waste less time, but I was wondering if you have any preference with that.

Thanks,

Andrei

vaapi not working

When I build this, it is static. However vaapi does not seem to work.

I get the following error:

[AVHWDeviceContext @ 0x3282b20] No VA display found for device: /dev/dri/renderD128.
[vaapi @ 0x2940270] Failed to create a VAAPI device

This is on the same machine it was built and vaapi is certainly enabled. The encoders also list the various vaapi based encoders.

If I build a semi static build of ffmpeg on the same machine (vaapi dynamically linked) then it works.

Has anyone encountered similar issues?

Freeze x264 version.

Currently all libraries are fixed on a specific version except for the x264 library for which the "last" snapshot is always downloaded. This means that the ffmpeg build is non-deterministic and the resulting ffmpeg binaries depend on the day on which they were compiled, even though the version of ffmpeg itself is fixed too. Moreover, the whole build can suddenly break if the "last" snapshot of x264 changes something that breaks the current build scheme.

I propose to pick a specific x264 version and stick to it for the time being and only update it manually once in a while under controlled circumstances where it will be possible to verify if the new version breaks something. Given that all snapshots are good, picking any snapshot (even the newest one) will be fine.

prompt ENV_ROOT path

Can add a feature to .sh script to prompt if i can install on pwd or "/usr" paths?

Dynamic builds

This one is counter-intuitive (after all, the repo is "ffmpeg-static"), however, what we have here is a pretty awesome build script that actually works. Because getting a static build is just the matter of enabling the --static ldexeflag, we can consider an option to disable this flag when build.sh is run with -m (dynamic) parameter.

Presets needs to be shared

Only copying the ffmpeg static binary won't do if your need the x264 presets. You can put them in ~/.ffmpeg by default, but another approach is maybe possible ?

NVENC

NVENC is NVidia's hardware encoder that supports H264 and HEVC. It would be neat if ffmpeg was built with --enable-nvenc option so that this encoder can be used in the resulting build.

I already made attempts to enable this and in its current status ffmpeg does compile with --enable-nvenc, the nvenc_hevc and nvenc_h264 encoders are available, but if you try to use them in the static build it results in a segmentation fault. The encoders work fine when the --static ldexeflag is removed, but then the build is dynamic.

Error on ubuntu 13.10 32-bit

sudo apt-get install git build-essential cmake autoconf libtool x264 libx264-dev
git clone https://github.com/pyke369/sffmpeg.git
cd sffmpeg
make
Scanning dependencies of target x264
make[3]: Leaving directory `/home/tester/sffmpeg/build'
make[3]: Entering directory `/home/tester/sffmpeg/build'
[ 71%] Creating directories for 'x264'
[ 72%] Performing download step (git clone) for 'x264'
Cloning into 'x264'...
remote: Counting objects: 17337, done.
remote: Compressing objects: 100% (3622/3622), done.
remote: Total 17337 (delta 14253), reused 16727 (delta 13674)
Receiving objects: 100% (17337/17337), 4.36 MiB | 1.85 MiB/s, done.
Resolving deltas: 100% (14253/14253), done.
Checking connectivity... done
Already on 'master'
[ 72%] Performing patch step for 'x264'
patching file encoder/set.c
Hunk #1 FAILED at 574.
1 out of 1 hunk FAILED -- saving rejects to file encoder/set.c.rej
make[3]: *** [x264-prefix/src/x264-stamp/x264-patch] Error 1
make[3]: Leaving directory `/home/tester/sffmpeg/build'
make[2]: *** [CMakeFiles/x264.dir/all] Error 2
make[2]: Leaving directory `/home/tester/sffmpeg/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/tester/sffmpeg/build'
make: *** [sffmpeg] Error 2

Download errors

$ tar xzvf /media/sde1/home/voltagex/src/ffmpeg-static-master/dl/yasm-1.3.0.tar.gz
--2015-10-15 08:36:30--  http://download.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
Resolving download.videolan.org (download.videolan.org)... 88.191.250.2
Connecting to download.videolan.org (download.videolan.org)|88.191.250.2|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 726062 (709K) [application/octet-stream]
Saving to: ‘STDOUT’

     0K .......... .......... .......... .......... ..........  7%  891K 1s
    50K .......... .......... .......... .......... .......... 14% 1.74M 1s
   100K .......... .......... .......... .......... .......... 21% 1.74M 0s
   150K .......... .......... .......... .......... .......... 28% 1.72M 0s
   200K .......... .......... .......... .......... .......... 35% 1.74M 0s
   250K .......... .......... .......... .......... .......... 42% 1.74M 0s
   300K .......... .......... .......... .......... .......... 49% 1.72M 0s
   350K .......... .......... .......... .......... .......... 56% 1.67M 0s
   400K .......... .......... .......... .......... .......... 63% 1.74M 0s
   450K .......... .......... .......... .......... .......... 70% 1.73M 0s
   500K .......... .......... .......... .......... .......... 77% 1.74M 0s
   550K .......... .......... .......... .......... .......... 84% 1.74M 0s
   600K .......... .......... .......... .......... .......... 91% 1.73M 0s
   650K .......... .......... .......... .......... .......... 98% 1.74M 0s
   700K .........                                             100%  109M=0.4s

2015-10-15 08:36:31 (1.64 MB/s) - written to stdout [726062/726062]

MD5 sum of the downloaded file does not match (file: f40642763bd979fea44c5c3fd73e00f0, requested: 2b712f196293bd04f4241e4f218e102d) - deleting download.
--2015-10-15 08:36:31--  http://mirror2.openwrt.org/sources/last_x264.tar.bz2
Resolving mirror2.openwrt.org (mirror2.openwrt.org)... 46.4.11.11
Connecting to mirror2.openwrt.org (mirror2.openwrt.org)|46.4.11.11|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2015-10-15 08:36:31 ERROR 404: Not Found.

Download failed.
--2015-10-15 08:36:31--  http://downloads.openwrt.org/sources/last_x264.tar.bz2
Resolving downloads.openwrt.org (downloads.openwrt.org)... 78.24.191.177
Connecting to downloads.openwrt.org (downloads.openwrt.org)|78.24.191.177|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2015-10-15 08:36:31 ERROR 404: Not Found.

Download failed.
No more mirrors to try - giving up.

libpulse static

helo sir, first thanks for your partage ,
can you add libpulse static on your build ?
thanks

Vorbis audio encoder. Requires libogg.

*** Could not run Ogg test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means Ogg was incorrectly installed
*** or that you have moved Ogg since it was installed.
configure: error: must have Ogg installed!

Docker build fails - missing c2man

Following the docker instructions verbatim, the build fails due to missing c2man.

checking sys/times.h usability... yes
checking sys/times.h presence... yes
checking for sys/times.h... yes
checking for an ANSI C-conforming const... yes
checking for preprocessor stringizing operator... yes
checking size of int... 4
checking size of short... 2
checking size of void *... 8
checking size of wchar_t... 4
checking for gcc... gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking how to run the C preprocessor... gcc -E
checking for memmove... yes
checking for memset... yes
checking for strdup... yes
checking return type of signal handlers... void
checking for c2man... no
configure: error: c2man is required to build documentation

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.