[Libav-user] linesizes

Bruce Wheaton bruce at spearmorgan.com
Fri Oct 4 21:17:53 CEST 2013

On Oct 4, 2013, at 11:43 AM, MXWendler LibAV <ffmpeg at mxwendler.net> wrote:

> Is there a reliable way to derive the line size from eg. resolution and / or pixel format? Like eg. PIX_FMT_YUV420P has three line entries (ycbcr), and the Y stride is XX and the cb/cr stride is half of that?

No, there isn't. You can reliably work out the minimum number of bytes for a given format, but you won't know how many padding bytes are on each line. There's commonly padding to make alignment to 32 or 64 bits, for instance.

I tend to do copies line by line, then I get to a known linesize - I can predict my own line sizes.


More information about the Libav-user mailing list