Avidemux > Main version 2.6

patch: avoid lying about mp4 dimensions

(1/2) > >>

An MP4 file encoded via HandBrake will often have a height or width that's not a multiple of 8, due to automatic cropping.  Using Avidemux 2.6 to cut a section out of such a file results in a blocky section at the bottom and/or right side of the screen that wasn't there in the input.  This turns out to be because even though the MP4 accurately describes its own dimensions, Avidemux is rounding the dimensions up to be a multiple of 8, and so playback needs to guess about what those added pixels might be.

This patch removes that rounding.

Bump this thread in next 5 days if nobody comments this thread. (so I remember to ticket this)

Jicama I thought most codecs and color spaces dealt with 8x8 blocks of pixels, doing math on their similarities, and compressing them.  If you remove part of that 8x8 block, it can't compress along that edge, and the result is undefined.  Did I miss something interesting?

I don't know how the codecs work, but I'd guess that when the size isn't a multiple of 8 they pad out the block with imaginary pixels for compression purposes without changing the reported size.
In any case, HandBrake is perfectly happy to create MP4s with such sizes, and players are happy to show them.

i'll merge that when i'm back

indeed they padd the video


[0] Message Index

[#] Next page

Go to full version