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. |
14th October 2019, 19:25 | #1 | Link |
Registered User
Join Date: Oct 2018
Posts: 319
|
Is this correct?
Hi, can someone please confirm if this is correct?:
Code:
Clip = FFmpegSource2("YV12.mkv") Y = ExtractY(clip) U = ExtractU(clip).LanczosResize(clip.Width, clip.Height) V = ExtractV(clip).LanczosResize(clip.Width, clip.Height) CombinePlanes(Y, U, V, planes = "YUV", source_planes = "YYY", pixel_type = "YV24") I ask mostly because of the ChromaInPlacement parameter in Convert. Maybe this way is correct for all formats (MPEG1, MPEG2, DV)? |
24th October 2019, 04:56 | #3 | Link |
Registered User
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,406
|
You always need to deal with chroma placement. Sorry, no way to avoid it if you want undamaged video when you are done.
__________________
madVR options explained |
25th October 2019, 20:06 | #4 | Link |
Registered User
Join Date: Oct 2018
Posts: 319
|
That's right, but there's still something I don't understand here. The result of these two scripts is the same:
Code:
FFmpegSource2("YV24.mkv") ConvertToYV12(ChromaOutPlacement = "MPEG2") ConvertToYV24(ChromaInPlacement = "MPEG2", chromaresample = "Lanczos") ------------------------ FFmpegSource2("YV24.mkv") ConvertToYV12(ChromaOutPlacement = "MPEG2") Y = ExtractY(last) U = ExtractU(last).LanczosResize(last.Width, last.Height, 0.25, 0, last.Width / 2, last.Height / 2) V = ExtractV(last).LanczosResize(last.Width, last.Height, 0.25, 0, last.Width / 2, last.Height / 2) CombinePlanes(Y, U, V, planes = "YUV", source_planes = "YYY", pixel_type = "YV24") Code:
FFmpegSource2("YV24.mkv") ConvertToYV12(ChromaOutPlacement = "MPEG1") ConvertToYV24(ChromaInPlacement = "MPEG1", chromaresample = "Lanczos") ------------------------ FFmpegSource2("YV24.mkv") ConvertToYV12(ChromaOutPlacement = "MPEG1") Y = ExtractY(last) U = ExtractU(last).LanczosResize(last.Width, last.Height, 0, 0, last.Width / 2, last.Height / 2) V = ExtractV(last).LanczosResize(last.Width, last.Height, 0, 0, last.Width / 2, last.Height / 2) CombinePlanes(Y, U, V, planes = "YUV", source_planes = "YYY", pixel_type = "YV24") Last edited by Alexkral; 26th October 2019 at 05:44. |
26th October 2019, 16:30 | #5 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Avisynth resizers resize around the image centre, not the top-left (or any other) corner.
So MPEG2 chroma, although originally aligned, gets shifted away on expansion while MPEG1 moves to the desired alignment. |
27th October 2019, 05:52 | #6 | Link |
Registered User
Join Date: Oct 2018
Posts: 319
|
Ahh ok thanks, that would also explain the vertical alignment, but I'd still have a couple of questions:
1 - I understand that the different behavior of chromaresample is because of the ChromaInPlacement argument, and what you said about the resizers doesn't apply here, right? 2 - Shouldn't be then the MPEG2 chroma shift in the second script to the right instead of to the left? 3 - Is this the same happening here? |
Thread Tools | Search this Thread |
Display Modes | |
|
|