Discussion:
[FFmpeg-user] Minimal ffmpeg build
Moritz Barsnick
2015-08-14 09:23:20 UTC
Permalink
Hi,
I'm trying to reproduce a segmentation fault in ffmpeg, and thought
that I'd build a minimal ffmpeg, just for the fun of it (and ruling out
other influences).

There have been quite a few tips on this list, and I have seen some on
the net, but I can never seem to move past anything which builds
(only) libavutil. :-P

My configure command:
$ ./configure --disable-all --enable-ffmpeg --enable-protocol=file --enable-demuxer=mov --enable-muxer=mp4 --enable-bsf=h264_mp4toannexb

Its output is at the end of the mail, config.log is attached.

I also explicitly tried adding "--enable-avcodec --enable-avfilter
--enable-avformat --enable-swresample", to no avail.

I note in config.log that it does say:
ffmpeg=yes
ffmpeg_deps='avcodec avfilter avformat swresample'

but somewhere else:
avcodec=no
avcodec_deps=avutil

(and no to all the other dependencies), meaning those ffmpeg_deps
aren't picked up by the configure script?

Why are the ffmpeg_deps not being picked up? Or which essential option
am I missing, why is "--disable-all --enable-ffmpeg" not working?

Thanks,
Moritz

***@sunshine:/usr/new/tools/video/ffmpeg/ffmpeg-build-2015-08-13 > ./configure --disable-all --enable-ffmpeg --enable-protocol=file --enable-demuxer=mov --enable-muxer=mp4 --enable-bsf=h264_mp4toannexb
install prefix /usr/local
source path .
C compiler gcc
C library glibc
ARCH x86 (generic)
big-endian no
runtime cpu detection yes
yasm yes
MMX enabled yes
MMXEXT enabled yes
3DNow! enabled yes
3DNow! extended enabled yes
SSE enabled yes
SSSE3 enabled yes
AVX enabled yes
XOP enabled yes
FMA3 enabled yes
FMA4 enabled yes
i686 features enabled yes
CMOV is fast no
EBX available yes
EBP available yes
debug symbols yes
strip symbols yes
optimize for size no
optimizations yes
static yes
shared no
postprocessing support no
new filter support no
network support no
threading support pthreads
safe bitstream reader yes
SDL support yes
opencl enabled no
texi2html enabled yes
perl enabled yes
pod2man enabled yes
makeinfo enabled yes
makeinfo supports HTML no

External libraries:
iconv xlib zlib
sdl

Enabled decoders:

Enabled encoders:

Enabled hwaccels:

Enabled parsers:

Enabled demuxers:
mov

Enabled muxers:
mov mp4

Enabled protocols:
file

Enabled filters:

Enabled bsfs:
h264_mp4toannexb

Enabled indevs:

Enabled outdevs:

