Hardware MJPEG encoding, any implementation? #3
Unanswered
SteveSpencer
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
Unfortunately I'm afraid this will not work. I'm not aware of any implementation for hardware video/image encoding for Circle. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi. I am looking at the possibility of porting my camera server which runs on bookworm on a Pi ZeroW, to make a cheap and cheerful IP camera (no zoom, no pan, no tilt).
It provides an MJPEG stream via http (and that's just about all it does), so it seems an ideal candidate to strip all the unnecessary OS components out. In addition, following a house move late last year, I want to put a couple of cameras around the garden. However, occasional power-outs mean I have had to reimage the uSD cards a couple of times. and Circle isn't as vulnerable to that, since once it's booted, there is a lot less disk activity.
Pi4 and earlier have jpeg encoding hardware, while the Pi5 doesn't, but is fast enough to handle the encoding in software.
Is there a way to have the earlier hardware do the encoding of the image, as I do with the linux libcamera?
It seems like a big ask, as I have no idea what would be involved.
I did have to derive my own class from Encoder, to specify the output and capture formats.
` v4l2_format fmt = {};
fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
fmt.fmt.pix_mp.width = info.width;
fmt.fmt.pix_mp.height = info.height;
fmt.fmt.pix_mp.pixelformat = V4L2_PIX_FMT_YUV420;
fmt.fmt.pix_mp.plane_fmt[0].bytesperline = info.stride;
fmt.fmt.pix_mp.field = V4L2_FIELD_ANY;
fmt.fmt.pix_mp.colorspace = V4L2_COLORSPACE_JPEG;
fmt.fmt.pix_mp.num_planes = 1;
if (xioctl(fd_, VIDIOC_S_FMT, &fmt) < 0)
throw std::runtime_error("failed to set output format");
`
Is there a way to do the same ? I'm not sure how the V4L stuff maps to the implementation.
Obviously, this will only be valid for Pi4 and earlier machines, and I would need to provide JPEG encoding for a Pi5 version, but that isn't something I need to worry about right now.
Thanks
Steve Spencer
Beta Was this translation helpful? Give feedback.
All reactions