i.MX gstreamer Format Conversion

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

i.MX gstreamer Format Conversion

1,567 Views
ciaranbannon
Contributor II

I am using an i.MX6 SABRESD running fsl-linux distribution, with a custom camera input and streaming video input using gstreamer.

The camera output format is YUYV (YYYYYYYY UUUUUUUU YYYYYYYY VVVVVVVV, YUY2) and I am outputting 1920x1080p HMDI via 32bpp framebuffer.

Using the command

gst-launch-1.0 imxv4l2src device=/dev/video0 num-buffers=-1 ! 'video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, framerate=(fraction)15/1' ! imxv4l2sink

gives okay quality video, but gradual changes in color result in errors in the color space conversion, shown as blocks of color where there should be a gradual change, as shown below.

pastedImage_6.png

I was able to modify a color space conversion example to correctly change the format of still images using "YUYV" as the color format.

My question is this;

Is gstreamer using the same color space converter as the example code (ie. the IPU) and if not, is there a way to make it do so, or to bypass gstreamer's csc and use the IPU instead?

Labels (3)
0 Kudos
2 Replies

972 Views
igorpadykov
NXP Employee
NXP Employee

Hi Ciaran

please try procedures given in sect.7.3.15 Video conversion

attached Linux Guide and use nxp bsps described on

http://www.nxp.com/products/software-and-tools/software-development-tools/i.mx-software-and-tools/i....

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

972 Views
ciaranbannon
Contributor II

Hi Igor, thank you for that info.

It appears that YUY2 isn't supported by imxvideoconvert_ipu. I've been able to change the camera format to UYVY (which is listed under "gst-inspect-1.0 imxvideoconvert_ipu" and switched to using videotestsrc to rule out any bad signals coming from the camera as the issue. My command is;

gst-launch-1.0 -v videotestsrc ! video/x-raw,format=RGB,width=800,height=600 ! imxvideoconvert_ipu ! pngenc ! filesink location=format_tests/test_rgb.png

resulting in the image on the left. Changing to "format=UYVY" results in the image on the right. There is a notable difference in color, particularly on the bottom-left bars.

pastedImage_2.pngpastedImage_1.png

Is there a simple explanation for this erroneous conversion?

0 Kudos