I've noticed to get a USB webcam working on a Pi I need to have the 3D printer turned on with a valid connection to the Pi, in order to actually view the stream. Is this by design ? As the Pi is connected to the camera via USB, and shouldn't need a connection to the printer at all.
Anyway I hit another problem with installation, as my Pi 4 running Octoprint Pi 4 was losing comms to my PC, and hence the web portal.
If you find that you lose comms to your Raspberry Pi 4 while running Octoprint, connect via head mode (ie with HDMI, keyboard, mouse etc). Then check the messages in the linux log
sudo dmesg | grep brcmf
If you see any errors with -110, then the wifi firmware has crashed
ieee80211 phy0: brcmf_run_escan: error (-110)
ieee80211 phy0: brcmf_cfg80211_scan: scan error (-110)
This seems to be a problem with the latest Octoprint Pi image
OctoPrint Version 1.7.2
OctoPi version 0.18.0
You can repair it by downloading and copying the latest wifi firmware into the following folder
Backup original firmware first
sudo cp brcmfmac43455-sdio.bin brcmfmac43455-sdio.bin.orig
Then download the fixed one from here (or find a legitimate source)
And copy the downloaded firmware into the lib folder
sudo cp ~/Downloads/ brcmfmac43455-sdio.bin /lib/firmware/brcm/.
You can find the full problem and solution on this thread
Hope this helps anyone losing connection, and also viewing the web cam stream !