歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu 10.04上實現在辦公室遠程監控家中電腦攝像頭

Ubuntu 10.04上實現在辦公室遠程監控家中電腦攝像頭

日期:2017/2/28 16:30:25   编辑:Linux教程

在辦公室遠程監控家中電腦攝像頭,在偉大的Ubuntu 10.04上實現。

1安裝軟件:
代碼: sudo apt-get install ffmpeg
備份原始配制:
代碼: sudo mv /etc/ffserver.conf /etc/ffserver.conf_backup
編輯配制,把它改為下面的內容
代碼: sudo gedit /etc/ffserver.conf

代碼: Port 8090
# bind to all IPs aliased or not
BindAddress 0.0.0.0
# max number of simultaneous clients
MaxClients 1000
# max bandwidth per-client (kb/s)
MaxBandwidth 10000
# Suppress that if you want to launch ffserver as a daemon.
#NoDaemon

<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 5M
</Feed>

# FLV output - good for streaming
<Stream test.flv>
# the source feed
Feed feed1.ffm
# the output stream format - FLV = FLash Video
Format flv
VideoCodec flv
# this must match the ffmpeg -r argument
VideoFrameRate 15
# generally leave this is a large number
VideoBufferSize 80000
# another quality tweak
VideoBitRate 200
# quality ranges - 1-31 (1 = best, 31 = worst)
VideoQMin 1
VideoQMax 5
VideoSize 352x288
# this sets how many seconds in past to start
PreRoll 0
# wecams don't have audio
Noaudio
</Stream>

# ASF output - for windows media player
<Stream test.asf>
# the source feed
Feed feed1.ffm
# the output stream format - ASF
Format asf
VideoCodec msmpeg4
# this must match the ffmpeg -r argument
VideoFrameRate 15
# generally leave this is a large number
VideoBufferSize 80000
# another quality tweak
VideoBitRate 200
# quality ranges - 1-31 (1 = best, 31 = worst)
VideoQMin 1
VideoQMax 5
VideoSize 352x288
# this sets how many seconds in past to start
PreRoll 0
# wecams don't have audio
Noaudio
</Stream>

運行:

代碼: ffserver

再開一終端,也可以讓ffserver在後台運行:


代碼: ffmpeg -r 15 -s 352x288 -f video4linux2 -i /dev/video0 http://localhost:8090/feed1.ffm


在另一台電腦上,用支持網絡的播放器打開:
mms://xx.xx.xx.xx:8090/test.asf

xx.xx.xx.xx 為裝有ubuntu的公網ip 或域名。

路由器用戶要開端口映射或dmz主機
Copyright © Linux教程網 All Rights Reserved