0

I have made a directshow filter of decoder using libde265. There is built in function named write_image. It writes the decoded data in a yuv file.

I need to render the decoder data. For that purpose I need to do two steps: Output data on the output pin Conversion of the data into rgb format

The media_subtype used is IMC3. IN IMC3 the format of the data is , y components following u and v in the memory .

I have tried the following code to output the data on the pin.

    static FILE* fh = NULL;
if (fh == NULL) { fh = fopen(output_filename, "wb"); }

for (int y = 0; y<de265_get_image_height(img, 0); y++)
    fread(out, de265_get_image_width(img, 0), 1, fh);

for (int y = 0; y<de265_get_image_height(img, 1); y++)
    fread(out, de265_get_image_width(img, 1), 1, fh);

for (int y = 0; y<de265_get_image_height(img, 2); y++)
    fread(out, de265_get_image_width(img, 2), 1, fh);

But the render screen is blank. Secondly I need to convert it to rgb as well. In the above code img is the image structure storing the decoded data.

Please help me in this regard because render is not showing anything. As well as suggest me to convert the data in the rgb format as well. May be I may be wrong in packing the data in the output buffer.Although I am following the exact IMC3 format

user3909276
  • 61
  • 1
  • 7
  • If you set a correct mediatype on your output pin, there is no need to convert it to rgb. Directshow will take care for that using the Color Space Converter Filter if the renderer requires rgb. You can also force the convert using a TransNull24 filter, [see this answer for more info](http://stackoverflow.com/a/14146175/33499) – wimh Jul 30 '15 at 21:15
  • Decoder returns YUV formated ouput, so in any case I need to use IMC3 that is equivalent to I420 and therefore I need to convert it to RGB back again. – user3909276 Jul 31 '15 at 06:44

0 Answers0