Color distortion on gstreamer 1.8.1 using imx6Q VPU encoding

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

Color distortion on gstreamer 1.8.1 using imx6Q VPU encoding

1,004 Views
rickyqiqi
Contributor II

Hi All:

We're using yocto-L4.1.15_2.0.0-ga with image recipe imx6qsabresd fsl-image-qt5 as the board's software platform. And we use it's gstreamer 1.8.1 to do some video record application. We use the imx6Q VPU to encode the video into H.264 video data stream and pack it into MP4 container. We display raw video directly on screen and it's alright, but we found H.264 video recorded not. There are some distorions on the color of H.264 video. You can compare the screen views in attached files: The original screen view picture is 1.png and the distorted picture is 2.png. We're confused with this issue and we've tried with two video capture cards from different manufacturers to confirm this issue. Both of the cards has the same issue. Do you have any suggestions on this issue?

Here's the scripts we used:

gst-launch-1.0 -e imxv4l2src device="/dev/video2" \
! "video/x-raw,width=(int)1280,height=(int)$720,format=(string)YV12,framerate=(fraction)60000/1000" \
! queue \
! vpuenc_h264 \
! mux. \
splitmuxsink location="${FN}" reserved-max-duration=3000000000000000000 reserved-moov-update-period=1000000000 max-size-time=900000000000 mp4mux=mp4mux name=mux

And also here's the video source input information:

# v4l2-ctl --device=/dev/video2 --all
Driver Info (not using libv4l2):
Driver name : LXV4L2D_MZ0380
Card type : MZ0380:RAW 00.00 12abf5c4
Bus info : PCIe: PCI Bus 0000:01 00
Driver version: 6.32.0
Capabilities : 0x84221001
Video Capture
Video Capture Multiplanar
Audio
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04220001
Video Capture
Audio
Streaming
Extended Pix Format
Priority: 0
Video input : 4 (SDI INPUT(4): ok)
Audio input : 0 ()
Video Standard = 0x00001000
NTSC-M
Format Video Capture:
Width/Height : 1280/720
Pixel Format : 'YV12'
Field : None
Bytes per Line : 1280
Size Image : 1382400
Colorspace : Rec. 709
Transfer Function : Default
YCbCr Encoding : Default
Quantization : Default
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 1280, Height 720
Default : Left 0, Top 0, Width 1280, Height 720
Pixel Aspect: 1/1
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 60.000 (60000/1000)
Read buffers : 0
brightness (int) : min=0 max=255 step=1 default=128 val ue=128
contrast (int) : min=0 max=255 step=1 default=100 val ue=128
saturation (int) : min=0 max=255 step=1 default=128 val ue=128
hue (int) : min=0 max=255 step=1 default=128 val ue=128
auto_gain (int) : min=0 max=1 step=1 default=1 value=1
gain (int) : min=0 max=511 step=1 default=120 val ue=256
sharpness (int) : min=0 max=255 step=1 default=16 valu e=128

Labels (2)
0 Kudos
Reply
2 Replies

846 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hi Ricki,

I don’t think that you need to do special for this, you just set the correct register for the capture yuv422, then enable the vpu to encode, then gstreamer can do this, because vpu just can handle yuv 420, so IPU can change this format automatically. However this link make an improvement in images:

https://community.nxp.com/message/816416

Regards

0 Kudos
Reply

846 Views
rickyqiqi
Contributor II

Thank you for you kindly reply!

I'm confused with your mentioned yuv422. The video format of my v4l2 source is YV12. As I know it's different with yuv422, does it mean I should use a camera with yuv422 format, which can solve this color distortion problem?

0 Kudos
Reply