# Converting SDL\_Overlay YUV-\>RGB + copy into arbitraryrendering buffer

**URL:** <https://discourse.libsdl.org/t/converting-sdl-overlay-yuv-rgb-copy-into-arbitraryrendering-buffer/13832>\
**Category:** SDL Development\
**Created:** [September 7, 2006, 5:23pm UTC](https://discourse.libsdl.org/t/converting-sdl-overlay-yuv-rgb-copy-into-arbitraryrendering-buffer/13832 "2006-09-07T17:23:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohnhaupt\_Denis](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@Mohnhaupt\_Denis](https://discourse.libsdl.org/u/Mohnhaupt_Denis)\
**Post date:** [September 7, 2006, 5:23pm UTC](https://discourse.libsdl.org/t/converting-sdl-overlay-yuv-rgb-copy-into-arbitraryrendering-buffer/13832/1 "2006-09-07T17:23:01Z")

</div>

Hi Sami,

thanks for your response

> > You should modify the ffplay to produce you a RGB buffer instead. You  
> > don’t need SDL(Surface) to do this.

> > Use the img\_convert() of the libavcodec for that.

> > libav\* API document  
> > [http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/index.html](http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/index.html)

In order to do that I would have to deeply dig into the entrails of  
ffplay.  
I checked out your idea and it could only work if I would heavily modify  
the core functionality. After trying something in that direction, I  
don’t think I will get this right. In ffplay.c they don’t call  
img\_convert but some sws\_scale function, which probably encapsulates  
img\_convert and does a lot of other stuff. I am not really a video  
expert, so there is a lot that I do not understand.

Isn’t there a possibility which converts a yuv-surface into a  
rgb-surface?

> > Even better is to make your own YUV conversion fragment shader and it  
> > will do the conversion with GPU. Thus saving a lot of CPU power.

That’s another good idea, unfortunately the target system has far more  
cpu than gpu power and is not quite up to date…

Kind regards,  
Denis
