Install Dafang Hacks on the Wyze Cam.
Once running and all is functional, continue. Set video bitrate to 1500, VBR, 30fps.
If OctoPrint is running on a Raspberry Pi (3B minimum):
ssh pi@<raspberry_ip>
sudo apt update
sudo apt install vlc
VLC will be used to transcode the rtsp stream to a http stream which OctoPrint can use as streaming URL
nano http_stream.sh
paste the following line:
cvlc -I dummy rtsp://ip_of_yourcam --sout "#transcode{vcodec=mjpg,quality=3,fps=5,acodec=none,width=1280,height=720}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8888/videostream.cgi}" 2>/dev/null
Change the ip_of_yourcam to match the full rtsp url from your camera
CTRL+x to save
chmod +x http_stream.sh
./http_stream.sh
Now you should be able to open your browser:
http://<raspberryip>:8888/videostream.cgi
If it works, you can use this url in OctoPrint for the Stream URL
For the snapshot URL use the stills url from your camera
Change your user/pass and ip to match your setup
Click advanced options
and uncheck Validate SSL on snapshot URL (if applicable)
As this process is cpu intensive you will need to play around with the quality=x,fps=x
(fps = frames per second) options in the cvlc command. These settings work for me, but as I wanted better quality I have this process running on a more powerful device.
You're getting the hit of Python loops and openCV stream conversion. The VLC command that started this thread can be run from terminal w/out the overhead of Python. The command creates a HTTP endpoint and the framerate is adjustable. I found on a RP3 FPS=1 is about max framerate before the video feed starts to lag.
I've been using this command to create the stream and it's worked flawless for months.
cvlc -R rtsp://user:pwd@IPADDRESS/live --sout-x264-preset fast --sout='#transcode{acodec=none,vcodec=MJPG,vb=100,fps=1}:standard{mux=mpjpeg,access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},dst=:8888/videostream.cgi}' --sout-keep