WebCam Stream does not always come up

Camera model Logitech Webcam Pro 900

What is the problem? Sometimes when the system is booted, the webcam stream starts up as it should, other times it is constantly "loading".

What did you already try to solve it? Have gone through the forum searching for an answer, but not seen anything that specifically addresses this problem.

Additional information about your setup
OctoPrint version: 1.5.2
OctoPi version: 0.17.0
Raspberry Pi 4 Model B Rev 1.2 with 4GB

Logs webcam log:

 -- Logs begin at Thu 2020-12-17 18:02:54 GMT, end at Thu 2020-12-17 18:09:48 GMT
Dec 17 18:02:57 octopi systemd[1]: Starting the OctoPi webcam daemon with the us
Dec 17 18:02:57 octopi webcamd[338]: Starting up webcamDaemon...
Dec 17 18:02:57 octopi webcamd[338]: --- Configuration: ------------------------
Dec 17 18:02:57 octopi webcamd[338]: cfg_file:      /boot/octopi.txt
Dec 17 18:02:57 octopi webcamd[338]: camera:        auto
Dec 17 18:02:57 octopi webcamd[338]: usb options:   -r 640x480 -f 10
Dec 17 18:02:57 octopi webcamd[338]: raspi options: -fps 10
Dec 17 18:02:57 octopi webcamd[338]: http options:  -w ./www-octopi -n
Dec 17 18:02:57 octopi webcamd[338]: Explicitly USB device:
Dec 17 18:02:57 octopi webcamd[338]: -------------------------------------------
Dec 17 18:02:58 octopi webcamd[338]: Found video devices:
Dec 17 18:02:58 octopi webcamd[338]: /dev/video0
Dec 17 18:02:58 octopi webcamd[338]: /dev/video1
Dec 17 18:02:58 octopi webcamd[338]: /dev/video10
Dec 17 18:02:58 octopi webcamd[338]: /dev/video11
Dec 17 18:02:58 octopi webcamd[338]: /dev/video12
Dec 17 18:02:58 octopi webcamd[338]: config file='/boot/octopi.txt':USB device w
Dec 17 18:02:58 octopi webcamd[338]: <13>Dec 17 18:02:58 root: Starting USB webc
Dec 17 18:02:58 octopi webcamd[338]: Running ./mjpg_streamer -o output_http.so -
Dec 17 18:02:58 octopi mjpg_streamer[451]: MJPG-streamer [451]: starting applica
Dec 17 18:02:58 octopi mjpg_streamer[451]: MJPG-streamer [451]: MJPG Streamer Ve
Dec 17 18:02:58 octopi webcamd[338]: MJPG Streamer Version: git rev: 501f6362c5a
lines 1-23
-- Logs begin at Thu 2020-12-17 18:02:54 GMT, end at Thu 2020-12-17 18:09:48 GMT. --
Dec 17 18:02:57 octopi systemd[1]: Starting the OctoPi webcam daemon with the user specified config...
Dec 17 18:02:57 octopi webcamd[338]: Starting up webcamDaemon...
Dec 17 18:02:57 octopi webcamd[338]: --- Configuration: ----------------------------
Dec 17 18:02:57 octopi webcamd[338]: cfg_file:      /boot/octopi.txt
Dec 17 18:02:57 octopi webcamd[338]: camera:        auto
Dec 17 18:02:57 octopi webcamd[338]: usb options:   -r 640x480 -f 10
Dec 17 18:02:57 octopi webcamd[338]: raspi options: -fps 10
Dec 17 18:02:57 octopi webcamd[338]: http options:  -w ./www-octopi -n
Dec 17 18:02:57 octopi webcamd[338]: Explicitly USB device:
Dec 17 18:02:57 octopi webcamd[338]: -----------------------------------------------
Dec 17 18:02:58 octopi webcamd[338]: Found video devices:
Dec 17 18:02:58 octopi webcamd[338]: /dev/video0
Dec 17 18:02:58 octopi webcamd[338]: /dev/video1
Dec 17 18:02:58 octopi webcamd[338]: /dev/video10
Dec 17 18:02:58 octopi webcamd[338]: /dev/video11
Dec 17 18:02:58 octopi webcamd[338]: /dev/video12
Dec 17 18:02:58 octopi webcamd[338]: config file='/boot/octopi.txt':USB device was not set in options, start MJPG-str
Dec 17 18:02:58 octopi webcamd[338]: <13>Dec 17 18:02:58 root: Starting USB webcam
Dec 17 18:02:58 octopi webcamd[338]: Running ./mjpg_streamer -o output_http.so -w ./www-octopi -n -i input_uvc.so -r
Dec 17 18:02:58 octopi mjpg_streamer[451]: MJPG-streamer [451]: starting application
Dec 17 18:02:58 octopi mjpg_streamer[451]: MJPG-streamer [451]: MJPG Streamer Version: git rev: 501f6362c5afddcfb4105
Dec 17 18:02:58 octopi webcamd[338]: MJPG Streamer Version: git rev: 501f6362c5afddcfb41055f97ae484252c85c912
lines 1-23
-- Logs begin at Thu 2020-12-17 18:02:54 GMT, end at Thu 2020-12-17 18:09:48 GMT. --
Dec 17 18:02:57 octopi systemd[1]: Starting the OctoPi webcam daemon with the user specified config...
Dec 17 18:02:57 octopi webcamd[338]: Starting up webcamDaemon...
Dec 17 18:02:57 octopi webcamd[338]: --- Configuration: ----------------------------
Dec 17 18:02:57 octopi webcamd[338]: cfg_file:      /boot/octopi.txt
Dec 17 18:02:57 octopi webcamd[338]: camera:        auto
Dec 17 18:02:57 octopi webcamd[338]: usb options:   -r 640x480 -f 10
Dec 17 18:02:57 octopi webcamd[338]: raspi options: -fps 10
Dec 17 18:02:57 octopi webcamd[338]: http options:  -w ./www-octopi -n
Dec 17 18:02:57 octopi webcamd[338]: Explicitly USB device:
Dec 17 18:02:57 octopi webcamd[338]: -----------------------------------------------
Dec 17 18:02:58 octopi webcamd[338]: Found video devices:
Dec 17 18:02:58 octopi webcamd[338]: /dev/video0
Dec 17 18:02:58 octopi webcamd[338]: /dev/video1
Dec 17 18:02:58 octopi webcamd[338]: /dev/video10
Dec 17 18:02:58 octopi webcamd[338]: /dev/video11
Dec 17 18:02:58 octopi webcamd[338]: /dev/video12
Dec 17 18:02:58 octopi webcamd[338]: config file='/boot/octopi.txt':USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
Dec 17 18:02:58 octopi webcamd[338]: <13>Dec 17 18:02:58 root: Starting USB webcam
Dec 17 18:02:58 octopi webcamd[338]: Running ./mjpg_streamer -o output_http.so -w ./www-octopi -n -i input_uvc.so -r 640x480 -f 10 -d /dev/video0
Dec 17 18:02:58 octopi mjpg_streamer[451]: MJPG-streamer [451]: starting application
Dec 17 18:02:58 octopi mjpg_streamer[451]: MJPG-streamer [451]: MJPG Streamer Version: git rev: 501f6362c5afddcfb41055f97ae484252c85c912
Dec 17 18:02:58 octopi webcamd[338]: MJPG Streamer Version: git rev: 501f6362c5afddcfb41055f97ae484252c85c912

Is it possible that it starts up as it should if you power on the printer before you power on the pi?
If that's the case try this:

Haven't noted whether that is the case, but will check it out today. Thanks for the heads up.
I didn't say before, but I'm running OctoPrint on a windows 10 PC with the latest updates.

Think I found something that at least brings back the webcam, just issue the commands:

sudo pkill mjpg_streamer
sudo pkill mjpg_streamer

via SSH...