[vlc] how to dump subtitles produced by dvbsub.c to an image file

Selçuk Cihan selcukcihan at gmail.com
Tue Jul 6 15:23:04 CEST 2010


On Mon, Jul 5, 2010 at 10:13 AM, Selçuk Cihan <selcukcihan at gmail.com> wrote:
> Hi, i need to save dvb subtitles as images (say png). I added a method
> (call it png_save) to dvbsub.c and invoked it inside the method:
> static subpicture_t *render( decoder_t *p_dec )
>
> I could not figure out how vlc stores the subtitle image (is it YUV?
> is it an index into a table?). It is not plain RGBA. What i need is to
> get rgba value for each pixel of the subtitle image. Currently, i read
> values from p_src = p_region->p_pixbuf for each region. But i do not
> know how to interpret them and convert to rgba. Any help truely
> appreciated.
>

Hi, i managed to figure it out. Info for each pixel is a single byte.
It is used as an index into the color palette which has YUV colors.
After getting YUV values, it is straightforward to convert to RGB.



More information about the vlc mailing list