Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to stream a live webcam feed from my raspberry pi using ffserver and ffmpeg and a usb webcam (Logitech C615). I know the webcam, the driver, the network connection, etc, are good as I can stream with motion running on the Pi and view the stream in Firefox or Chromium just by going to 192.168.1.115:8081 in the browser.
I know ffserver is working (configured to port 8080) and ffmpeg also works: if I start it with
and then put the address in a browser on my desktop 192.168.1.115:8080/webcam.mjpeg the browser just spins "waiting for 192.168.1.115" until I kill ffmpeg on the Pi. Then the browser pops open a dialog offering to open or save the file webcam.mjpeg, but all it saves is an empty text file.
:~ $ ffserver -d -f /etc/ffserver.conf
ffserver version N-78597-g9dd4dcd Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.9.2 (Raspbian 4.9.2-10)
configuration: --enable-libfreetype --enable-gpl --enable-nonfree --enable-libx264 --enable-libass --enable-libmp3lame --bindir=/usr/local/bin
libavutil 55. 18.100 / 55. 18.100
libavcodec 57. 24.103 / 57. 24.103
libavformat 57. 25.101 / 57. 25.101
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 34.100 / 6. 34.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
/etc/ffserver.conf:26: Setting default value for video bit rate tolerance = 500000. Use NoDefaults to disable it.
/etc/ffserver.conf:26: Setting default value for video rate control equation = tex^qComp. Use NoDefaults to disable it.
/etc/ffserver.conf:26: Setting default value for video max rate = 31670144. Use NoDefaults to disable it.
/etc/ffserver.conf:26: Setting default value for video buffer size = 4000000. Use NoDefaults to disable it.
Mon Feb 22 14:38:42 2016 FFserver started.
Now the "connection refused" errors are gone but browsers are still acting the same way -- unable to show the stream and wanting to download an empty file after ffmpeg is killed.
Here's what the output from ffmpeg looks like when it starts up now:
Getting back to this ...
Trying to simplify things to isolate the problem, I compiled ffmpeg on my Xubuntu box & installed it locally (in my home dir, not /usr, to avoid conflicts with libav) & I'm trying to get everything working on it, then I can move it over to the Pi.
I modified ffserver.conf to this (the significant change was to the HTTP bind address on line 2):
and voila! it opens a window and displays the live camera feed. There's a slight delay but quality is good and keeps up with movement. Great! I close that and try to do the same thing in Firefox, but it doesn't open the video, it wants to open the file (webcam.mjpeg) with ... I should select application to open it ... or save it. I try Chrome but it doesn't display the stream either, it just starts saving webcam.mjpeg to my downloads folder.
So what's going on? I keep finding tutorials that say Firefox and Chrome can display mjpeg streams directly just by browsing to the source, but they all seem to be a few years old. Have the browsers been changed to make them unable to do this anymore?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.