LoginSignup
15
13

More than 5 years have passed since last update.

ffmpegのstatic buildを作るときのconfigureコマンド

Last updated at Posted at 2018-03-10

ffmpegのstatic buildを作るときのconfigureコマンド

./configure  \
    --disable-shared \
    --enable-static \
    --pkg-config-flags=--static \
    --extra-libs=-static \
    --extra-cflags=--static

解説

configureのhelpをみると--disable-shared, --enable-staticでstaticなビルドができそうに見えるが、これはffmpeg系のDLLのみのオプション。なので、libcとかは依然dynamicなまま。なので、libcとかもstaticにするために後ろ3つが必要、なはず。

あと、全部入りのバイナリを作ると大きくなりがちだし、こういうの作る時ってだいたいプロダクション環境とかで必要なので、以下のオプションもおすすめかも。

--disable-doc 
--disable-debug 
--enable-small

ドキュメント作らないオプションと、デバッグ情報を外す(その分サイズが小さくなる)オプションと、サイズを小さくする(その代わりビルド時間は大きくなる)オプション

ビルドする前に依存するやつをインストールしとく話とかは公式のドキュメントとかすでに詳しく書かれてるところがいっぱいあるのでそちらを参照すると良いです。

参考: http://www.ffmpeg-archive.org/Build-with-enable-static-td1583036.html

15
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
13