lubuntu マシンでインターネット経由でウェブカメラ データをストリーミングしようとしています。これを実現するために、ffmpeg と ffserver をインストールしました。しかし、私はこれを機能させることができないようです。webm 形式を使用して、HTML5 ビデオとして統合したいと考えています。インターネット上でこの例をいくつか見つけたので、それを基に設定を行いました。これは私が現在持っているffserver構成です:
HTTPPort 8090 # Port to bind the server to
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 10000 # Maximum bandwidth per client
# set this high enough to exceed stream bitrate
CustomLog -
#NoDaemon # Remove this if you want FFserver to daemonize after start
<Feed feed1.ffm> # This is the input feed where FFmpeg will send
File ./feed1.ffm # video stream.
FileMaxSize 5M # Maximum file size for buffering video
ACL allow 127.0.0.1 # Allowed IPs
</Feed>
<Stream camera1.webm> # Output stream URL definition
Feed feed1.ffm # Feed from which to receive video
Format webm
# Audio settings
#AudioCodec vorbis
#AudioBitRate 64 # Audio bitrate
NoAudio
# Video settings
VideoCodec libvpx
VideoSize 640x480 # Video resolution
VideoFrameRate 2 # Video FPS
AVOptionVideo flags +global_header # Parameters passed to encoder
# (same as ffmpeg command-line parameters)
#AVOptionVideo cpu-used 0
AVOptionVideo qmin 1
AVOptionVideo qmax 42
#AVOptionVideo quality good
AVOptionAudio flags +global_header
#PreRoll 1
#StartSendOnKey
VideoBitRate 400 # Video bitrate
</Stream>
<Stream status.html> # Server status URL
Format status
# Only allow local people to get the status
ACL allow localhost
ACL allow 192.168.0.0 192.168.255.255
</Stream>
<Redirect index.html> # Just an URL redirect for index
# Redirect index.html to the appropriate site
URL http://www.ffmpeg.org/
</Redirect>
私は FPS を 2 秒に設定しました。私が使用しているコンピューターが達成できる最大値は、何らかの理由で 4 秒です。次に、次のコマンドで ffmpeg を開始します。
ffmpeg -f video4linux2 -s 640x480 -r 2 -i /dev/video0 -c:v libvpx http://localhost:8090/feed1.ffm.
入力は標準の UVC ウェブカメラであり、wprks が適切に動作し (チーズでテスト済み)、ffmpeg が機能しているように見え (ファイルを出力として設定すると適切に機能)、ffserver へのリンクが機能しているように見えます。2 つのプログラムは相互に認識します。アプリケーションが ffserver ストリームを要求すると、データを受信します。たとえば wget は、指定されたビットレートで期待されるサイズのファイルになります。ただし、Web ページでストリームを開くことはできません。私は 2 つの方法でそれを試しました: webm リンクを参照するだけです。firefox はデータを受信していることを示していますが、何も表示されません。ffserver は、通常の量のデータが転送されたことも示しています。私が試した 2 番目のオプションは、ビデオ ストリームのビデオ タグを含む Web ページでした。
<video with="640" height="480" autoplay>
<source src="http://localhost:8090/camera1.webm" type="video/webm">
</video>
しかし、これはどちらも機能しません。私がどこで間違ったのか誰が知っていますか?