I had a similar user context issue on a different project. For my gaming APK site, I solved it by explicitly setting the user in the script header with #!/bin/bash -u and defining UID before exec. The fork behavior you described matches what I saw. Check if bash is resetting the effective UID like Christoph mentioned. That was the culprit for me.
Your setup with mjpg-streamer on Ubuntu seems solid — the webcam light confirms it’s running, and you can usually preview it . If you’re exploring more ways to stream or use apps that extend functionality on different devices, resources like https://www.8bpoolproapk.com/ naturally come in handy since they cover various streaming-friendly apps and tools.