nol1ght
January 12th, 2008, 02:15 PM
Hello, this is my first how to so be talerand. And sorry for my english ).
This howto works perfect with my Logitech QuickCam Express webcam.
Well. We have installed and working webcam. And we want to share our video through the internet or local network.
1)First we have to install ffmpeg (http://ffmpeg.mplayerhq.hu/)
sudo apt-get install ffmpeg
2)Back up ffserver config file.
sudo mv /etc/ffserver.conf /etc/ffserver.conf_backup
3)Begin new ffserver config file. (this config was taken from http://www.webmasterworld.com/video/3514671.htm and edited by me)
sudo gedit /etc/ffserver.conf
paste into file lines below.
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>
4)Start ffserver. Open terminal.
ffserver
in ffserver config file you can delete line "NoDaemon" to run ffserver as daemon.
5)Start ffmpeg video stream.
ffmpeg -r 15 -s 352x288 -f video4linux -i /dev/video0 http://localhost:8090/feed1.ffm
If there is no any errors. its done )
Now you can watch the video.
Open your favorite player and open url http://localhost:8090/test.flv or http://localhost:8090/test.asf.
If you whant to watch your stream from another computer with windows media player:
type mms://<ip adress of ffserver machine>:8090/test.asf in IE
Also you can encode video to swf, mpeg and other formats . Read ffmpeg documentation.
If your internet connection is slow, you have make VideoFrameRate lower(1-5).
For streaming to flash player (swf)
add this lines to the end of ffserver.conf
<Stream test.swf>
Feed feed1.ffm
Format swf
VideoCodec flv
VideoFrameRate 2
VideoBufferSize 80000
VideoBitRate 100
VideoQMin 1
VideoQMax 5
VideoSize 352x288
PreRoll 0
Noaudio
</Stream>
Now you have another stream to test.sfw file then create <any name>.html file
Add this lines to it
<EMBED src="http://<ip adress of ffserver machine>:8090/test.swf" width=640 height=480 type="application/x-shockwave-flash"></EMBED>
then open it in your browser, enjoy )
I hope this howto was usefull for you. Have fun.
This howto works perfect with my Logitech QuickCam Express webcam.
Well. We have installed and working webcam. And we want to share our video through the internet or local network.
1)First we have to install ffmpeg (http://ffmpeg.mplayerhq.hu/)
sudo apt-get install ffmpeg
2)Back up ffserver config file.
sudo mv /etc/ffserver.conf /etc/ffserver.conf_backup
3)Begin new ffserver config file. (this config was taken from http://www.webmasterworld.com/video/3514671.htm and edited by me)
sudo gedit /etc/ffserver.conf
paste into file lines below.
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>
4)Start ffserver. Open terminal.
ffserver
in ffserver config file you can delete line "NoDaemon" to run ffserver as daemon.
5)Start ffmpeg video stream.
ffmpeg -r 15 -s 352x288 -f video4linux -i /dev/video0 http://localhost:8090/feed1.ffm
If there is no any errors. its done )
Now you can watch the video.
Open your favorite player and open url http://localhost:8090/test.flv or http://localhost:8090/test.asf.
If you whant to watch your stream from another computer with windows media player:
type mms://<ip adress of ffserver machine>:8090/test.asf in IE
Also you can encode video to swf, mpeg and other formats . Read ffmpeg documentation.
If your internet connection is slow, you have make VideoFrameRate lower(1-5).
For streaming to flash player (swf)
add this lines to the end of ffserver.conf
<Stream test.swf>
Feed feed1.ffm
Format swf
VideoCodec flv
VideoFrameRate 2
VideoBufferSize 80000
VideoBitRate 100
VideoQMin 1
VideoQMax 5
VideoSize 352x288
PreRoll 0
Noaudio
</Stream>
Now you have another stream to test.sfw file then create <any name>.html file
Add this lines to it
<EMBED src="http://<ip adress of ffserver machine>:8090/test.swf" width=640 height=480 type="application/x-shockwave-flash"></EMBED>
then open it in your browser, enjoy )
I hope this howto was usefull for you. Have fun.