Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I need to compile ffmpeg from source for CentOS. The goal it to convert MP3 and WAV to FLAC. I tried to compile ffmpeg with this guide: https://trac.ffmpeg.org/wiki/CompilationGuide/Centos and it worked fine, but took approximately 20min and compiled a bunch unnecessary things, even thought I did not used next options as recommended in guide, but used:

PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure 
--prefix="/opt/tmg/ffmpeg_build" 
--pkg-config-flags="--static" 
--extra-cflags="-I/opt/tmg/ffmpeg_build/include" 
--extra-ldflags="-L/opt/tmg/ffmpeg_build/lib" 
--extra-libs=-lpthread 
--extra-libs=-lm 
--bindir="/opt/tmg/ffmpeg_build/bin" 
--enable-gpl 
--enable-libfreetype

My question is what do I need for MP3 and WAV to FLAC and how do I compile just that part?

I found in configuration --disable-all option, but what do I have to enable?

Thanks in advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
161 views
Welcome To Ask or Share your Answers For Others

1 Answer

Use:

./configure --disable-everything --disable-network --disable-autodetect --enable-decoder=mp3*,pcm* --enable-encoder=flac --enable-parser=mpegaudio --enable-demuxer=mp3,wav --enable-muxer=flac --enable-filter=aresample --enable-protocol=file
  • You didn't mention needing to support cover/album art, so this assumes you don't need it. Make sure your encoding command uses -map 0:a or -vn or similar to ignore embedded images. Otherwise, you'll have to enable a bunch of stuff to handle the images.

  • You may get warnings during configure such as WARNING: Disabled mp3_at_decoder because not all dependencies are satisfied: audiotoolbox. These can be ignored.

  • Use --disable-everything instead of --disable-all because the second option disables too much and is harder to use (unless you know what you are doing and are willing to perform many test compiles) due to the complexity of component inter-dependencies.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...