調子に乗ってきたので全部乗せffmpegを目指す話
趣旨
前の投稿が長くなりすぎてきたのと、やっぱffplayでmod鳴らしたいなあ、という欲が出てきたのでLinux上でビルドをやってみるテスト。
電源MODの話の方の塗料が乾いていないんで、あっちはなかなか進まないのも理由の一つ。
[FFmpeg] ライブラリ全部入り - Qiitaのヒトがやったのとはだいぶ結果と方向性が違うなあ。*1
ffmpegの脆弱性ガー、みたいな記事を2020.5.25にニュースサイトで見たので注意。
元ネタ
FFmpeg/configure at master · FFmpeg/FFmpeg · GitHubのhelpで出てくるExternal Library Supportの下り(60行目前後のshow_help()の中身)を見て、興味のあるもの→decoder/encoder→filter→その他について上から順くらいで試していくつもり。*3
個人的にはfdk-aacとopensslとx264だけあれば普段使いに足りるんじゃあ、という利用状況で、コーデック足すのはあんまり気乗りしない(ffplayどころかffprobeをビルドするのもイヤ)のですが、
まあ、お祭りですから。
ある程度できた時点で[FFmpeg] ライブラリ全部入り - Qiitaを見つけて椅子から崩れ落ちたけど、私は元気です。思いつくのが数年遅かった。
aptでパッケージ導入
$ sudo apt update && sudo apt install autoconf automake build-essential cmake git-core libtool pkg-config texinfo wget \ zlib1g-dev nasm yasm libsdl2-dev libva-dev libvdpau-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev libchromaprint-dev \ frei0r-plugins-dev ladspa-sdk libaom-dev libaribb24-dev libass-dev libbs2b-dev libcaca-dev libcdio-paranoia-dev libcdio-dev \ libcdparanoia-dev libcodec2-dev libdc1394-dev libraw1394-dev libfdk-aac-dev flite1-dev libfontconfig1-dev libfreetype6-dev \ libfribidi-dev libgme-dev libgsm1-dev libjack-jackd2-dev liblensfun-dev libmodplug-dev libmp3lame-dev \ libopencore-amrnb-dev libopencore-amrwb-dev libopenjp2-7-dev libopenmpt-dev libogg-dev libopus-dev libpulse-dev \ librsvg2-dev librubberband-dev libshine-dev libsnappy-dev libsoxr-dev libspeex-dev libsrt-dev libssh-dev libtheora-dev \ libtwolame-dev libvidstab-dev libvo-amrwbenc-dev libvorbis-dev libvpx-dev libwavpack-dev libwebp-dev libx264-dev \ libx265-dev libnuma-dev libxvidcore-dev libzmq3-dev libzvbi-dev libmysofa-dev libopenal-dev libopengl-dev libssl-dev libvulkan-dev
configure
$ PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" \ --pkg-config-flags="--static" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" \ --extra-libs="-lpthread -lm" --bindir="$HOME/bin" --enable-gpl --enable-nonfree --enable-version3 \ --enable-chromaprint --enable-frei0r --enable-ladspa --enable-libaom --enable-libaribb24 --enable-libass --enable-libbs2b \ --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdc1394 --enable-libfdk-aac --enable-libflite --enable-libfontconfig \ --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-liblensfun --enable-libmodplug \ --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopenmpt \ --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr \ --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc \ --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid \ --enable-libzmq --enable-libzvbi --enable-libmysofa --enable-openal --enable-opengl --enable-openssl --enable-vulkan
make
$ PATH="$HOME/bin:$PATH" make -j4 && make install && hash -r
導入既未済
「Ubuntu導入パッケージ」欄を空欄にしているところは対応していない。理由はコメント欄。
「ERROR: 【ライブラリ名】 not found using pkg-config」というエラーが出て取り除いたパッケージが10くらい?
なんかライブラリの野良ビルド以外に対応方法があるのかないのか…
機能 | Ubuntu 導入パッケージ | configureオプション | コメント |
---|---|---|---|
disable ALSA support [autodetect] | --disable-alsa | [autodetect] | |
disable Apple AppKit framework [autodetect] | --disable-appkit | [autodetect] | |
disable Apple AVFoundation framework [autodetect] | --disable-avfoundation | [autodetect] | |
enable reading of AviSynth script files [no] | --enable-avisynth | Windowsメインのやつ? | |
disable bzlib [autodetect] | --disable-bzlib | [autodetect] | |
disable Apple CoreImage framework [autodetect] | --disable-coreimage | [autodetect] | |
enable audio fingerprinting with chromaprint [no] | libchromaprint-dev | --enable-chromaprint | |
enable frei0r video filtering [no] | frei0r-plugins-dev | --enable-frei0r | |
enable gcrypt, needed for rtmp(t)e support if openssl, librtmp or gmp is not used [no] | --enable-gcrypt | rtmp … | |
enable gmp, needed for rtmp(t)e support if openssl or librtmp is not used [no] | --enable-gmp | rtmp … | |
enable gnutls, needed for https support if openssl, libtls or mbedtls is not used [no] | --enable-gnutls | opensslがあるからなあ… | |
disable iconv [autodetect] | --disable-iconv | [autodetect] | |
enable JNI support [no] | --enable-jni | ||
enable LADSPA audio filtering [no] | ladspa-sdk | --enable-ladspa | |
enable AV1 video encoding/decoding via libaom [no] | libaom-dev | --enable-libaom | |
enable ARIB text and caption decoding via libaribb24 [no] | libaribb24-dev | --enable-libaribb24 | |
enable libass subtitles rendering, needed for subtitles and ass filter [no] | libass-dev | --enable-libass | |
enable BluRay reading using libbluray [no] | --enable-libbluray | ERROR: libbluray not found using pkg-config | |
enable bs2b DSP library [no] | libbs2b-dev | --enable-libbs2b | |
enable textual display using libcaca [no] | libcaca-dev | --enable-libcaca | |
enable CELT decoding via libcelt [no] | --enable-libcelt | パッケージになさそう… | |
enable audio CD grabbing with libcdio [no] | libcdio-paranoia-dev libcdio-dev libcdparanoia-dev | --enable-libcdio | libcdio-paranoia-devを入れたらエラーが消えた。 |
enable codec2 en/decoding using libcodec2 [no] | libcodec2-dev | --enable-libcodec2 | |
enable AV1 decoding via libdav1d [no] | --enable-libdav1d | パッケージになさそう… | |
enable AVS2 decoding via libdavs2 [no] | --enable-libdavs2 | パッケージになさそう… | |
enable IIDC-1394 grabbing using libdc1394 and libraw1394 [no] | libdc1394-dev libraw1394-dev | --enable-libdc1394 | |
enable AAC de/encoding via libfdk-aac [no] | libfdk-aac-dev | --enable-libfdk-aac | |
enable flite (voice synthesis) support via libflite [no] | flite1-dev | --enable-libflite | |
enable libfontconfig, useful for drawtext filter [no] | libfontconfig1-dev | --enable-libfontconfig | |
enable libfreetype, needed for drawtext filter [no] | libfreetype6-dev | --enable-libfreetype | |
enable libfribidi, improves drawtext filter [no] | libfribidi-dev | --enable-libfribidi | |
enable GLSL->SPIRV compilation via libglslang [no] | --enable-libglslang | パッケージになさそう… | |
enable Game Music Emu via libgme [no] | libgme-dev | --enable-libgme | |
enable GSM de/encoding via libgsm [no] | libgsm1-dev | --enable-libgsm | |
enable iec61883 via libiec61883 [no] | --enable-libiec61883 | libiec61883-dev libiec61883-0 ERROR: libiec61883 not found | |
enable iLBC de/encoding via libilbc [no] | --enable-libilbc | パッケージになさそう… | |
enable JACK audio sound server [no] | libjack-jackd2-dev | --enable-libjack | libjack-devだと既存のライブラリを削除してしまうみたい。 |
enable Kernel Labs VANC processing [no] | --enable-libklvanc | パッケージになさそう… | |
enable HEVC encoding via libkvazaar [no] | --enable-libkvazaar | パッケージになさそう… | |
enable lensfun lens correction [no] | liblensfun-dev | --enable-liblensfun | |
enable ModPlug via libmodplug [no] | libmodplug-dev | --enable-libmodplug | |
enable MP3 encoding via libmp3lame [no] | libmp3lame-dev | --enable-libmp3lame | |
enable AMR-NB de/encoding via libopencore-amrnb [no] | libopencore-amrnb-dev | --enable-libopencore-amrnb | |
enable AMR-WB decoding via libopencore-amrwb [no] | libopencore-amrwb-dev | --enable-libopencore-amrwb | |
enable video filtering via libopencv [no] | --enable-libopencv | libopencv-dev ERROR: opencv not found using pkg-config | |
enable H.264 encoding via OpenH264 [no] | --enable-libopenh264 | パッケージになさそう… | |
enable JPEG 2000 de/encoding via OpenJPEG [no] | libopenjp2-7-dev | --enable-libopenjpeg | |
enable decoding tracked files via libopenmpt [no] | libopenmpt-dev | --enable-libopenmpt | |
enable Opus de/encoding via libopus [no] | libogg-dev libopus-dev | --enable-libopus | |
enable Pulseaudio input via libpulse [no] | libpulse-dev | --enable-libpulse | |
enable RabbitMQ library [no] | --enable-librabbitmq | librabbitmq-dev ERROR: librabbitmq >= 0.7.1 not found using pkg-config | |
enable AV1 encoding via rav1e [no] | --enable-librav1e | パッケージになさそう… | |
enable SVG rasterization via librsvg [no] | librsvg2-dev | --enable-librsvg | |
enable rubberband needed for rubberband filter [no] | librubberband-dev | --enable-librubberband | |
enable RTMP[E] support via librtmp [no] | --enable-librtmp | ERROR: librtmp not found using pkg-config | |
enable fixed-point MP3 encoding via libshine [no] | libshine-dev | --enable-libshine | |
enable Samba protocol via libsmbclient [no] | --enable-libsmbclient | libsmbclient-dev libsmbclient ERROR: libsmbclient not found | |
enable Snappy compression, needed for hap encoding [no] | libsnappy-dev | --enable-libsnappy | |
enable Include libsoxr resampling [no] | libsoxr-dev | --enable-libsoxr | |
enable Speex de/encoding via libspeex [no] | libspeex-dev | --enable-libspeex | |
enable Haivision SRT protocol via libsrt [no] | libsrt-dev | --enable-libsrt | |
enable SFTP protocol via libssh [no] | libssh-dev | --enable-libssh | |
enable TensorFlow as a DNN module backend for DNN based filters like sr [no] | --enable-libtensorflow | パッケージになさそう… | |
enable Tesseract, needed for ocr filter [no] | --enable-libtesseract | libtesseract-dev ERROR: tesseract not found using pkg-config | |
enable Theora encoding via libtheora [no] | libtheora-dev | --enable-libtheora | |
enable LibreSSL (via libtls), needed for https support if openssl, gnutls or mbedtls is not used [no] | --enable-libtls | opensslがあるからなあ… | |
enable MP2 encoding via libtwolame [no] | libtwolame-dev | --enable-libtwolame | |
enable libv4l2/v4l-utils [no] | --enable-libv4l2 | libv4l-dev ERROR: libv4l2 not found using pkg-config | |
enable video stabilization using vid.stab [no] | libvidstab-dev | --enable-libvidstab | |
enable vmaf filter via libvmaf [no] | --enable-libvmaf | パッケージになさそう… | |
enable AMR-WB encoding via libvo-amrwbenc [no] | libvo-amrwbenc-dev | --enable-libvo-amrwbenc | |
enable Vorbis en/decoding via libvorbis, native implementation exists [no] | libvorbis-dev | --enable-libvorbis | |
enable VP8 and VP9 de/encoding via libvpx [no] | libvpx-dev | --enable-libvpx | |
enable wavpack encoding via libwavpack [no] | libwavpack-dev | --enable-libwavpack | |
enable WebP encoding via libwebp [no] | libwebp-dev | --enable-libwebp | |
enable H.264 encoding via x264 [no] | libx264-dev | --enable-libx264 | |
enable HEVC encoding via x265 [no] | libx265-dev libnuma-dev | --enable-libx265 | |
enable AVS encoding via xavs [no] | --enable-libxavs | パッケージになさそう… | |
enable AVS2 encoding via xavs2 [no] | --enable-libxavs2 | パッケージになさそう… | |
enable X11 grabbing using XCB [autodetect] | --enable-libxcb | [autodetect] | |
enable X11 grabbing shm communication [autodetect] | --enable-libxcb-shm | [autodetect] | |
enable X11 grabbing mouse rendering [autodetect] | --enable-libxcb-xfixes | [autodetect] | |
enable X11 grabbing shape rendering [autodetect] | --enable-libxcb-shape | [autodetect] | |
enable Xvid encoding via xvidcore, native MPEG-4/Xvid encoder exists [no] | libxvidcore-dev | --enable-libxvid | |
enable XML parsing using the C library libxml2, needed for dash demuxing support [no] | --enable-libxml2 | libxml2-dev ERROR: libxml-2.0 not found using pkg-config | |
enable z.lib, needed for zscale filter [no] | --enable-libzimg | パッケージになさそう… | |
enable message passing via libzmq [no] | libzmq3-dev | --enable-libzmq | |
enable teletext support via libzvbi [no] | libzvbi-dev | --enable-libzvbi | |
enable LV2 audio filtering [no] | --enable-lv2 | lv2-dev ERROR: lilv-0 not found using pkg-config | |
disable lzma [autodetect] | --disable-lzma | [autodetect] | |
enable Blackmagic DeckLink I/O support [no] | --enable-decklink | ||
enable mbedTLS, needed for https support if openssl, gnutls or libtls is not used [no] | --enable-mbedtls | opensslがあるからなあ… | |
enable Android MediaCodec support [no] | --enable-mediacodec | パッケージになさそう… | |
enable libmysofa, needed for sofalizer filter [no] | libmysofa-dev | --enable-libmysofa | |
enable OpenAL 1.1 capture support [no] | libopenal-dev | --enable-openal | |
enable OpenCL processing [no] | --enable-opencl | パッケージになさそう… | |
enable OpenGL rendering [no] | libopengl-dev | --enable-opengl | |
enable openssl, needed for https support if gnutls, libtls or mbedtls is not used [no] | libssl-dev | --enable-openssl | |
enable PocketSphinx, needed for asr filter [no] | --enable-pocketsphinx | libpocketsphinx-dev ERROR: pocketsphinx not found using pkg-config | |
disable sndio support [autodetect] | --disable-sndio | [autodetect] | |
disable SChannel SSP, needed for TLS support on Windows if openssl and gnutls are not used [autodetect] | --disable-schannel | [autodetect] | |
disable sdl2 [autodetect] | --disable-sdl2 | [autodetect] | |
disable Secure Transport, needed for TLS support on OSX if openssl and gnutls are not used [autodetect] | --disable-securetransport | [autodetect] | |
enable VapourSynth demuxer [no] | --enable-vapoursynth | パッケージになさそう… | |
enable Vulkan code [no] | libvulkan-dev | --enable-vulkan | |
disable xlib [autodetect] | --disable-xlib | [autodetect] | |
disable zlib [autodetect] | --disable-zlib | [autodetect] | |
enable DRM code (Linux) [no]【番外】 | --enable-libdrm | DRM違い。direct rendering manager.これを導入してもFANZAが見られるわけではない。 |
ビルド結果
$ ffmpeg ffmpeg version N-97758-g4b7e13931f Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9 (Ubuntu 9.3.0-10ubuntu2) configuration: --prefix=/home/nyarinkopv/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/nyarinkopv/ffmpeg_build/include --extra-ldflags=-L/home/nyarinkopv/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/nyarinkopv/bin --enable-gpl --enable-nonfree --enable-version3 --enable-chromaprint --enable-frei0r --enable-libaom --enable-libaribb24 --enable-libass --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdc1394 --enable-libfdk-aac --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-liblensfun --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-libmysofa --enable-openal --enable-opengl --enable-openssl --enable-vulkan --enable-ladspa libavutil 56. 45.100 / 56. 45.100 libavcodec 58. 84.100 / 58. 84.100 libavformat 58. 43.100 / 58. 43.100 libavdevice 58. 9.103 / 58. 9.103 libavfilter 7. 80.100 / 7. 80.100 libswscale 5. 6.101 / 5. 6.101 libswresample 3. 6.100 / 3. 6.100 libpostproc 55. 6.100 / 55. 6.100 Hyper fast Audio and Video encoder usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... Use -h to get full help or, even better, run 'man ffmpeg'