Hello
I have an Rpi-4 with an ArduCam 16MP cam attached.
Running latest bookworm with Raspberry Pi Desktop:I have a small Flask application to stream video to a simple index.html page.
The streaming works just fine. However, the streaming image is blurry and I cannot get the stream to auto-focus
From the Raspberry Pi Desktop, I open a CLI window and issue the following:This works - I can see the autofocus working and the image begins streaming within a second or two.
Creating a sample image, create a very sharp/clear image as wellI've fiddled with this for quite some time, trying different options to get autofocus working.
My objective is to stream, in near real time, from a RaspberryPi residing on my Wifi network to a PC residing on the same network. The PC views the stream by navigating to the Raspberry PI IP address.
I tried getting rpicam-vid to stream via my Flask app but could not get that to work.
I am open to alternative approaches gstreamer or rpicam - my key goal is a real time (or near real time) video stream via Flask.
Any ideas/suggestions would be appreciated.
Regards
I have an Rpi-4 with an ArduCam 16MP cam attached.
Running latest bookworm with Raspberry Pi Desktop:
Code:
$ cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"NAME="Debian GNU/Linux"VERSION_ID="12"VERSION="12 (bookworm)"VERSION_CODENAME=bookwormID=debianHOME_URL="https://www.debian.org/"SUPPORT_URL="https://www.debian.org/support"BUG_REPORT_URL="https://bugs.debian.org/"
The streaming works just fine. However, the streaming image is blurry and I cannot get the stream to auto-focus
From the Raspberry Pi Desktop, I open a CLI window and issue the following:
Code:
rpicam-vid -t 0 --autofocus-mode auto --width 1024 --height 960
Creating a sample image, create a very sharp/clear image as well
Code:
rpicam-still -t 1 -o test.jpg --autofocus-mode auto --width 1024 --height 1024
Code:
However, when I attempt the same using gstreamer, the image streams but remains blurry process = subprocess.Popen( [ "gst-launch-1.0", "libcamerasrc", "!", "video/x-raw,width=1280,height=960,framerate=30/1", "!", "videoconvert", "!", "jpegenc", "!", "multipartmux", "boundary=frame", "!", "fdsink", "fd=1" ], stdout=subprocess.PIPE, stderr=subprocess.PIPE, )
My objective is to stream, in near real time, from a RaspberryPi residing on my Wifi network to a PC residing on the same network. The PC views the stream by navigating to the Raspberry PI IP address.
I tried getting rpicam-vid to stream via my Flask app but could not get that to work.
I am open to alternative approaches gstreamer or rpicam - my key goal is a real time (or near real time) video stream via Flask.
Any ideas/suggestions would be appreciated.
Regards
Statistics: Posted by JohnA5656 — Thu Oct 17, 2024 12:55 pm