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. |
2nd October 2021, 18:35 | #1 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
IsYUV420, IsYUV444
I have a few questions about VapourSynth.
First, is there an easy way to know whether a clip is YUV420, YUV422 or YUV444 without regards to bitdepth? Let's say I want to convert back to source format but in 16bits. Iterating through all combinations would be long to write. Second, should I aim to support videos with variable frame properties like Range and Matrix? Supporting that means using FrameEval whenever I need to use those frame properties. Is there a performance cost to FrameEval? Does it need to recreate the filters for each frame or performance isn't much of an issue? |
2nd October 2021, 19:00 | #2 | Link |
Registered User
Join Date: Dec 2020
Posts: 84
|
Code:
src420 = src.resize.Bicubic(format=vs.YUV420P16) src422 = src.resize.Bicubic(format=vs.YUV422P16) src444 = src.resize.Bicubic(format=vs.YUV444P16) print(src420.format.subsampling_w) print(src422.format.subsampling_w) print(src444.format.subsampling_w) print(src420.format.subsampling_h) print(src422.format.subsampling_h) print(src444.format.subsampling_h) 1 1 0 1 0 0 Example: https://github.com/HomeOfVapourSynth...sfunc.py#L5391 |
2nd October 2021, 19:11 | #3 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
I can't find the post where it was mentioned, but instead of doing everything inside frameeval, let frameeval just call a function that does your stuff. This should give the best performance.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
2nd October 2021, 23:32 | #5 | Link | |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,259
|
@MysteryX: you caould simply test for it.
Quote:
Code:
clip = mvf.Depth(clip, depth=16) Cu Selur Cu Selur |
|
3rd October 2021, 00:08 | #6 | Link | |
Registered User
Join Date: Jan 2018
Posts: 2,153
|
Quote:
https://github.com/AmusementClub/mvsfunc |
|
4th October 2021, 08:43 | #8 | Link | |
Registered User
Join Date: Jul 2021
Posts: 26
|
Quote:
https://www.vapoursynth.com/doc/func...eo/resize.html Last edited by Quadratic; 4th October 2021 at 08:49. |
|
4th October 2021, 15:13 | #9 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Resize requires specifying Matrix to go back to YUV; so I assume it also need Transfer, Primaries and Range to also be specified. Then chroma location.
Reading props, that's why I was looking into FrameEval to do it properly on a frame-per-frame basis, but it's a bit tricky to write with all those variables. |
4th October 2021, 16:05 | #10 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
|
No, there's no good way to do that.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
Thread Tools | Search this Thread |
Display Modes | |
|
|