How to convert RGB to YUV formats for H264 encoding

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to convert RGB to YUV formats for H264 encoding

跳至解决方案
5,783 次查看
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 项奖励
回复
1 解答
5,726 次查看
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 项奖励
回复
5 回复数
5,759 次查看
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

标记 (1)
0 项奖励
回复
5,751 次查看
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 项奖励
回复
5,727 次查看
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 项奖励
回复
5,712 次查看
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 项奖励
回复
5,719 次查看
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 项奖励
回复