License: LGPL version 2.1 or later
Creating config.mak, config.h, and doc/config.texi...
***@sunshine:/usr/new/tools/video/ffmpeg/ffmpeg-build-2015-08-13 > make
CC libavutil/adler32.o
CC libavutil/aes.o
CC libavutil/atomic.o
CC libavutil/audio_fifo.o
CC libavutil/avstring.o
CC libavutil/base64.o
CC libavutil/blowfish.o
CC libavutil/bprint.o
CC libavutil/buffer.o
CC libavutil/camellia.o
CC libavutil/cast5.o
CC libavutil/channel_layout.o
CC libavutil/color_utils.o
CC libavutil/cpu.o
CC libavutil/crc.o
CC libavutil/des.o
CC libavutil/dict.o
CC libavutil/display.o
CC libavutil/downmix_info.o
CC libavutil/error.o
CC libavutil/eval.o
CC libavutil/fifo.o
CC libavutil/file.o
CC libavutil/file_open.o
CC libavutil/fixed_dsp.o
CC libavutil/float_dsp.o
CC libavutil/frame.o
libavutil/frame.c: In function ‘av_frame_set_qp_table’:
libavutil/frame.c:55: warning: ‘qscale_table’ is deprecated (declared at libavutil/frame.h:293)
libavutil/frame.c:56: warning: ‘qstride’ is deprecated (declared at libavutil/frame.h:298)
libavutil/frame.c:57: warning: ‘qscale_type’ is deprecated (declared at libavutil/frame.h:301)
libavutil/frame.c: In function ‘av_frame_get_qp_table’:
libavutil/frame.c:64: warning: ‘qstride’ is deprecated (declared at libavutil/frame.h:298)
libavutil/frame.c:65: warning: ‘qscale_type’ is deprecated (declared at libavutil/frame.h:301)
libavutil/frame.c: In function ‘frame_copy_props’:
libavutil/frame.c:293: warning: ‘type’ is deprecated (declared at libavutil/frame.h:355)
libavutil/frame.c:293: warning: ‘type’ is deprecated (declared at libavutil/frame.h:355)
libavutil/frame.c:348: warning: ‘qscale_table’ is deprecated (declared at libavutil/frame.h:293)
libavutil/frame.c:349: warning: ‘qstride’ is deprecated (declared at libavutil/frame.h:298)
libavutil/frame.c:350: warning: ‘qscale_type’ is deprecated (declared at libavutil/frame.h:301)
libavutil/frame.c:354: warning: ‘qscale_table’ is deprecated (declared at libavutil/frame.h:293)
libavutil/frame.c:355: warning: ‘qstride’ is deprecated (declared at libavutil/frame.h:298)
libavutil/frame.c:355: warning: ‘qstride’ is deprecated (declared at libavutil/frame.h:298)
libavutil/frame.c:356: warning: ‘qscale_type’ is deprecated (declared at libavutil/frame.h:301)
libavutil/frame.c:356: warning: ‘qscale_type’ is deprecated (declared at libavutil/frame.h:301)
CC libavutil/hash.o
CC libavutil/hmac.o
CC libavutil/imgutils.o
CC libavutil/intmath.o
CC libavutil/lfg.o
CC libavutil/lls.o
CC libavutil/log.o
CC libavutil/log2_tab.o
CC libavutil/mathematics.o
CC libavutil/md5.o
CC libavutil/mem.o
CC libavutil/murmur3.o
CC libavutil/opt.o
libavutil/opt.c: In function ‘av_opt_set_defaults’:
libavutil/opt.c:1181: warning: ‘av_opt_set_defaults2’ is deprecated (declared at libavutil/opt.h:443)
CC libavutil/parseutils.o
CC libavutil/pixdesc.o
libavutil/pixdesc.c: In function ‘get_pix_fmt_internal’:
libavutil/pixdesc.c:2033: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2034: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2035: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c: In function ‘av_get_pix_fmt_name’:
libavutil/pixdesc.c:2044: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c: In function ‘av_get_pix_fmt_string’:
libavutil/pixdesc.c:2112: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c: In function ‘av_pix_fmt_desc_get’:
libavutil/pixdesc.c:2124: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c: In function ‘av_pix_fmt_desc_next’:
libavutil/pixdesc.c:2130: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2131: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2131: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2131: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c: In function ‘av_pix_fmt_desc_get_id’:
libavutil/pixdesc.c:2141: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2142: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2142: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2142: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2145: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c: In function ‘ff_check_pixfmt_descriptors’:
libavutil/pixdesc.c:2178: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2178: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
libavutil/pixdesc.c:2179: warning: ‘av_pix_fmt_descriptors’ is deprecated (declared at libavutil/pixdesc.c:133)
CC libavutil/pixelutils.o
CC libavutil/random_seed.o
CC libavutil/rational.o
CC libavutil/rc4.o
CC libavutil/reverse.o
CC libavutil/ripemd.o
CC libavutil/samplefmt.o
CC libavutil/sha.o
CC libavutil/sha512.o
CC libavutil/stereo3d.o
CC libavutil/tea.o
CC libavutil/threadmessage.o
CC libavutil/time.o
CC libavutil/timecode.o
CC libavutil/tree.o
CC libavutil/twofish.o
CC libavutil/utils.o
CC libavutil/x86/cpu.o
YASM libavutil/x86/cpuid.o
STRIP libavutil/x86/cpuid.o
YASM libavutil/x86/float_dsp.o
STRIP libavutil/x86/float_dsp.o
CC libavutil/x86/float_dsp_init.o
YASM libavutil/x86/lls.o
STRIP libavutil/x86/lls.o
CC libavutil/x86/lls_init.o
CC libavutil/xga_font_data.o
CC libavutil/xtea.o
AR libavutil/libavutil.a
***@sunshine:/usr/new/tools/video/ffmpeg/ffmpeg-build-2015-08-13 >
Carl Eugen Hoyos
2015-08-14 22:50:39 UTC
Permalink
Post by Moritz Barsnick
I'm trying to reproduce a segmentation fault in ffmpeg
Please remember that all crashes are important and that
we would really like to know about them!
Post by Moritz Barsnick
$ ./configure --disable-all
Use --disable-everything for what you need, or for really
minimal builds:
--disable-everything --disable-network --disable-vdpau
(last one only on Linux)

And while the console output for ffmpeg is needed (we
usually don't have the same source file and we cannot
know the tested version without), please avoid posting
MBs of build output: We all can reproduce it;-)

Carl Eugen
Moritz Barsnick
2015-08-15 17:06:35 UTC
Permalink
Post by Carl Eugen Hoyos
Post by Moritz Barsnick
$ ./configure --disable-all
Use --disable-everything for what you need, or for really
--disable-everything --disable-network --disable-vdpau
(last one only on Linux)
Indeed, "--disable-all" versus "--disable-everything" was a terrible
mishap. Thank you. I get a nice build now.

I have added "--disable-libxcb" to get rid of even more dependencies,
but this is getting ridiculous. ;-) (Shouldn't "--disable-everything"
disable that as well? Just wondering.)

Moritz
Carl Eugen Hoyos
2015-08-16 22:21:36 UTC
Permalink
Post by Moritz Barsnick
I have added "--disable-libxcb" to get rid of
even more dependencies,
Are you sure?
I thought that it would not reduce the number of
dependencies. (If it does I believe you have
found an unknown bug, probably a regression.)

Carl Eugen
Moritz Barsnick
2015-08-17 10:50:29 UTC
Permalink
Post by Carl Eugen Hoyos
Post by Moritz Barsnick
I have added "--disable-libxcb" to get rid of
even more dependencies,
Are you sure?
Yes and no. :-)
Post by Carl Eugen Hoyos
I thought that it would not reduce the number of
dependencies. (If it does I believe you have
found an unknown bug, probably a regression.)
Apparently, only the output of configure differs, the build processes
are identical, the resulting builds look similar (same filesize, binary
differences), and neither of them have a direct or indirect libxcb
dependency. Perhaps configure is just fooling me.

configure output diff appended.

(Diffing config.log is sort of pointless, and I'm too lazy to figure
out a "diff -X" filter or a perl term to make them comparable. Only one
of them contains "libxcb=no" though.)

Moritz

--- ffmpeg-disable-everything.configure.txt 2015-08-17 11:19:32.000000000 +0200
+++ ffmpeg-disable-everything.disable-libxcb.configure.txt 2015-08-17 11:36:40.000000000 +0200
@@ -1,4 +1,4 @@
-***@sunshine:/usr/new/tools/video/ffmpeg/ffmpeg-build-2015-08-16-2 > ./configure --disable-everything --disable-doc --disable-network --disable-vdpau --enable-ffmpeg --enable-protocol=file --enable-demuxer=mov --enable-muxer=mp4 --enable-bsf=h264_mp4toannexb
+***@sunshine:/usr/new/tools/video/ffmpeg/ffmpeg-build-2015-08-16-2 > ./configure --disable-everything --disable-doc --disable-network --disable-vdpau --disable-libxcb --enable-ffmpeg --enable-protocol=file --enable-demuxer=mov --enable-muxer=mp4 --enable-bsf=h264_mp4toannexb
install prefix /usr/local
source path .
C compiler gcc
@@ -41,9 +41,8 @@
makeinfo supports HTML no

External libraries:
-iconv libxcb_shm xlib
-libxcb libxcb_xfixes zlib
-libxcb_shape sdl
+iconv xlib zlib
+sdl

Enabled decoders:
Carl Eugen Hoyos
2015-08-17 14:02:48 UTC
Permalink
Post by Moritz Barsnick
Perhaps configure is just fooling me.
I don't think so.

configure did (at least I hope so) not print
that it enabled the x11grab_xcb input device
so no such dependency is necessary.
(It did detect libxcb on your system as it
also detected zlib and bzlib and xlib but
the libraries are not actually used.)

Carl Eugen
Moritz Barsnick
2015-08-17 14:07:41 UTC
Permalink
Post by Carl Eugen Hoyos
(It did detect libxcb on your system as it
also detected zlib and bzlib and xlib but
the libraries are not actually used.)
Point taken. Indeed, it only quoted "External libraries:" and said
nothing about any devices or formats.

Thanks,
Moritz
Moritz Barsnick
2015-08-15 17:49:30 UTC
Permalink
Hi Carl Eugen,
Post by Carl Eugen Hoyos
Post by Moritz Barsnick
I'm trying to reproduce a segmentation fault in ffmpeg
Please remember that all crashes are important and that
we would really like to know about them!
Of course! I wanted a more lightweight ffmpeg first, and thought I
could achieve that within minutes.

