[FFmpeg-devel] AVFrame linesize and OpenGL GL_UNPACK_ROW_LENGTH

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue May 7 06:24:57 CEST 2013


On Mon, May 06, 2013 at 09:45:57PM -0600, Pavel Koshevoy wrote:
> Hi,
> 
> OpenGL requires that texture row stride must be pixel aligned,
> because GL_UNPACK_ROW_LENGTH parameter is expressed in pixels, not
> bytes.

You need to re-read the specs.
That does specify the number of pixels indeed, but there is an alignment
step afterwards, which is specified via GL_UNPACK_ALIGNMENT (and
defaults to 32 bit alignment btw., so it really should have worked
for your "magically" unless you changed it in the first place).
Lastly, there is always the option one has to use for OpenGL ES
(for which the main design point seems to have been "how can we
design that to make it unusable for video?"): Upload the texture
line by line via TexSubImage. Performance will be bad though.


More information about the ffmpeg-devel mailing list