Then run the server (as a background process so we can keep using this session) with: ffserver & Create it with these contents # ffserver configuration for an mjpeg stream The ffserver configuration file is located at /etc/nf. It's important to make sure mjpg-streamer is stopped before trying this. We're setting up ffserver to use the same port as the default mjpg-streamer port. Second, an ffmpeg process is launched that pulls video from the webcam and feeds it to ffserver. First, an ffserver process is run that sets up the actual streaming server, which serves an mjpeg stream and static jpg images. On the other hand, now that I know how easy this is to get running, my next step is to look in to replacing the mjpeg stream with a low bitrate h264 stream, to take advantage of the hardware encoder on the Pi. But on older Pis this extra load may be a problem. I've had no problems running this setup for a few prints around 1.5-2 hours each. On my Raspberry Pi 3B+ running a USB webcam (Logitech C920), ffmpeg is consuming ~20% CPU, and pushes the load average up around 0.2-0.3. This method will likely involve some transcoding, so I expect it to be more CPU-intensive than mjpg-streamer. If you've successfully installed OctoPrint following, then you'll be fine. It expects a basic knowledge of Linux - how to create and edit text files, and how to run commands. This guide explains how I set up ffmpeg as a drop-in replacement for mjpeg-streamer. So I did a little reading and figured out how to set up a streaming mjpeg server using tools I already had installed on my Pi - ffmpeg. I'd been wanting to add a webcam to my OctoPrint setup for a little while now, but I'm a professional sysadmin (ie, really, really lazy), and having to build and install mjpg-streamer manually just did not appeal.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |