Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
7 Views

MPEG-2 VideoEncoder RGB32 ColorFormat

Application umc_video_enc_con nicely demonstrates VideoEncoder usage for YUV input and various outputs.

But what if the input is RGB32?

umc_video_enc_con assumes VideoData input object is initialized with some YUV color format. Later, for MPEG-2 stream type, GetNextYUVBuffer is called to setup the input buffer.

If I initialize instead with RGB32 color format, how are input buffers setup for MPEG-2? If I call GetNextYUVBuffer, I observe an exception, apparently because a color format other than YUV was selected.

Is there a way to encode MPEG-2 with RGB32 input? Thanks.
0 Kudos
5 Replies
Highlighted
7 Views

Hello,

The umc_video_enc_con is a simple application to show how to use VideoEncoder class. If you are developing complicated media player or transcoder application then you have to care on RGB2YUVcolor conversion step.

Regards,
Vladimir

0 Kudos
Highlighted
New Contributor I
7 Views

Tovarich, Vladimir, I understand that umc_video_enc_con is a simple application. Question is: can MPEG-2 encoder accept RGB32 input? And if so, how to condition the input buffers?

??????? ???????
0 Kudos
Highlighted
7 Views

Tovarich FrankNatoli,

UMC VideoEncoder class do not support color conversion inside (but VideoDecoder does), so you have to do conversion outside.

Regards,
Vladimir

0 Kudos
Highlighted
New Contributor I
7 Views

TovarichVladimir: if VideoEncoder does not support color conversion inside, does that mean that all input to MPEG2 VideoEncoder must be YUV? My particular context is an OnPaint method that is passed an RGB32 bitmap. I want the OnPaint method to call video encoder to write an encoded output frame.

??????? ???????
0 Kudos
Highlighted
7 Views

Yes, that mean exactly this. You have to call color conversion routines to convert RGB to YUV before pass it to encoder.

Vladimir

0 Kudos