LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 08-21-2011, 10:59 AM   #1
Micah
Member
 
Registered: Apr 2002
Location: OK, USA
Distribution: Slackware64 14
Posts: 180

Rep: Reputation: 31
Question ffserver ffmpeg live stream from webcam


I'm trying to get my Webcam to stream so I can watch it remotely... I can record the stream just fine but when I stream it with ASF I get only a black stream and can't figure out why...

I see only black OR white (depending on the options...) on the Windows Media Player side...

What am I looking for to fix?

ffsrv.conf
Code:
Port 8090
BindAddress 0.0.0.0

MaxClients 100
MaxBandwidth 100000
CustomLog -
NoDaemon

<Stream status>
Format status
</Stream>

<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 50M
ACL allow 127.0.0.1
</Feed>

<Stream cam.asf>
Feed feed1.ffm
Format asf
#VideoCodec msmpeg4v2
#VideoCodec msmpeg4
VideoCodec wmv1
VideoFrameRate 5
VideoSize 320x240
VideoBitRate 256
VideoBufferSize 20
VideoGopSize 30
NoAudio                                  
StartSendOnKey
#Preroll 0
</Stream>
In one console I type:
Code:
ffserver -f ./ffsrv.conf
In another I type:
Code:
ffmpeg -f alsa -ac 1 -i hw:0,0 \
       -f video4linux2 -i /dev/video0 \
       http://127.0.0.1:8090/feed1.ffm
# This webcam has audio as well, but the stream is not using it currently...
or
Code:
ffmpeg -f video4linux2 -i /dev/video0 http://127.0.0.1/feed1.ffm
From a Windows PC I navigate to http://remote/cam.asf

Last edited by Micah; 08-21-2011 at 11:00 AM. Reason: Updaed my link for streaming to include the port
 
Old 08-22-2011, 01:25 PM   #2
Micah
Member
 
Registered: Apr 2002
Location: OK, USA
Distribution: Slackware64 14
Posts: 180

Original Poster
Rep: Reputation: 31
if I changed the <Stream cam.asf> to the below, then it works in Safari... (settings are finiky)
Code:
<Stream test.mjpg>
Feed feed1.ffm
Format mpjpeg
#VideoSize 160x128 WORKS!
# 352x288 untested ?
VideoSize 640x480
#VideoSize 1280x720 WORKS w/ Errors and Slow
#VideoSize 320x240 320x256 vga qvga (black or no load)
VideoFrameRate 15
VideoBitRate 512
VideoIntraOnly
NoAudio
Strict -1
</Stream>
This makes me wonder if the ASF feed has an invalid resolution for the camera or something... =/
 
Old 08-31-2011, 08:50 PM   #3
Micah
Member
 
Registered: Apr 2002
Location: OK, USA
Distribution: Slackware64 14
Posts: 180

Original Poster
Rep: Reputation: 31
Latest Update:

I switched out the Camera with a iMicro CAM-IM3299..

ffmpeg command:
Code:
ffmpeg -f alsa -ac 1 -ab 64 -ar 22050 -i hw:0,0 \
      -f video4linux2 -s 640x480 -r 15 -b 2048 -pix_fmt yuv420p -intra -i /dev/video0 \
      -v 1 -r 30 -y -re -vcodec mpjpeg -pix_fmt yuvj420p http://127.0.0.1:8080/feed1.ffm
ffserver.conf
Code:
<Stream video.mjpg>
  Feed feed1.ffm
  Format mpjpeg 
  VideoSize 640x480
  VideoFrameRate 30
  VideoBitRate 2048
  VideoIntraOnly
  NoAudio
  Strict -1
</Stream>
This stream works lovely for mpjpeg (not my end goal but I figure if someone else is going to do this, might as well document.)
 
1 members found this post helpful.
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
extracting a stream from ffmpeg sumeet inani Linux - Newbie 3 11-18-2010 05:41 AM
ffmpeg, trying to demux VOB, subtitles show up in video stream Meson Linux - Software 1 01-29-2010 08:41 AM
live webcam streaming problem with ffmpeg Ameii83 Linux - Software 0 08-06-2009 10:12 PM
ffmpeg - Unsupported codec for output stream #0.0 yitzle Linux - Software 4 01-30-2008 04:37 AM
Can't we use ffserver to stream mpeg,rm files? tuxfood Linux - Software 0 01-05-2006 01:37 PM


All times are GMT -5. The time now is 01:43 PM.

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