Closed jeffwitz closed 5 months ago
No pipelines work without the
config = True
I just tested the following code on my own webcam, which worked just fine :
cam = crappy.blocks.Camera(
'CameraGstreamer',
user_pipeline="gst-launch-1.0 v4l2src device=/dev/video0 name=source ! jpegdec ! videoconvert ! video/x-raw,format=BGR,width=640,height=480,framerate=30/1 ! autovideosink",
nb_channels=3,
img_depth=8,
config=False,
display_images=True,
displayer_framerate=30,
save_images=False,
freq=40,
img_shape=(480, 640, 3),
img_dtype='uint8',
)
I just need to make sure that the dimension in the pipeline and the one in img_shape
match. Please double-check that you're providing the img_shape
and img_dtype
arguments, and that they're consistent with the pipeline. If still not working, please copy-paste in your response the traceback you get with the debug=True
argument set.
but if we pass from :
nb_channels = 1
tonb_channels = 3
, no color permutation works
Cannot reproduce on my setup, where it's actually the opposite: nb_channels=1
gives me a buggy image, and nb_channels=3
gives me a nice color image. Which makes sense since the format=BGR
argument specifies a 3-channels image acquisition.
However, I see that in your pipeline you're omitting the final ! autovideosink
or equivalent at the end. As stated in the documentation (maybe not highlighted enough), The pipeline should be given as it would be in a terminal. Internally in Crappy, the last part of the pipeline is discarded and replaced with 'appsink name=sink'
. In your case, this means "video/x-raw,format=BGR"
is actually ignored ! See my code snippet above for an example of how the pipeline should be provided.
Ok, that workscimg_shape
and img_dtype
are just needed for config=False
.
Hello,
I found two different bugs in CameraGstreamer.
1 ) No pipelines work without the
config = True
, as it needs to know the size of the imageIt would be possible to catch the height and width if they are provide in after videoconvert If it is not given, then you could ask to activate the configuration windows or ask to give those 2 parameters.
2 ) Impossible to have a color image
this code works :
but if we pass from :
nb_channels = 1
tonb_channels = 3
, no color permutation works, It works when using Gstreamer with V4L2 implementation gstreamer_camera_v4l2.py, so I think it could be possible to correct.