GNOME Bugzilla – Bug 540497
ffmpegcolorspace is returning wrong size
Last modified: 2008-06-30 08:26:16 UTC
Please describe the problem: When I run an avi file it fails with errors mentioned. Basically ffmpegcolorspace is returning lesser value then asked by the avidemux. The error is due to the condition in gstffmpegcolorspace.c if (gst_structure_has_field (structure, "palette_data")) { *size -= 4 * 256; /* = AVPALETTE_SIZE */ } wherein the palette is considered a part of buffer and hence its value is being subtracted. Basically this is only true for pixel format = PIX_FMT_PAL8, as mentioned in gstffmpegcodecmap.c. But in my case the pixel format is PIX_FMT_BGR24 and palette data is not added here, but still its being subtracted. So I would like to suggest to add a condition if (gst_structure_has_field (structure, "palette_data") && ctx->pix_fmt == PIX_FMT_PAL8) { *size -= 4 * 256; /* = AVPALETTE_SIZE */ } Steps to reproduce: 1. GST_DEBUG=2 gst-launch-0.10 filesrc location=waiting.avi ! avidemux ! decodebin ! ffmpegcolorspace ! videoscale ! ximagesink 2. Actual results: ** (gst-launch-0.10:24385): WARNING **: ffmpegcsp0: size 11520 is not a multiple of unit size 10496 0:00:00.312994206 24385 0x81462d0 WARN basetransform gstbasetransform.c:1533:gst_base_transform_handle_buffer:<ffmpegcsp0> error: subclass did not specify output size 0:00:00.313079976 24385 0x81462d0 WARN basetransform gstbasetransform.c:1533:gst_base_transform_handle_buffer:<ffmpegcsp0> error: subclass did not specify output size ERROR: from element /pipeline0/ffmpegcsp0: subclass did not specify output size Expected results: ffmpegcolorspace should allocate 11520 Does this happen every time? yes Other information:
Could you make the file available? (If it's larger than 1MB, head --bytes=999k waiting.avi > waiting-head.avi)
Created attachment 113593 [details] Test case thats failing ....
Ok, this is a DIB file with 24bpp, including a palette. ffmpegcolorspace only supports palettes for 8bpp so all palette code in ffmpegcolorspace should only be used for that format. 2008-06-30 Sebastian Dröge <sebastian.droege@collabora.co.uk> * gst/ffmpegcolorspace/gstffmpegcodecmap.c: (gst_ffmpeg_pixfmt_to_caps): * gst/ffmpegcolorspace/gstffmpegcolorspace.c: (gst_ffmpegcsp_get_unit_size): Only set/get on the PAL8 format, ffmpegcolorspace doesn't support it on other formats. Also adjust the unit size only for that format to not include the palette. Fixes bug #540497.