guysoft / OctoPi

Scripts to build OctoPi, a Raspberry PI distro for controlling 3D printers over the web
GNU General Public License v3.0
2.47k stars 366 forks source link

[Request] how about new streamer? #529

Open Vexatuspl opened 6 years ago

Vexatuspl commented 6 years ago

Hi,

As you know a lot of people are having issues with making the mjpg-streamer work and as a matter of fact the project has been already abandoned. Have you been thinking about moving to a different piece of software? I've heard some good opinions about motion for example.

Best regards Greg

guysoft commented 6 years ago

Do you (or anyone) have one in mind that is better?

Vexatuspl commented 6 years ago

I've read of people using Motion with some success and it is at least an ongoing project: https://github.com/Motion-Project/ I've also found this for of mjpg-streamer: https://github.com/jacksonliam/mjpg-streamer But as stated before - I'm seeing awfully lot of issues people are having with mjpg-streamer. Like not all the webcams are supported and even the supported ones do not always tend to work.

guysoft commented 6 years ago

Motion is not a streamer, it takes saves only when the image has changed from an existing stream. The second open you posted is what we use today: https://github.com/guysoft/OctoPi/blob/devel/src/modules/octopi/config#L18

Again - is there aa different option at all?

hansaya commented 6 years ago

I think UV4L is a good option. From what I heard UV4L better than mjpg-streamer but I personally haven't tried it yet. https://www.linux-projects.org/uv4l/

hansaya commented 6 years ago

I ran into this interesting project as well: https://datarhei.github.io/restreamer/ https://www.raspberrypi.org/forums/viewtopic.php?t=132503

guysoft commented 6 years ago

Ok, I don't really have the time to figure out which one is better. And honestly no time to implement it unless we know its better. You are welcome to test and report, and it might be used to add this later on. If we see some demo where it works better in OctoPrint it might be something I can ship.

UV4L sounds better than restreamer that did not update in 2 years.

natiz commented 6 years ago

I played around with UV4L a bit, seems pretty decent. Haven't done much testing on performance or anything, but here is some info which might help push this thing forward. This is what I did to set this up:

curl http://www.linux-projects.org/listing/uv4l_repo/lrkey.asc | apt-key add -
echo "deb http://www.linux-projects.org/listing/uv4l_repo/raspbian/stretch stretch main" >> /etc/apt/sources.list
sudo apt-get update
sudo apt-get install uv4l uv4l-uvc v4l-decoder uv4l-encoder uv4l-renderer uv4l-server uv4l-webrtc
sudo service uv4l_uvc add 046d:082d

This one if for USB camera, the setup of a picam is a bit different. 046d:082d being the cam device-id, which can be taken from lsusb

The stream URLs are then available: http://octopi.local:8090/stream/video.mjpeg http://octopi.local:8090/stream/snapshot.jpeg?delay_s=0 The only issue I had is embedding it on octoprint - as it seems to add a timestamp to the url query param, which video.mjpeg then don't like. I then just commented it out from the dist js files (packed_plugins.js and packed_core.js located in ~/.octoprint/generated/webassets) The resolution can then be changed using the control panel: http://octopi.local:8090/panel

guysoft commented 5 years ago

Gadget Angel posted on the community forum how to use ffmpegserver as a streamer, that is a good candidate: https://community.octoprint.org/t/how-to-simultaneously-stream-3-streams-from-a-raspberry-pi-camera/11330?u=guysoft

I am kinda busy this days, so if anyone wants to write a script/test it more. That will speed stuff up.

guysoft commented 5 years ago

Well I guess for not its not ffmpeg: https://community.octoprint.org/t/how-to-simultaneously-stream-3-streams-from-a-raspberry-pi-camera/11330/17?u=guysoft

tl;dr Detailed tests show its not better.

hevilp commented 4 years ago

I played around with UV4L a bit, seems pretty decent. Haven't done much testing on performance or anything, but here is some info which might help push this thing forward. This is what I did to set this up:

curl http://www.linux-projects.org/listing/uv4l_repo/lrkey.asc | apt-key add -
echo "deb http://www.linux-projects.org/listing/uv4l_repo/raspbian/stretch stretch main" >> /etc/apt/sources.list
sudo apt-get update
sudo apt-get install uv4l uv4l-uvc v4l-decoder uv4l-encoder uv4l-renderer uv4l-server uv4l-webrtc
sudo service uv4l_uvc add 046d:082d

This one if for USB camera, the setup of a picam is a bit different. 046d:082d being the cam device-id, which can be taken from lsusb

The stream URLs are then available: http://octopi.local:8090/stream/video.mjpeg http://octopi.local:8090/stream/snapshot.jpeg?delay_s=0 The only issue I had is embedding it on octoprint - as it seems to add a timestamp to the url query param, which video.mjpeg then don't like. I then just commented it out from the dist js files (packed_plugins.js and packed_core.js located in ~/.octoprint/generated/webassets) The resolution can then be changed using the control panel: http://octopi.local:8090/panel

Hi,

can you make plugin for octoprint? I'm not familiar to edit those files.

thanks in advance