Compiling FFmpeg on Debian/Ubuntu

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
peter_b
Chatterbox
Posts: 370
Joined: Tue Nov 12, 2013 2:05 am

Compiling FFmpeg on Debian/Ubuntu

Post by peter_b »

I know, I know...
There are thousands of HowTos for compiling FFmpeg on Debian/Ubuntu based distros.

This thread here is merely a collection of things I've encountered - and possible solutions, in case someone else runs into a similar issue.
(Actually, this is what most of this forum here contains anyway ;) )

1) === Font support:
Running "./configure" with the "--enable-libfreetype" option, threw the following error message:
ERROR: freetype2 not found
SOLUTION: Install the package "libfreetype6-dev".

2) === MP3 support:
ERROR: libmp3lame >= 3.98.3 not found
SOLUTION: Install the package "libmp3lame-dev"

3) === JPEG 2000 support:
ERROR: libopenjpeg not found
SOLUTION: Install the package "libopenjpeg-dev"
User avatar
peter_b
Chatterbox
Posts: 370
Joined: Tue Nov 12, 2013 2:05 am

Re: Compiling FFmpeg on Debian/Ubuntu

Post by peter_b »

4) === audio_mix_init: undefined reference:
Trying to compile the current git head (2012-09-06, 15h35), I ran into the following error:
LD ffmpeg_g
libavresample/libavresample.a(audio_mix_init.o): In function `ff_audio_mix_init_x86':
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:207: undefined reference to `ff_mix_3_to_1_fltp_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:207: undefined reference to `ff_mix_3_to_2_fltp_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:207: undefined reference to `ff_mix_3_to_1_s16p_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:207: undefined reference to `ff_mix_3_to_2_s16p_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:208: undefined reference to `ff_mix_4_to_1_fltp_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:208: undefined reference to `ff_mix_4_to_2_fltp_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:208: undefined reference to `ff_mix_4_to_1_s16p_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:208: undefined reference to `ff_mix_4_to_2_s16p_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:209: undefined reference to `ff_mix_5_to_1_fltp_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:209: undefined reference to `ff_mix_5_to_2_fltp_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:209: undefined reference to `ff_mix_5_to_1_s16p_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:209: undefined reference to `ff_mix_5_to_2_s16p_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:210: undefined reference to `ff_mix_6_to_1_fltp_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:210: undefined reference to `ff_mix_6_to_2_fltp_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:210: undefined reference to `ff_mix_6_to_1_s16p_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:210: undefined reference to `ff_mix_6_to_2_s16p_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:211: undefined reference to `ff_mix_7_to_1_fltp_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:211: undefined reference to `ff_mix_7_to_2_fltp_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:211: undefined reference to `ff_mix_7_to_1_s16p_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:211: undefined reference to `ff_mix_7_to_2_s16p_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:212: undefined reference to `ff_mix_8_to_1_fltp_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:212: undefined reference to `ff_mix_8_to_2_fltp_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:212: undefined reference to `ff_mix_8_to_1_s16p_flt_fma4'
/home/xxx/install/ffmpeg/ffmpeg-git/libavresample/x86/audio_mix_init.c:212: undefined reference to `ff_mix_8_to_2_s16p_flt_fma4'
collect2: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1
SOLUTION: Remove the "--enable-avresample" flag from configure.
According to Michael Niedermayer's post on ffmpeg-devel (from Apr 26th, 2012), libavresample is included for compatibility with ffmpeg's unfriendly twin-brother "libav" (It reminds me a bit of Michael Knight vs. Garthe Knight ;)).

There seems to be something fishy not-working-properly with replacement of the variable "chan" in the preprocessor statement/function "DEFINE_MIX_3_8_TO_1_2(chan)" in "libavresample/x86/audio_mix_init.c". However, a workaround is to disable inclusion of libavresample.
User avatar
peter_b
Chatterbox
Posts: 370
Joined: Tue Nov 12, 2013 2:05 am

FFplay missing: not compiled?

Post by peter_b »

I recently compiled ffmpeg, and everything went fine. No errors.
Unfortunately, "ffplay" was missing.

In order for ffplay to be compiled, one must install the "SDL" library package:

Code: Select all

$ apt-get install libsdl1.2-dev
Then recompile.
User avatar
peter_b
Chatterbox
Posts: 370
Joined: Tue Nov 12, 2013 2:05 am

Re: Compiling FFmpeg on Debian/Ubuntu

Post by peter_b »

For curren git build on (X)ubuntu 18.04 it's libsdl2:

Code: Select all

sudo apt install libsdl2-dev
More discussion/infos at: https://stackoverflow.com/questions/204 ... ompilation
Post Reply