-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate Iot.Devices.Camera to use new application naming #2371
Comments
Thank you for catching this. |
What about possibly using the rpicam-apps version string? The API function |
I am not familiar with the
From the sources, I see it is a C++ library. This is a problem because C++ does not have a standard ABI. The mangled name of the function may change in future recompilation and break the library. Such APIs should be exposed using the "C" contract which always work. Thanks |
In Instead of this, how about using $ apt policy rpicam-apps 2>/dev/null | grep 'Candidate:' | awk '{print $2}'
1.5.3-1 Would that be more suitable? |
Unfortunately Libcamera C++ bindings are causing a lot of problems to everyone producing a library in any language. Running the The problem is that this operation may eventually be run many times when someone is using the library to open/close the camera multiple times. |
Perhaps you can explain how you are using the library .so file in more detail? This would help reach a better solution if possible. |
@naushir sure, let me explain. When Raspbian transitioned to the But let me write a TLDR here: BTW the Python bindings provided by the Raspberry PI foundation do not suffer from this problem because they are generated and shipped along with the OS. If you always recompile the binaries and the interoperability code, you can safely use the mangled names. To overcome this problem, I created a "binding" that invokes the libcamera apps and capture the stdout/stderr. It's far from being perfect but is a great workaround to avoid the problems described above. I hardcoded the libcamera tool names because I could never image that they could change at any time. We are not alone. The entire community around the Raspberry PI has been hit by this same problem. There are a lot of libraries that are still recommending to switch to the legacy stack for this reason. But with the latest 64 bits OS versions the legacy stack is not provided anymore and therefore all those libraries are broken. What do we need (and not just us)?
Thanks |
I won't go into the details as this is been discussed many times over the years, but the legacy stack was a dead end for Raspberry Pi. It's fully closed source (so no 3rd party camera support), extremely difficult to maintain because of closed binary blobs, and would not gain any advanced camera features (e.g. PDAF or HDR). Using libcamera alleviates all these issues and adds significantly more control of the imaging system to our users.
I could declare
I know the libcamera development team have plans for C bindings for the API, but cannot comment on timeframes for when this may be available. But rpicam-apps will remain a C++ API even if/when a C API for libcamera is available. We don't have the engineering resources to rework this ourselves.
This is already available as the codecs go through a standard V4L2 memory-to-memory interface. You can see the interface in |
Sure, I just wanted to start from a common acknowledgement. I fully share the reasons for the migration, but my personal opinion is that the choice to have a C++ library only is causing a huge damage to the ecosystem.
Yes, this would be a great way to identify the correct stack.
Kieran told me this as well a long time ago telling also that is not a priority. This means that it will take years before seeing something like that. Among the others, the rust, telephony and robotics communities are also struggling on this, but nothing happened. Libcamera is too vast to think that anyone else from the community will start wrapping the C++ library, not to count on the efforts required to keep it updated over the libcamera future changes.
I've see that in the past, but the VL42 compatibility layer for libcamera does not work as I expected (I already tried that) and I am not sure how to pipe the video into the encoder to get the H.264 stream out of a libcamera stack. Thank you very much! |
The updates will only be available on Bookworm and later. So you will have to do a
There may be some confusion here. |
Got it:
At this point, beyond just seeing if the symbol exists, do you see any value in getting the version number? I am currently using the libcamera command line. If anything is different there, I should understand it from the version number, right?
Right. Thanks! |
The version number is probably not useful for what you want to test.
For V4L2 H.264 encoding that's correct, it's completely unrelated to libcamera.
It does not, but it can be used as simple example of how you can drive the video encoder through the V4L2 API. It's not meant to be called externally from outside |
Thanks for all the answers. |
The code is already checked into the repo, but we don't have a target date yet for a new package release. Hopefully it will happen towards the end of the month. |
To wrap-up, this is the draft of the detection algorithm. We'll have to discuss in the triage which part is worth running every time in the binding, and what else we can do to avoid wasting time. Detection algorithm
Camera stack detection:
Libcamera tools detection:
Libcamera tools detection on
|
Seems reasonable! |
@naushir sorry, one more question ... |
@mg-yolo-enterprises can you confirm that you are able to use the camera binding on Bookworm with the current release of the dotnet/iot libraries? I had the opportunity to access a RPi5 and I see the symbolic links to the $ ls /usr/bin/lib* -la
lrwxrwxrwx 1 root root 12 Jun 17 2024 /usr/bin/libcamera-hello -> rpicam-hello
lrwxrwxrwx 1 root root 11 Jun 17 2024 /usr/bin/libcamera-jpeg -> rpicam-jpeg
lrwxrwxrwx 1 root root 10 Jun 17 2024 /usr/bin/libcamera-raw -> rpicam-raw
lrwxrwxrwx 1 root root 12 Jun 17 2024 /usr/bin/libcamera-still -> rpicam-still
lrwxrwxrwx 1 root root 10 Jun 17 2024 /usr/bin/libcamera-vid -> rpicam-vid
-rwxr-xr-x 1 root root 836 Jun 17 2024 /usr/bin/libcamerify
-rwxr-xr-x 1 root root 68984 Jan 25 2023 /usr/bin/libinput
-rwxr-xr-x 1 root root 15778 Nov 25 2023 /usr/bin/libnetcfg
-rwxr-xr-x 1 root root 136310 Apr 9 2024 /usr/bin/libtoolize |
I don't think this is possible. |
Per https://github.com/raspberrypi/rpicam-apps/blob/main/README.md the
libcamera-*
name has been updated torpicam-*
and "Users are encouraged to adopt the new application and library names as soon as possible".libcamera is still working with the current version of applications distributed with Raspberry Pi OS.
Further discussion: https://forums.raspberrypi.com/viewtopic.php?t=359569
The text was updated successfully, but these errors were encountered: