Page MenuHomePhabricator

WebM video transcodes can have slightly off aspect ratio
Open, Needs TriagePublic

Description

Noticed while testing ogv.js's WebM playback mode:

https://brionv.com/misc/ogv.js/demo/#file=Tears_of_Steel_in_4k_-_Official_Blender_Foundation_release.webm&size=360p.webm

this 360p transcode should be 640 pixels wide but sets a display size of 641 pixels wide -- due to the ffmpeg video scaler's attempt to preserve the _exact_ aspect ratio of the 3840x1714 original when we request a resize to 640x286 pixels tall. The resulting file encodes 640x286 pixels with a stretched display to 641x286. Would rather it just keep the size we give, knowing slight rounding errors are possible because we set it to an even number.

Can use -vf scale instead of -s and add setsar=1:1 I think, testing.