1

I have been using VMR9 to render a YUV video stream. I had some performance concern so I run a profiler and have discovered that function named _yvRgb24 takes up to 25% of CPU time. With further investigations I discovered that VMR9 uses that function to render my video stream.

Does VMR9 convert my YUV video to RGB24 before rendering it? Can't it do the rendering right away? Conversion algorithm does not seem to be fast.

I am using MEDIASUBTYPE_IYUV as output type for VMR9.

Ajay
  • 2,022
  • 19
  • 33
Dan Tumaykin
  • 1,213
  • 2
  • 17
  • 37
  • unless you have a specialized hardware the conversion has to happen in one place or another from YUV to RGB. Ideally the conversion could happen on the GPU directly not on the CPU to make thing a lot faster and efficent – Raxvan May 09 '14 at 14:54
  • So the final output to a HWND should anyway be in RGB? – Dan Tumaykin May 09 '14 at 15:04
  • yes, there is no pc/console/mobile device hardware i know that outputs anything else than RGB or variations of that (rgb8, rgba8, rgba5551, rgb565, etc) from software – Raxvan May 09 '14 at 15:05

1 Answers1

2

VMR-9 is backed by Direct3D and availability of specific pixel format support depends respectively. In most cases you have quite some choice of pixel formats to render in, most popular are YUY2, YV12, NV12. The video is displayed without conversion to RGB.

Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • Is it possible to know which format is supported? Also, I suppose that conversion to another YUV format should be faster, than conversion to RGB, is it possible to tell to VMR9 to convert to YUY2, instead of RGB? Thank you. – Dan Tumaykin May 10 '14 at 15:59
  • 1
    You are interested in avoiding RGB, and your strategy is to connect to VMR with one of the YUV formats, such as for example YUY2. Once you succeed in this, don't worry about what takes place further. VMR9 won't unnecessarily convert to RGB. Popular formats like YUY2, YV12 are widely available (missing in rare scenarios like ancient hardware or Remote Desktop session). – Roman R. May 10 '14 at 16:19