Mono8 to BGR24 conversion is getting failed
devykrishna opened this issue · 9 comments
I have Basler acA1920-40gm camera. I need to convert mono8 video from camera to BGR24 in order to feed video into my application for further processing. First I tried with gst-launch-1.0 command to view stream from camera in PC.
gst-launch-1.0 -v pylonsrc width=1280 height=720 fps=10 imageformat=mono8 ! videoconvert ! 'video/x-raw,format=(string)BGR24' ! xvimagesink
Getting the following error
WARNING: erroneous pipeline: could not link videoconvert0 to xvimagesink0, videoconvert0 can't handle caps video/x-raw, format=(string)BGR24.
(If format is specified as YV12 it is working fine.)
pylon version : 5.1.0
Linux 18.04 64 bit.
According to https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-videoconvert.html videoconvert doesn't seem to support BGR24
Is there any option for this conversion (Mono8 to BGR24)?
Supposedly BGR (without the 24) should work as an output format.
I tried BGR conversion as follows.
gst-launch-1.0 -v pylonsrc imageformat=mono8 ! videoconvert ! video/x-raw,format=BGR ! xvimagesink
Result :
Setting pipeline to PAUSED ...
0:00:00.712165719 4190 0x5636fe832100 pylonsrc gstpylonsrc.c:2233:pylonc_print_camera_info: Status: Using camera "acA1920-40gm" (serial number: 0, id: 0). Custom ID: None
0:00:00.721207646 4190 0x5636fe832100 pylonsrc gstpylonsrc.c:1093:gst_pylonsrc_start: Setting resolution to 1920x1200.
0:00:00.730799528 4190 0x5636fe832100 pylonsrc gstpylonsrc.c:1217:gst_pylonsrc_start: Using Mono8 image format.
0:00:00.772921659 4190 0x5636fe832100 pylonsrc gstpylonsrc.c:2040:gst_pylonsrc_start: Initialised successfully.
Pipeline is live and does not need PREROLL ...
ERROR: from element /GstPipeline:pipeline0/GstPylonsrc:pylonsrc0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstPylonsrc:pylonsrc0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
Anything wrong in this command. Kindly help. I am stuck with this error.
Adding to the above comment.
I tried the following also. But the same results.
gst-launch-1.0 -v pylonsrc imageformat=mono8 ! video/x-raw,format=GRAY8 ! videoconvert ! video/x-raw,format=BGR ! xvimagesink
I tried the below and it worked for me.
gst-launch-1.0 -v pylonsrc imageformat=bgr8 ! videoconvert ! video/x-raw,format=BGR ! videoconvert ! xvimagesink
Actually xvimagesink only support YUV formats, (I didn't know that). By the above command BGR is convert to YV12 and it displays.
In application the below command will work.
gst-launch-1.0 -v pylonsrc imageformat=bgr8 ! videoconvert ! video/x-raw,format=BGR | appsink
Thanks for the support :)
No problem. Best of luck with your endeavour.