How to decode RAW10(GRBG) on imx8mp

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to decode RAW10(GRBG) on imx8mp

1,618 Views
Bernie_Chen
Contributor II

Hi NXP

I referenced this thread blew

https://community.nxp.com/t5/i-MX-Processors/How-to-set-up-the-MIPI-CSI-2-and-ISI-to-transfer-RAW10-...

and I have streamed bayer(GRBG) data successfully by using

gst-launch-1.0 v4l2src device=/dev/video3 ! video/x-bayer,format=grbg,width=1920,height=1080,framerate=60/1 ! bayer2rgb ! fpsdisplaysink sync=0

but the preview is a little abnormal(but my skin color is normal), and I found imx8mp still using GRBG(raw8. I  have patched) to output format.

                                bypass csc
                                input fmt RGB4
                                output fmt GRBG

I think I should use v4l2-ctl to get raw data, and debayer to rgb image by dcraw command.

v4l2-ctl -d /dev/video3 --set-fmt-video=width=1920,height=1080,pixelformat=BA10 --set-parm=60 --stream-mmap --stream-count=1 --stream-to=/output_rggb.raw

                             bypass csc
                                  input fmt RGB4
                                 output fmt BA10

But the result is not good. my skin color is blue, please reference attached file blew

output_grbg.jpg

I checked the information of raw file by dcraw, I found some strange.

dcraw -v -i output_rggb.raw

Filename: output_rggb.raw
Timestamp: Thu Jan 1 00:00:00 1970
Camera: Photron BC2-HD
ISO speed: 0
Shutter: 0.0 sec
Aperture: f/0.0
Focal length: 0.0 mm
Embedded ICC profile: no
Number of raw images: 1
Full size: 1920 x 1080
Image size: 1920 x 1080
Output size: 1920 x 1080
Raw colors: 3
Filter pattern: GB/RG => still GB10???? I expect this value is GR/BG (BA10)
Daylight multipliers: 1.089011 0.973739 1.118123

Why imx8mp can't output format BA10?

Tags (2)
0 Kudos
Reply
3 Replies

1,602 Views
Bernie_Chen
Contributor II

attach the preview by

gst-launch-1.0 v4l2src device=/dev/video3 ! video/x-bayer,format=grbg,width=1920,height=1080,framerate=60/1 ! bayer2rgb ! fpsdisplaysink sync=0

skin color is normal, but light is strange, I think it is output by raw8

                                bypass csc
                                input fmt RGB4
                                output fmt GRBG

preview.png

Spoiler
 
0 Kudos
Reply

1,554 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

GRBG is not fully supported by gstreamer and MX8 i will suggest to convert to another format before stream it.

https://community.nxp.com/pwmxy87654/attachments/pwmxy87654/imx-processors%40tkb/15/2/i.MX8GStreamer...

Regards

 

0 Kudos
Reply

1,535 Views
Bernie_Chen
Contributor II
Hi Bio_TICFSL
In fact I have successfully configure sensor to output RAW8(GRBG) and debayer from RAW8(GRBG) to RGB, and getting preview by gstreamer.

This was my reference
https://community.nxp.com/t5/i-MX-Processors/iMX8-PLUS-MIPI-raw8/td-p/1322284

Could you describe why GRBG is not fully supported more detail? and what format you suggestion before stream it?

Best Regards
0 Kudos
Reply