How to convert RGB to YUV formats for H264 encoding

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

How to convert RGB to YUV formats for H264 encoding

Jump to solution
1,986 Views
udhayamoorthi
Contributor II

Hi I am working on IMX8MM with Raw sensor.

I Have completed Encoding (h264) on YUV formats and same thing i need to Stream on h264 with RGB ..

Does any one has completed convert rgb to yuv formats using h264?.

Note : I am using NEON processor.

how to compress RGB to YUV in pipeline(gstremer)?..

0 Kudos
1 Solution
1,929 Views
Kovachev
Contributor II

Hello,

did you try to remove the videoconvert? The pipleline should work without it as well, jpegenc supports RGB format. In that way you will limit the issue to bayer2rgb and jpegenc. If you still have a problem I'll suggest you to test check your source file. Maybe you can use some jpeg as source file, convert it to bggr and then encode it again to a new file. In this way you will eliminate any potential issues with your .raw file.

If the issues still persists it would be better if you raise a bug with gstreamer.

View solution in original post

0 Kudos
5 Replies
1,962 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello

So the simple way is using the iMX8 jpegencoder. I think customer can use PC to save their original picture with RAW RGB or RAW YUV format, It is same as converting the JPEG files on a Linux PC.

Regards

Tags (1)
0 Kudos
1,954 Views
udhayamoorthi
Contributor II

i am using bayer2rgb,it will give RGB formats but im getting two colors only..
for ex : The RGB formats it will compress 3colors Red,Bluee,Green here what i am getting 2 colors i am missing one color (bggr formats - blue,green,?)
my pipeline is
"gst-launch-1.0 -v filesrc location=raw10.raw blocksize=4147200 ! "video/x-bayer,format=bggr,width=1920,height=1080,framerate=1/1" ! bayer2rgb ! videoconvert ! jpegenc ! filesink location=frame.jpeg -v " why i am missing one color? anyone knows about it?
0 Kudos
1,930 Views
Kovachev
Contributor II

Hello,

did you try to remove the videoconvert? The pipleline should work without it as well, jpegenc supports RGB format. In that way you will limit the issue to bayer2rgb and jpegenc. If you still have a problem I'll suggest you to test check your source file. Maybe you can use some jpeg as source file, convert it to bggr and then encode it again to a new file. In this way you will eliminate any potential issues with your .raw file.

If the issues still persists it would be better if you raise a bug with gstreamer.

0 Kudos
1,915 Views
udhayamoorthi
Contributor II

Do you have proper patch of bayer2rgbneon 

in Gstreamer,

gstreamer1.0-plugins-bad -  bayer2rgb it will convert bayer to raw

bayer2rgbneon - which patch it is taking?

0 Kudos
1,922 Views
udhayamoorthi
Contributor II

if i remove videconvert my pipeline is not working !

This is my pipeline using bayer2rgb its working
gst-launch-1.0 v4l2src device=/dev/video0 ! bayer2rgb ! autovideoconvert ! vpuenc_h264 bitrate=1000 ! rtph264pay ! udpsink host=192.168.0.87 port=9001

same if i use bayer2rgbneon pipeline is not setting its giving error in pipeline
gst-launch-1.0 v4l2src device=/dev/video0 ! bayer2rgbneon ! videoconvert ! vpuenc_h264 bitrate=1000 ! rtph264pay ! udpsink host=192.168.0.87 port=9001

 

note: i can able to stream using bayer2rgbneon but while converting into bayer2rgbneon to H264 i am getting issue

0 Kudos