Streaming Wyze Cam v2 to Octo

What is the problem?

I have been trying to stream my Wyze Cam v2 through Octoprint. I have flashed the Wyze Cam v2 already to by able to do RTSP, and have confirmed the streaming address with VLC as per the forums.

What did you already try to solve it?

I have gone through several forums to try and find a step by step guide of trying to code and setup the Wyze Cam. I have found that the instructions are over my head or not complete.

I have a RTSP link and tested the stream successfully through VLC. I have tried following the two recommended options I have seen in the forums and have not been successful.

OPTION 1 (originally posted by SrgntBallistic):
Step 1 - edit ffserver.conf file by typing

sudo nano /etc/ffserver.conf

Step 2 - Cut and paste code into ffserver.conf as so:

File /tmp/camera.ffm
</Feed>
<Stream camera.mjpeg>
Feed camera.ffm
Format mpjpeg
VideoFrameRate 6
VideoSize 640x360
VideoBitRate 2048
VideoIntraOnly
NoAudio
Strict -1
</Stream>
<Stream static-camera.jpg>
Feed camera.ffm
Format jpeg
VideoFrameRate 2
VideoIntraOnly
VideoSize 1920x1080
NoAudio
NoDefaults
Strict -1
</Stream>

Making sure to save ffserver.conf before leaving (press shift-X, enter "yes", then press enter)

Step 3 - Type ffserver & into the terminal to start the server
Step 4 - This step didn't make sense to me, but SrgntBallistic writes "Run ffmpeg and have it pipe the rtsp stream into the feed defined in the ffserver config" then there is more code. So I took this code as follows and pasted it into terminal:

ffmpeg -rtsp_transport tcp -i 'rtsp://user:password@wyzeCamIP/live' http://127.0.0.1:8090/camera.ffm

Step 5 - Take your new web link http://octopiIP:8090/camera.mjpeg, and copy it to a browser. Obviously changing the IP to your own OctoPi (for example http://192.168.0.31:2067/camera.mjpeg). For me, this didn't work and I tried Chrome and IE.

At this point, I have no results and unable to figure out what has gone wrong. I tried replacing the IP with "localhost" or "127.0.0.1:8888", or even "0.0.0.0:8888", and none of these have changed the situation. I know the camera is working because I can see it in the Wyze app and also can see it through the RTSP stream link in VLC.

OPTION 2 (originally posted by atom6):
Step 1 - Do an update on your Raspberry Pi by typing each command one after the other into terminal:

ssh pi@<raspberry_ip>
sudo apt update
sudo apt install vlc

Unfortunately when I tried to do this, I ran into errors:

pi@octopi:~ $ sudo apt update
[sudo] password for pi:
Err:1 https://raspbian.freemirror.org/raspbian buster InRelease
  Temporary failure resolving 'raspbian.freemirror.org'
Err:2 http://archive.raspberrypi.org/debian buster InRelease
  Temporary failure resolving 'archive.raspberrypi.org'
Reading package lists... Done
Building dependency tree
Reading state information... Done
14 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Failed to fetch https://raspbian.freemirror.org/raspbian/dists/buster/InRelease  Temporary failure resolving 'raspbian.freemirror.org'
W: Failed to fetch http://archive.raspberrypi.org/debian/dists/buster/InRelease  Temporary failure resolving 'archive.raspberrypi.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.

STEP 2 - I moved on hoping this wasn't a make or break since it is a brand new install from the files on OctoPrint.

I followed the instructions to add code to http_stream.sh file:

nano http_stream.sh

STEP 3 - I then added the following code into the http_stream.sh file as such:

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

I then saved and closed the file (CTRL X, Press "yes", then press Enter)

STEP 4 - In this step atom6 wanted me to type the following into terminal on at a time:

chmod +x http_stream.sh
./http_stream.sh

As I did, nothing seemed to happen. I typed in each command and nothing was kicked back, not even an acknowledgement.

STEP 5 - In a browser (I did this for both Chrome and IE). I typed in the following address:

http://<raspberryip>:8888/videostream.cgi

Of course I made sure to change the IP address to my own raspberry pi, but just like in the other option above, I was not able to see a stream of any kind. The following was kicked back from the browser.

At this point I tried different IP variations as I did with Option 1, but was unsuccessful.

Complete Logs

Not sure how to do this. I am new to raspberry pi and OctoPrint. Learning, but definitely not a programmer or developer by trade. I am running a Raspberry Pi 4b with a 128gb card. It is connected by WAN, and I am accessing it through SSH (Putty). The Raspberry Pi is connected by USB to my Wanhao D9 printed.

Additional information about your setup

Running a newly installed build of Octoprint from the website from yesterday. Although I tried to do an update and it won't connect to the servers.

If someone can give me a step by step fix to get this going, I would appreciate it. I am not a programmer but I can follow instructions if they are clear and direct.

Thanks in advance.

Hello @C3DAR_LAB!

A quick forum search gives some results. Maybe you get closer to a solution by one of them:
https://community.octoprint.org/search?q=Wyze%20V2

As you see, the word Logs is a link. Just one click for further information.

UPDATE

After some offsite research, I might have figured out one of the issues with all this coding.

I was realizing that the Raspberry Pi was not able to connect to archive.raspberrypi.org when trying to make it do updates or when trying to get it download and install VLC. I was getting repeated errors of it not being able to connect. When I tried to ping, I could ping an IP such as 8.8.8.8, 8.8.4.4, and many others, but I could not get it to ping an address like "google.ca". I knew right away that the raspberry pi was not accessing the DNS in order to ping. I did some search around and found that some of the setting with this version of Raspian were not in place properly. I had to go in and make changes to my dhcpcd.conf file and point it toward the Google DNS server. I also found that the resolv.conf was not holding the IP addresses in its' file. So I made changes in their also. Right away I was able to start doing updates, load and install python-pip, and all of the other updates.

As a result, I started over again with SrgntBallistic's instructions to stream my Wyze. This time I am able to configure the ffserver.conf file, and it looks like it tries to load the settings, but it just seems to stall out.

In the browser I am able to load the IP address, but it is just a blank white screen. So I must have something wrong with my ffserver.conf file or I am missing a piece of code.