VLCでストリーミング
vlcには動作させるために必要なソフトがかなり多数あるみたいなので再帰オプションを使ってインストールを行うと良いと思います。
(これをしないとインスト-ル途中で必要ソフトがないことによるエラーが発生したりしてかなり面倒になります)
(これをしないとインスト-ル途中で必要ソフトがないことによるエラーが発生したりしてかなり面倒になります)
(色分け:入力値、コマンドライン、コメント)
上流方向へ再帰的にインストールする
# portinstall -R vlc
===> Cleaning for vcdimager-0.7.23_3
===> Cleaning for libcdio-0.77_2
===> Cleaning for cdparanoia-3.9.8_8
===> Cleaning for libdvbpsi-0.1.5_1
===> Cleaning for libdvdnav-0.1.10_3
===> Cleaning for libopendaap-0.4.0_1
===> Cleaning for libdca-0.0.5
===> Cleaning for libmatroska-0.8.1
===> Cleaning for libid3tag-0.15.1b
===> Cleaning for libmodplug-0.8.4
===> Cleaning for libmpcdec-1.2.6
===> Cleaning for openslp-1.2.1_2
===> Cleaning for speex-1.2.b2,1
===> Cleaning for sdl_image-1.2.5_2
===> Cleaning for libcddb-1.3.0
===> Cleaning for automake-1.6.3
===> Cleaning for libebml-0.7.7
===> Cleaning for vlc-0.8.6.d,2
===> Vulnerability check disabled, database not found
===> Found saved configuration for vlc-0.8.6.d,2
===> Extracting for vlc-0.8.6.d,2
=> MD5 Checksum OK for vlc-0.8.6d.tar.bz2.
... (中略) ...
/usr/local/share/./vlc/osdmenu/dvd.cfg
/usr/local/share/./applications
/usr/local/share/./applications/vlc.desktop
/usr/local/share/./doc
/usr/local/share/./doc/vlc
/usr/local/share/./doc/vlc/bugreport-howto.txt
/usr/local/share/./doc/vlc/fortunes.txt
/usr/local/share/./doc/vlc/intf-cdda.txt
/usr/local/share/./doc/vlc/intf-vcd.txt
15900 blocks
install -o root -g wheel -m 444 /var/tmp/usr/ports/multimedia/vlc/
work/vlc-0.8.6d/doc/vlc.1 /usr/local/man/man1/
install -o root -g wheel -m 444 /var/tmp/usr/ports/multimedia/vlc/
work/vlc-0.8.6d/doc/vlc-config.1 /usr/local/man/man1/
if [ ! -d /usr/local/share/applications ]; then /bin/mkdir -p /usr/
local/share/applications ; fi
if [ ! -d /usr/local/share/pixmaps ]; then /bin/mkdir -p /usr/local
/share/pixmaps ; fi
install -o root -g wheel -m 444 /usr/ports/multimedia/vlc/files/wxv
lc.desktop /usr/local/share/applications
install -o root -g wheel -m 444 /var/tmp/usr/ports/multimedia/vlc/w
ork/fake//usr/local/share/vlc/vlc48x48.png /usr/local/share/pixmaps/
vlc.png
===> Compressing manual pages for vlc-0.8.6.d,2
===> Running ldconfig
/sbin/ldconfig -m /usr/local/lib
===> Registering installation for vlc-0.8.6.d,2
===> SECURITY REPORT:
This port has installed the following files which may act as
network servers and may therefore pose a remote security risk
to the system.
/usr/local/bin/vlc
/usr/local/lib/vlc/control/libnetsync_plugin.so
If there are vulnerabilities in these programs there may be a
security risk to the system. FreeBSD makes no guarantee about
the security of ports included in the Ports Collection. Please
type 'make deinstall' to deinstall the port if this is a
concern.
For more information, and contact details about the security
status of this software, see the following webpage:
http://www.videolan.org/
===> Cleaning for vlc-0.8.6.d,2
■HTTPで配信する場合
■複数のNICを搭載しているサーバからHTTPで配信する場合
ルータ目的以外で複数のNICを挿入しているということは無いと思いますので使い事はないと思いますがとりあえず。
■MPEG4へ変換しながらHTTPで配信する場合
ここで掲載している以外のオプションや詳細についてはVideoLAN Wikiサイト内の「Documentation」-「VLC Streaming Howto」-「Advanced Streaming Using the Command Line」に記載されています。
あとは、クライアント側からサーバ側へHTTPで接続を行います。
(色分け:入力値、コマンドライン、コメント)
(実際には1行)
# vlc -vvv 'movie.avi' --sout '#
standard{access=http,
mux=ogg,
dst=192.168.0.1:8080/movie.avi}'
standard{access=http,
mux=ogg,
dst=192.168.0.1:8080/movie.avi}'
[standardモジュールの主なパラメータ]
access --- 入力ファイルの出力方法(file,udp,http,https,mmsh,rtp)
mux --- 動画ファイルの形式(ts,ps,mpeg1,ogg,asf,asfh,avi,mpjpeg)
dst --- accessで指定した出力方法に応じた出力先
(httpの場合 ---> アドレス(ホスト名):ポート番号/パス)
access --- 入力ファイルの出力方法(file,udp,http,https,mmsh,rtp)
mux --- 動画ファイルの形式(ts,ps,mpeg1,ogg,asf,asfh,avi,mpjpeg)
dst --- accessで指定した出力方法に応じた出力先
(httpの場合 ---> アドレス(ホスト名):ポート番号/パス)
※バックグランドで作業をさせるには最後に"&"を付けます。
■複数のNICを搭載しているサーバからHTTPで配信する場合
(色分け:入力値、コマンドライン、コメント)
(実際には1行)
# vlc -vvv 'movie.avi' --sout '#duplicate{
dst=standard{access=http,
mux=ogg,
dst=192.168.0.1:8080/movie.avi},
dst=standard{access=http,
mux=ogg,
dst=192.168.1.1:8080/movie.avi}}'
dst=standard{access=http,
mux=ogg,
dst=192.168.0.1:8080/movie.avi},
dst=standard{access=http,
mux=ogg,
dst=192.168.1.1:8080/movie.avi}}'
※192.168.0.0/24側と192.168.1.0/24側の2つのネットワークへ配信
■MPEG4へ変換しながらHTTPで配信する場合
(色分け:入力値、コマンドライン、コメント)
(実際には1行)
# vlc -vvv 'movie.avi' --sout '#
transcode{vcodec=mp4v,
acodec=mpga,
vb=800,
ab=128}:
standard{access=http,
mux=ogg,
dst=192.168.0.1:8080/movie.avi}'
transcode{vcodec=mp4v,
acodec=mpga,
vb=800,
ab=128}:
standard{access=http,
mux=ogg,
dst=192.168.0.1:8080/movie.avi}'
[transcodeモジュールの主なパラメータ]
vcodec --- 変換するVideoコーデック
acodec --- 変換するAudioコーデック
vb --- Videoのビットレート
ab --- Audioのビットレート
vcodec --- 変換するVideoコーデック
acodec --- 変換するAudioコーデック
vb --- Videoのビットレート
ab --- Audioのビットレート
ここで掲載している以外のオプションや詳細についてはVideoLAN Wikiサイト内の「Documentation」-「VLC Streaming Howto」-「Advanced Streaming Using the Command Line」に記載されています。
あとは、クライアント側からサーバ側へHTTPで接続を行います。
他のストリーミングサーバとしてはRealPalyerやAppleなどもあるみたいなのですが、私が調べた限り、どちらも専用フォーマットに変換しないといけないようなことが書かれていましたので手持ちのファイルを使うことを考えている場合はVLCが良いように思います。
まあ、それ以外にFreeBSDのPorts一覧サイトで検索をしたときにVLCしか該当しなかったからというのもありますが、とりあえずここではVLCを動作させるところまでの構築メモを記載しています。
作成日:2008.7.9
更新日:2008.9.8