1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

SRT(Secure Reliable Transport)について色々ためす(3)

Posted at

1. 概要

SRTを使った映像伝送に関して、色々を実験したい。そこで、手ごろな環境でどのようなことができるのか調べていく。今回は配信映像をカメラの映像にしてみる。

2. これまでの記事

3. UVCカメラの映像を使う

3.1 準備

前回同様Listenerで待ち受け

gst-launch-1.0 -v srtserversrc uri="srt://:17001" latency=100 ! srtserversink uri="srt://:17002"

カメラ映像を見る側はListener起動、カメラ映像配信開始後い操作する。
VLC Playerで「ネットワークストリームを開く」。これは今後、基本的には変わらない。

srt://192.168.1.2:17002

※192.168.1.2はListenerのIPアドレス

3.2 ソフトウェアエンコード

カメラの映像をカラーバーとほぼ同じパラメータで配信開始

gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! video/x-raw,format=I420,width=640,height=480 ! x264enc ! mpegtsmux ! srtclientsink uri="srt://192.168.1.2:17001" latency=100

ソフトウェアエンコードのせいか遅延が半端ない。実用に耐えないと思われる。

3.2 ハードウェアエンコード(YUV->H.264)

gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! video/x-raw,format=I420,width=640,height=480 ! omxh264enc ! mpegtsmux ! srtclientsink uri="srt://192.168.1.2:17001" latency=100

遅延はかなり減ったがそれでもそれなりにある。目視で1秒くらい。
ローカル環境であることを考えるともう少し遅延が小さくなってほしい。

3.2 ハードウェアエンコード(MJPEG->H.264)

MJPEGからならマシかも。

gst-launch-1.0 v4l2src device=/dev/video0 ! image/jpeg,width=640,height=480,framerate=10/1 ! omxmjpegdec ! omxh264enc ! mpegtsmux ! srtclientsink uri="srt://192.168.1.18:17001" latency=100

余計遅くなった。

3.3 VLC Playerのキャッシュ

よく考えたら再生側のVLC Playerにキャッシュ設定があった。0msにすると再生開始自体がうまくいかないが、デフォルトの1000msから500msにしたら遅延が減ってなんとか再生できるレベル。

4. 懸念点・疑問点

  • 配信側の設定変更した後、Listener側も再起動しないとキャッシュやらで挙動がおかしくなる。
  • やはり遅延。VGAでこれだとデモにも使いずらい。
  • 見る側Caller、VLC Playerで停止したあとに配信側CallerやListenerにDropやPacket lostのログが出まくる。

5. 今後

遅延について調べるか、暗号化あたり調べる。

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?