ffmpeg 4.1 でSRTのバグが解消された

気がついたらffmpeg 4.1 がリリースされていました。gitkで修正を見るとsrt(libsrt.c)にいくつかの修正が入りました。

# バグ修正

私が見つけた2件のバグが解消していました。

[送信パケットサイズのバグ](https://qiita.com/tetsu_koba/items/b8e1868a726c6201d3ab#%E3%83%90%E3%82%B0%E3%82%92%E8%B8%8F%E3%82%93%E3%81%A0)

[暗号化の指定のバグ](https://qiita.com/tetsu_koba/items/1fabedf3863ee0857d82#ffmpeg%E3%81%AE%E3%83%90%E3%82%B0)

# libsrt 関連のオプション

libsrt 関連のオプションが増えています。以下のようにして確認できます。

```
ffmpeg -h full |less
```
`libsrt`を検索。

```
libsrt AVOptions:
  -rw_timeout        <int64>      ED....... Timeout of socket I/O operations (from -1 to I64_MAX) (default -1)
  -listen_timeout    <int64>      ED....... Connection awaiting timeout (from -1 to I64_MAX) (default -1)
  -send_buffer_size  <int>        ED....... Socket send buffer size (in bytes) (from -1 to INT_MAX) (default -1)
  -recv_buffer_size  <int>        ED....... Socket receive buffer size (in bytes) (from -1 to INT_MAX) (default -1)
  -pkt_size          <int>        ED....... Maximum SRT packet size (from -1 to 1456) (default -1)
     ts_size                      ED.......
     max_size                     ED.......
  -payload_size      <int>        ED....... Maximum SRT packet size (from -1 to 1456) (default -1)
     ts_size                      ED.......
     max_size                     ED.......
  -maxbw             <int64>      ED....... Maximum bandwidth (bytes per second) that the connection can use (from -1 to I64_MAX) (default -1)
  -pbkeylen          <int>        ED....... Crypto key len in bytes {16,24,32} Default: 16 (128-bit) (from -1 to 32) (default -1)
  -passphrase        <string>     ED....... Crypto PBKDF2 Passphrase size[0,10..64] 0:disable crypto
  -mss               <int>        ED....... The Maximum Segment Size (from -1 to 1500) (default -1)
  -ffs               <int>        ED....... Flight flag size (window size) (in bytes) (from -1 to INT_MAX) (default -1)
  -ipttl             <int>        ED....... IP Time To Live (from -1 to 255) (default -1)
  -iptos             <int>        ED....... IP Type of Service (from -1 to 255) (default -1)
  -inputbw           <int64>      ED....... Estimated input stream rate (from -1 to I64_MAX) (default -1)
  -oheadbw           <int>        ED....... MaxBW ceiling based on % over input stream rate (from -1 to 100) (default -1)
  -latency           <int64>      ED....... receiver delay to absorb bursts of missed packet retransmissions (from -1 to I64_MAX) (default -1)
  -tsbpddelay        <int64>      ED....... deprecated, same effect as latency option (from -1 to I64_MAX) (default -1)
  -rcvlatency        <int64>      ED....... receive latency (from -1 to I64_MAX) (default -1)
  -peerlatency       <int64>      ED....... peer latency (from -1 to I64_MAX) (default -1)
  -tlpktdrop         <int>        ED....... Enable receiver pkt drop (from -1 to 1) (default -1)
  -nakreport         <int>        ED....... Enable receiver to send periodic NAK reports (from -1 to 1) (default -1)
  -connect_timeout   <int64>      ED....... Connect timeout. Caller default: 3000, rendezvous (x 10) (from -1 to I64_MAX) (default -1)
  -mode              <int>        ED....... Connection mode (caller, listener, rendezvous) (from 0 to 2) (default caller)
     caller                       ED.......
     listener                     ED.......
     rendezvous                   ED.......
  -sndbuf            <int>        ED....... Send buffer size (in bytes) (from -1 to INT_MAX) (default -1)
  -rcvbuf            <int>        ED....... Receive buffer size (in bytes) (from -1 to INT_MAX) (default -1)
  -lossmaxttl        <int>        ED....... Maximum possible packet reorder tolerance (from -1 to INT_MAX) (default -1)
  -minversion        <int>        ED....... The minimum SRT version that is required from the peer (from -1 to INT_MAX) (default -1)
  -streamid          <string>     ED....... A string of up to 512 characters that an Initiator can pass to a Responder
  -smoother          <string>     ED....... The type of Smoother used for the transmission for that socket
  -messageapi        <int>        ED....... Enable message API (from -1 to 1) (default -1)
  -transtype         <int>        ED....... The transmission type for the socket (from 0 to 2) (default 2)
     live                         ED.......
     file                         ED.......
```

# 追加情報

[ffmpegのダウンロードのページ](https://www.ffmpeg.org/download.html)からダウンロードできるプリビルドバイナリでは残念ながらlibsrtは有効にはなっていませんでした。
なので、libsrtを使いたい場合はソースからビルドしましょう。
[ffmpeg 4.0 をlibsrtを有効にしてビルドする](https://qiita.com/tetsu_koba/items/92c398abd96c651f4035)
(ただし4.0でなくて4.1以降をcheckoutする)