After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 540497 - ffmpegcolorspace is returning wrong size
ffmpegcolorspace is returning wrong size
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: Normal normal
: 0.10.21
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-06-27 14:37 UTC by kapil
Modified: 2008-06-30 08:26 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
Test case thats failing .... (117.00 KB, video/x-msvideo)
2008-06-29 07:34 UTC, kapil
Details

Description kapil 2008-06-27 14:37:30 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:
Comment 1 Tim-Philipp Müller 2008-06-27 16:57:55 UTC
Could you make the file available? (If it's larger than 1MB, head --bytes=999k waiting.avi > waiting-head.avi)

Comment 2 kapil 2008-06-29 07:34:08 UTC
Created attachment 113593 [details]
Test case thats failing ....
Comment 3 Sebastian Dröge (slomo) 2008-06-30 08:26:16 UTC
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.