LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 01-10-2012, 11:27 PM   #1
bschandra
LQ Newbie
 
Registered: Dec 2011
Posts: 2

Rep: Reputation: Disabled
Smile How to stream live video from web cam


Hi everybody...I've been trying to stream live video from web cam connected to my alix board, I could able to capture and stream a video..which is recorded but am unable to continuously buffer and telecast the video..please help me
by the way I used ffmpeg and lighttpd for capturing video and making my board as server respectively
 
Old 01-10-2012, 11:48 PM   #2
suicidaleggroll
Senior Member
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 2,747

Rep: Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977
I have a gumstix overo that I use to host a webpage that streams live video (4-5 second lag) from a USB webcam over wifi. Maybe this will help you:

/etc/ffserver.conf
Code:
# Port on which the server is listening. You must select a different
# port from your standard HTTP web server if it is running on the same
# computer.
Port 8090

# Address on which the server is bound. Only useful if you have
# several network interfaces.
BindAddress 0.0.0.0

# Number of simultaneous HTTP connections that can be handled. It has
# to be defined *before* the MaxClients parameter, since it defines the
# MaxClients maximum limit.
MaxHTTPConnections 2000

# Number of simultaneous requests that can be handled. Since FFServer
# is very fast, it is more likely that you will want to leave this high
# and use MaxBandwidth, below.
MaxClients 1000

# This the maximum amount of kbit/sec that you are prepared to
# consume when streaming to clients.
MaxBandwidth 1000

# Access log file (uses standard Apache log file format)
# '-' is the standard output.
CustomLog -

# Suppress that if you want to launch ffserver as a daemon.
NoDaemon

<Feed feed1.ffm>
        File /tmp/feed1.ffm #when remarked, no file is being created and the stream keeps working!!
        FileMaxSize 200K
       # Only allow connections from localhost to the feed.
       ACL allow 127.0.0.1
</Feed>

# SWF output - great for testing
<Stream test.swf>
        # the source feed
        Feed feed1.ffm
        # the output stream format - SWF = flash
        Format swf
        # this must match the ffmpeg -r argument
        VideoFrameRate 15
        # another quality tweak
        VideoBitRate 200
        # quality ranges - 1-31 (1 = best, 31 = worst)
        VideoQMin 4
        VideoQMax 6
        VideoSize 320x240
        # wecams don't have audio
        NoAudio
</Stream>

# 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 5
#       # another quality tweak
#       VideoBitRate 320
#       # quality ranges - 1-31 (1 = best, 31 = worst)
#       VideoQMin 1
#       VideoQMax 3
#       VideoSize 320x240
#       # wecams don't have audio
#       NoAudio
#</Stream>

<Stream stat.html>
        Format status
</Stream>

<Redirect index.html>
        # credits!
        URL http://ffmpeg.sourceforge.net/
</Redirect>

Startup script
Code:
nohup ffserver &> /home/camera/ffserver.out &
nohup ffmpeg -f video4linux2 -s 320x240 -r 15 -an -y -qscale 5 -i /dev/video0 http://127.0.0.1:8090/feed1.ffm &> /dev/null &

HTML page
Code:
<object align="center" width="376" height="240"><param name="movie" value="http://192.168.101.10:8090/test.swf">
<embed align="center" src="http://192.168.101.10:8090/test.swf" width="376" height="240">
</embed></object>

Naturally, /dev/video0 is my webcam, 192.168.101.10 is the gumstix IP, and the size and quality of the video have been adjusted to fit on the relatively weak CPU.

Last edited by suicidaleggroll; 01-10-2012 at 11:50 PM.
 
Old 01-11-2012, 12:06 AM   #3
propofol
Member
 
Registered: Nov 2007
Location: Seattle
Distribution: Debian Wheezy & Jessie; Ubuntu
Posts: 267

Rep: Reputation: 51
For uvcvideo webcams you could also try MJPG-streamer. Compile and start with:
Code:
./mjpg_streamer -i input_uvc.so -d /dev/video0 -r 640x480 -f 30 -o ./output_http.so -p 7000 -w ./www
This has a built in webserver.

Regards,
Stefan
 
  


Reply

Tags
serverhow, streaming, webcam


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to stream live mms video theblindhog Linux - Software 3 03-18-2009 07:46 AM
Can use my web cam mic for ekiga but not the video? BigVig Debian 1 02-21-2009 07:35 PM
capture video with web cam wabbalee Linux - General 2 01-14-2009 09:24 PM
how can i broadcast live video from a web cam to a server then to the internet charlotterob Linux - Software 2 12-27-2006 10:47 AM
Creating a live video stream little_penguin Linux - Software 1 08-12-2005 02:57 AM


All times are GMT -5. The time now is 01:25 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration