staxrip icon indicating copy to clipboard operation
staxrip copied to clipboard

using DAR 1.367088 ITU ratio with x265 produces file with ratio of 6.813, works as expected with x264

Open Statick opened this issue 1 year ago • 2 comments

I'm encoding some old DVDs. my output is cropped to 704x480 and I'm choosing NTSC ITU display ratio of 1.367088

if I encode to x264 I get exactly the output I expect but with the same settings, same script, same everything, and I choose x265 as the encoder, then the resulting file somehow has a display ratio of 6.813. this only happens if I choose the ITU ratio of 1.367, if I choose the regular 1.333 ratio then that produces the expected output. I can correct the outputted file manually in mkvmerge easily enough but it's strange to be happening in the first place

I've attached 2 100-frame test clips of the same source (almost entirely a black frame as it's the first 100 frames of the episode), same script, same settings, etc, as well as the log files (all zipped because I can't attach MKV here). all I've changed is the target encoder. the x264 file is as expected, the x265 has the bad ratio

zipped files.zip

Statick avatar Aug 14 '24 10:08 Statick

This should or better must be an issue with x265 itself. The SAR is being used correctly, there is no reason why this should happen. And as far as I can see there seems to be nothing I can do about it.

In VUI 2 you could play with the parameters for VideoFormat and Overscan to see if they help you out, along with a different Preset and so.

Dendraspis avatar Aug 15 '24 05:08 Dendraspis

Just information/rambling based on his sources...

If i manually edit H.265 sample to 704x480 and remux, resulting video will play back as properly aligned (well, as long as you set proper alignment).. ... Hmm... Wait what? setting aspect ratio to 4/3, 1.367088 and 704x480 ALL produced slightly different results? What gives? Oh no, i looked at some search results. WHY?! These "standards" are seriously messed up.

Anyways, i will also note that remuxing does not change "encoded" aspect ration, only "fixes" it on container level. I guess it can be used to temporarily deal with bug? Until cause will be found out and fixed? It is in case if x265 encoder must be used, of course. But i do wonder... What specific case TS got to trigger said bug?

Edited: Sorry for confusion. Mostly what i meant, is that until bug is fixed (in x265 source, i assume?) remuxing output with container level aspect ratio can be a way to approach these situations, if such occur. It is not solution to root cause, but should allow proper playback on affected videos. (For example, i do similar thing to force 1920*1088 videos alignment into 1920x1080 playback with 16:9 aspect ratio on container level)

DimkaTsv avatar Aug 15 '24 11:08 DimkaTsv