Anyway, taking the "new" Android movie from this mail to the list:
http://ffmpeg.org/pipermail/ffmpeg-user/2015-August/027947.html

The first 8 MB of this 147MB file suffice:
https://www.dropbox.com/sh/vqqhgqjc7k8ia43/AADXEjavHmJ3Z5dDeuP0OF6Za/3350.mp4

I was fiddling around with it, doing meaningless stuff (which you'll
see from the command line below). Yet it crashed. I don't get a
meaningful backtrace, unfortunately:

***@sunshine:/usr/new/tools/video/ffmpeg/ffmpeg-build-2015-08-13 > gdb --args ./ffmpeg_g -i ~/tmp/crash_bsf.mp4 -c copy -bsf h264_mp4toannexb -f mp4 /dev/null -y
GNU gdb (GDB) Fedora (7.3.1-48.fc10.1sunshine)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "pentium4-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/local/new/tools/video/ffmpeg/ffmpeg-build-2015-08-13/ffmpeg_g...done.
(gdb) r
Starting program: /usr/local/new/tools/video/ffmpeg/ffmpeg-build-2015-08-13/ffmpeg_g -i /home/barsnick/tmp/crash_bsf.mp4 -c copy -bsf h264_mp4toannexb -f mp4 /dev/null -y
[Thread debugging using libthread_db enabled]
ffmpeg version N-74425-g1c10c1a Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.3.2 (GCC) 20081105 (Red Hat 4.3.2-7)
configuration: --disable-everything --disable-network --disable-vdpau --disable-libxcb --enable-ffmpeg --enable-protocol=file --enable-demuxer=mov --enable-muxer=mp4 --enable-bsf=h264_mp4toannexb
libavutil 54. 30.100 / 54. 30.100
libavcodec 56. 57.100 / 56. 57.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 33.100 / 5. 33.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/barsnick/tmp/crash_bsf.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2015-08-08 22:22:54
Duration: 00:01:00.78, start: 0.000000, bitrate: 1104 kb/s
Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), none, 1920x1080, 19958 kb/s, SAR 1:1 DAR 16:9, 24.22 fps, 24.25 tbr, 90k tbn, 90k tbc (default)
Metadata:
creation_time : 2015-08-08 22:22:54
handler_name : VideoHandle
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, 2 channels, 192 kb/s (default)
Metadata:
creation_time : 2015-08-08 22:22:54
handler_name : SoundHandle
[mp4 @ 0x821ab80] Codec for stream 0 does not use global headers but container format requires global headers
[mp4 @ 0x821ab80] Codec for stream 1 does not use global headers but container format requires global headers
[mp4 @ 0x821ab80] track 1: codec frame size is not set
Output #0, mp4, to '/dev/null':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
encoder : Lavf56.40.101
Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), none, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 19958 kb/s, 24.22 fps, 24.25 tbr, 90k tbn, 90k tbc (default)
Metadata:
creation_time : 2015-08-08 22:22:54
handler_name : VideoHandle
Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 192 kb/s (default)
Metadata:
creation_time : 2015-08-08 22:22:54
handler_name : SoundHandle
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help

Program received signal SIGSEGV, Segmentation fault.
0x0071e636 in memcpy () from /lib/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.9-3.i686 zlib-1.2.3-22.fc10.1sunshine.pentium4
(gdb) thread apply all bt full

Thread 1 (Thread 0xb7fd66c0 (LWP 21665)):
#0 0x0071e636 in memcpy () from /lib/libc.so.6
No symbol table info available.
#1 0x00000000 in ?? ()
No symbol table info available.
(gdb)


This is on an ancient x32 machine. I can't reproduce it on a newer
machine with modern compilers, libs, OS on x86_64. D'uh.

I don't subscribe to ffmpeg-devel (yet), too much traffic for what I'm
trying to achieve. I would just post a trac ticket, but perhaps this
isn't worth following up?


Moritz
Carl Eugen Hoyos
2015-08-17 14:57:43 UTC
Permalink
Post by Moritz Barsnick
I don't subscribe to ffmpeg-devel (yet)
Please don't report bugs there (unless you want
to fix them)!
Post by Moritz Barsnick
I would just post a trac ticket
I opened ticket #4778.

Thank you for the report, Carl Eugen

Loading...