Repository navigation
Conversation
Several pixel formats map to the same GStreamer caps, e.g. video/x-raw, format=YUY2 is produced by YUV422_YUYV_Packed, YCbCr422_8_Packed and CUSTOM_YUV_422_YUYV_PACKED. gst_aravis_get_all_camera_caps() advertises YUY2 when the camera has any of them, but gst_aravis_set_caps() uses arv_pixel_format_from_gst_caps(), which always returns the first matching table entry (YUV422_YUYV_Packed). On cameras that only have YCbCr422_8 (e.g. Basler USB3 Vision cameras) caps negotiation succeeds, but setting the pixel format fails: Could not set caps on camera "Basler-24741017": [PixelFormat] Value 34603058 not found Check the selected pixel format against the available pixel formats of the camera, and if it is not available, use an available pixel format with the same caps. When the first matching format is available, the behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several pixel formats map to the same GStreamer caps, e.g.
video/x-raw, format=YUY2is produced byYUV422_YUYV_Packed,YCbCr422_8_PackedandCUSTOM_YUV_422_YUYV_PACKED.gst_aravis_get_all_camera_caps()advertises YUY2 when the camera has any of them, butgst_aravis_set_caps()usesarv_pixel_format_from_gst_caps(), which always returns the first matching table entry (YUV422_YUYV_Packed). On cameras that only haveYCbCr422_8(e.g. Basler USB3 Vision cameras) caps negotiation succeeds, but setting the pixel format fails:This change checks the selected pixel format against the available pixel formats of the camera, and if it is not available, uses an available pixel format with the same caps. When the first matching format is available, the behaviour is unchanged.
Tested with aravis 0.8.37 on an NVIDIA Jetson with a Basler USB3 Vision camera (pixel formats: BayerGB8, BayerGB12, YCbCr422_8, RGB8):
aravissrc ! video/x-raw,format=YUY2 ! …now streams. Builds on main.🤖 Generated with Claude Code