zingmars / gst-pylonsrc

A gstreamer plugin for image capture from Basler's USB3 cameras. Please read the README before using.
Other
14 stars 7 forks source link

Mono8 to BGR24 conversion is getting failed #4

Closed devykrishna closed 5 years ago

devykrishna commented 5 years ago

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.

zingmars commented 5 years ago

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

devykrishna commented 5 years ago

Is there any option for this conversion (Mono8 to BGR24)?

zingmars commented 5 years ago

Supposedly BGR (without the 24) should work as an output format.

devykrishna commented 5 years ago

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.

devykrishna commented 5 years ago

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

zingmars commented 5 years ago

Please prepend your commands with GST_DEBUG=*:5 (right before the gst-launch-1.0 command). This should give a detailed log of what's happening and should make debugging this easier.

On Wed, Mar 20, 2019, 06:58 DevySyam notifications@github.com wrote:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zingmars/gst-pylonsrc/issues/4#issuecomment-474684963, or mute the thread https://github.com/notifications/unsubscribe-auth/AA3-hqB6fUpKydqtMooT-_OvD13hyjzxks5vYcACgaJpZM4b4Tmk .

devykrishna commented 5 years ago

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

devykrishna commented 5 years ago

Thanks for the support :)

zingmars commented 5 years ago

No problem. Best of luck with your endeavour.