TheImagingSource / tiscamera

The Linux SDK for The Imaging Source cameras.
https://www.theimagingsource.com
Apache License 2.0
297 stars 145 forks source link

Unable to convert between caps formats [GRAY12p, 1920x1080, 8192/225] #518

Closed Niv-R closed 1 year ago

Niv-R commented 1 year ago

Describe the bug Using camera: TIS_DMK_39GX265_Z20_TI I am trying to upgrade from tiscamera 0.14.0 to 1.1.0. My code looks like this: pipeline: Gst.Pipeline = Gst.parse_launch("tcambin serial=... name=source ! video/x-raw,format=GRAY12p,width=1920,height=1080,framerate=8192/225 ! valve name=valve ! appsink name=sink") state = pipeline.set_state(Gst.State.READY) the returned state appears to be Gst.StateChangeReturn.FAILURE

using Gst.debug_set_default_threshold(Gst.DebugLevel.WARNING) I see:

0:01:12.917753128 346 0x7f64a8057980 WARN tcamconvert tcamconvert.cpp:214:gst_tcamconvert_transform_caps:<tcambin-converter> error: Unable to convert between caps formats 0:01:12.932470709 346 0x7f64a8057980 WARN GST_PADS gstpad.c:4231:gst_pad_peer_query:<source:src> could not send sticky events

Using tcam-ctrl -c I can see the caps I use, but using the function print_formats from examples/python/04-list-formats.py did not show GRAY12p at all.

computer used (please complete the following information):

TIS-Stefan commented 1 year ago

The failure is returned, because the valve prevents the start. The appsink does not get an image and therefore does not configure itself (or something like that.) I detected this behaviour, when I changed from Gstreamer 0.10 to version 1.0.

I found no workaround.

Stefan

Niv-R commented 1 year ago

I removed the valve from the pipeline and the error still persists:

pipeline is now: tcambin serial=... name=source ! video/x-raw,format=GRAY12p,width=1920,height=1080,framerate=8192/225 ! appsink name=sink then setting state to READY works but setting state to PLAYING afterwards fails:

tcamconvert tcamconvert.cpp:214:gst_tcamconvert_transform_caps:<tcambin-converter> error: Unable to convert between caps formats GST_PADS gstpad.c:4231:gst_pad_peer_query:<source:src> could not send sticky events basesrc gstbasesrc.c:3072:gst_base_src_loop:<source> error: Internal data stream error basesrc gstbasesrc.c:3072:gst_base_src_loop:<source> error: streaming stopped, reason not-negotiated (-4)

TIS-Stefan commented 1 year ago

Ouch, I am sorry. tcambin does not like GRAY12p. tcamsrc does like it.

tcambin serial=... name=source ! video/x-raw,format=BGRx

or with tcamdutils tcambin serial=... name=source ! video/x-raw,format=RGBx64

Stefan

Niv-R commented 1 year ago

changing tcambin serial=... ! video/x-raw,format=GRAY12p to tcamsrc serial=... ! video/x-raw,format=GRAY12p solved this issue for me