Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
169 views
in Technique[技术] by (71.8m points)

linux - Compiling custom FFMPEG for mp3/wav to flac conversion

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

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

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...