20
18

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 5 years have passed since last update.

RasberyPiでH.264映像配信。Macで受信

Last updated at Posted at 2014-05-22

Gstreamer.jpg

raspiのカメラを使って動画配信に挑戦してみました。何故かUSBカメラだとうまく動かない(T_T)

インストール

インストール(RasberyPi側)

前提としてカメラモジュールが動くように設定済みとします。

Gstreamerのインストール

インストール
sudo su -

echo "deb http://vontaene.de/raspbian-updates/ . main" >> /etc/apt/sources.list

apt-get update

apt-get install libgstreamer1.0-0 libgstreamer1.0-0-dbg libgstreamer1.0-dev liborc-0.4-0 liborc-0.4-0-dbg liborc-0.4-dev liborc-0.4-doc gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gstreamer1.0-alsa gstreamer1.0-doc gstreamer1.0-omx gstreamer1.0-plugins-bad gstreamer1.0-plugins-bad-dbg gstreamer1.0-plugins-bad-doc gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-base-dbg gstreamer1.0-plugins-base-doc gstreamer1.0-plugins-good gstreamer1.0-plugins-good-dbg gstreamer1.0-plugins-good-doc gstreamer1.0-plugins-ugly gstreamer1.0-plugins-ugly-dbg gstreamer1.0-plugins-ugly-doc gstreamer1.0-pulseaudio gstreamer1.0-tools gstreamer1.0-x libgstreamer-plugins-bad1.0-0 libgstreamer-plugins-bad1.0-dev libgstreamer-plugins-base1.0-0 libgstreamer-plugins-base1.0-dev

インストール(Mac側 10.9系)

Gstreamerのインストール

インストール
brew install gstreamer

実行

配信処理

RasberyPiのIPが192.168.0.3だとしています。

配信

raspivid -t 999999 -w 1080 -h 720 -fps 25 -hf -b 2000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! tcpserversink host=192.168.0.3 port=5555

Macから受信

受信
gst-launch-1.0 -v tcpclientsrc host=192.168.0.3 port=5555 ! gdpdepay ! rtph264depay ! avdec_h264 ! videoconvert ! osxvideosink

RasPiのCPU負荷はFullHDでも20%くらいのようです。

top.png

20
18
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
20
18

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?