Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
10th August 2020, 11:27 | #2 | Link |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
Do you mean actual interleaved YUY2 like in Avisynth, or just any old 4:2:2? I don't think VS (or zimg, rather) actually supports converting to the former. It has a format constant but it's one of the COMPAT ones that's only used for Avisynth interoperability. VS doesn't really support working with interleaved color formats in general, everything is planar internally and packing is only done for input or output.
|
10th August 2020, 12:44 | #3 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
there's no appropriate way to convert between 4:2:0 and 4:2:2 because you have to resample Cb, Cr and that leads to quality loss, however, if your goal is to simply "get the shit done":
Code:
#to 422 clp = core.fmtc.resample(clp, css="422", kernel="point") #to 420 clp = core.fmtc.resample(clp, css="420", kernel="point") #"point" (nearest neighbor) is a true lossless resampling kernel, but it's pretty much useless if you want to apply literally any filtering on the resampled clip. Last edited by feisty2; 10th August 2020 at 16:25. |
10th August 2020, 16:23 | #5 | Link |
Registered User
Join Date: May 2011
Posts: 321
|
if you do:
#clip is some YUV420P8 clip2 = core.resize.Point(clip, format=vs.COMPATYUY2) clip3 = core.resize.Point(clip2, format=vs.YUV420P8) then all three clips are the same COMPATYUY2 stores bytes as two byte packs interleaved as YU,YV,YU,YV, etc., you can check here What is the reason to use interleaved YUY2? |
10th August 2020, 16:50 | #6 | Link | |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
Quote:
I believe you can also re-pack YUV422P8 to YUY2 for output, or if that doesn't work you could as a last resort use v210, which is a wacky 10-bit interleaved YUV 4:2:2 thing mostly used by QuickTime and some other professional software. The VFW output does support that, although you need to do some mysterious incantation to enable it (can't remember off the top of my head). Last edited by TheFluff; 10th August 2020 at 16:53. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|