GNOME Bugzilla – Bug 364856
pngenc stride problems
Last modified: 2006-11-30 22:20:14 UTC
I'm working on a DVD ripper and have encounter a strange problem. I'm creating thumbnails from each title, scaled to the correct aspect ratio taking into account the pixel-aspect-ratio caps property. At certain target resolutions, the resulting frame is black and white and is sheered to the left (I have png's below to illustrate). At other resolutions, the color is correct, but the sheer is steeper. Seems to be a problem with the pixel array access math. The pipeline is dvdreadsrc ! dvddemux ! mpeg2dec ! videoscale ! ffmpegcolorspace ! pngenc ! fakesink. I'm picking up the frame in a 'preroll-handoff' handler. The source video is 720x480 with a pixel-aspect-ratio of 32/27. If scaled to: 853x480 (correct aspect ratio): black and white, sheered to left. 852x480: no error 851x480: correct color, but even steeper sheer to left
Created attachment 75341 [details] 853x480
Created attachment 75342 [details] 852x480
Created attachment 75343 [details] 851x480
Yeah, it's kinda well-known that ffmpegcolorspace doesn't handle widths that aren't multiples of 4.
David, you have any specific pipeline to demonstrate the ffmpegcolorspace problem? I can't seem to make it fail no matter what width or colorspace I feed it and the code to calculate various strides also seems correct. pngenc uses the wrong stride when reading the input buffer.
* ext/libpng/gstpngenc.c: (gst_pngenc_setcaps), (gst_pngenc_chain): * ext/libpng/gstpngenc.h: Fix strides. Fixes #364856. Cleanup capsnego. Set caps on outgoing buffers.