View Single Post
Old 17th January 2021, 07:41   #780  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Quote:
Originally Posted by FranceBB View Post
I think ffms2 and Lwlibav convert the chroma location from Type2 to the old MPEG-2 version, so from:

Code:
X X
X X
(where the Chroma sample sits right on top of the top left Luma sample)

to

Code:
X X
c
X X
(where X is Luma and "c" is Chroma)

therefore, specifying --chromaloc 2 is wrong if your input is an Avisynth Script.
Ever since I began encoding with x265 years ago, I used FFmpeg to open the AVS Script, convert the chroma location back to Type 2 and then pipe to x265 to encode the video like so:

Code:
ffmpeg.exe -i "AVS Script.avs" -vf scale=out_color_matrix=bt2020nc:out_h_chr_pos=0:out_v_chr_pos=0 -pix_fmt yuv420p16le -strict -1 -an -f yuv4mpegpipe - | x265.exe --y4m -

Still, I'd love to see Avisynth and its plugin be able to support the "new" chroma location, just like it happened with the MPEG-1 variant and the MPEG-2 variant.
If you think about this, though, so far plugins generally assumed that the chroma location is MPEG-2 and you have to manually specify if it's MPEG-1 as they don't get it automatically, wouldn't it be better to somehow make the indexer pass this information through so that plugins will be aware of this? I know that someone has to be aware of his own source, but still, prevention is better than cure (TL;DR sometimes it's better to babysit the users a bit).
Would that be this?
https://github.com/AviSynth/AviSynth...visynth.h#L745

That's been there a loooooong time; way back during the 2.6 alphas. But I can't seem to find a part of the callable API that can query it (unless that's what PlanarChromaAlignment is in avisynth.cpp, but that seems like just a placeholder). It's not there at all in avisynth_c.h/avisynth_c.cpp.

Finding and fleshing out stuff like that probably should be a priority for the next API bump. I've started a discussion on Github about it, as a brainstorming/tracker of API stuff to consider:
https://github.com/AviSynth/AviSynth...iscussions/206
qyot27 is offline   Reply With Quote