LoginSignup
3
3

More than 5 years have passed since last update.

ffmpegでSRTを試す

Posted at

ほぼ https://qiita.com/tetsu_koba/items/b8e1868a726c6201d3ab のままですが、自分の作業メモとして残しておきます。

環境: macOS Sierra 10.12.6

ビルド

$ curl -L https://ffmpeg.org/releases/ffmpeg-4.0.2.tar.bz2 > ffmpeg-4.0.2.tar.bz2
$ tar xf ffmpeg-4.0.2.tar.bz2
$ cd ffmpeg-4.0.2/
$ vim libavformat/libsrt.c   # 469行目に h->max_packet_size = 1316; を追加
$ ./configure --enable-libsrt --enable-libx264 --enable-gpl; say 'オワッタヨ'
$ make; say 'オワッタヨ'
$ ./ffmpeg -protocols | grep srt
ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
  configuration: --enable-libsrt --enable-libx264 --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

動作確認

先に受信側を起動(こちらはhomebrewでいれたffmpegのffplay)

ffplay -analyzeduration 100 -i 'srt://127.0.0.1:3000?mode=listener'

送信側を起動(こちらはさきほどビルドしたもの)

./ffmpeg -f avfoundation -framerate 30 -i "0:" -c:v libx264 -pix_fmt yuv420p -profile:v baseline -level 1 -preset ultrafast -tune zerolatency -x264opts bitrate=2000 -an -f mpegts 'srt://127.0.0.1:3000'

メモ

  • https://trac.ffmpeg.org/ticket/7187the mss option should be used per mss=1316 So not a bug.とあったのでsrt://127.0.0.1:3000?mss=1316も試してみたけど、やはりSRT.c: LiveSmoother: payload size: 15040 exceeds maximum allowed 1316といわれてしまう
3
3
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
3
3