LoginSignup
11
6

More than 3 years have passed since last update.

ffmpeg 4.0 をlibsrtを有効にしてビルドする

Last updated at Posted at 2018-04-26

書き直したのでこちらを参照してください。
ffmpeg 4.3 をlibsrtを有効にしてビルドする

ffmpeg 4.0 で新しくサポートされたsrtのプロトコルを試してみようと思って。

準備

依存ライブラリの準備

ubuntu 16.04 を使用している。

sudo apt build-dep ffmpeg

libsrtのビルドとインストール

git clone https://github.com/Haivision/srt.git
cd srt/
git checkout -b v1.3.0 v1.3.0
sudo apt-get install tclsh pkg-config cmake libssl-dev build-essential
./configure 
make
sudo make install
sudo ldconfig

ffmpegのソースの入手

git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg/
git checkout -b n4.0 n4.0

ビルドとインストール

./configure --enable-libsrt --enable-libx264 --enable-libx265 --enable-gpl
make
sudo make install
$ which ffmpeg
/usr/local/bin/ffmpeg
$ ffmpeg -version
ffmpeg version n4.0 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 20160609
configuration: --enable-libsrt --enable-libx264 --enable-libx265 --enable-gpl
libavutil      56. 14.100 / 56. 14.100
libavcodec     58. 18.100 / 58. 18.100
libavformat    58. 12.100 / 58. 12.100
libavdevice    58.  3.100 / 58.  3.100
libavfilter     7. 16.100 /  7. 16.100
libswscale      5.  1.100 /  5.  1.100
libswresample   3.  1.100 /  3.  1.100
libpostproc    55.  1.100 / 55.  1.100
$ ffmpeg -protocols |grep srt
ffmpeg version n4.0 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 20160609
  configuration: --enable-libsrt --enable-libx264 --enable-libx265 --enable-gpl
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
  srtp
  srt
  srtp
  srt

確かにプロトコルにsrt が追加された。

追記: ffplayのビルド

ffplayもデフォルトで一緒にビルドされるようになっているが、必要なライブラリが足りない場合は除外される。最初にやったときにはffplayはビルドされていなかった。以下を追加でインストールしたら、ffplayもビルドされるようになった。

sudo apt install libsdl2-dev

続き

ffmpeg 4.0 に入った新しい映像伝送プロトコルSRTを試す

追記 (2018.11.12)

ffmpeg 4.1 でSRTのバグが解消された
なので、SRTを使うならffmpeg 4.1以降を使いましょう。

git checkout -b n4.x n4.1
11
6
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
11
6