hello_hello
1st September 2019, 16:10
For classic Avisynth it's fairly easy to convert a video to the same format as another, or to convert a video back to it's original format. Something like this (ignoring any possible matrix mismatch if the original/intermediate format is RGB):
Color_Format = SourceVideo.PixelType()
# Video is converted to another format by SomeFunction()
New_Video = SourceVideo.SomeFunction()
# Conversion back to the original format
New_Video.Eval("ConvertTo"+Color_Format+"()")
Does Avisynth+ offer a similar level of simplicity I've missed? I realise there's bitdepth to consider too, but for PixelType() Avisynth+ returns format names such as YUV420P10 for bitdepths greater than 8, which can't be used the same way.
The closest I have to a cunning plan at the moment is to
- get the original bitdepth
- create a temporary video converted to 8 bit
- get PixelType() after the 8 bit conversion, which seems to result in "traditional" format names such as YV24
- convert the video to the original bitdepth, then convert to the original color format using the "traditional" name (maybe doing it in the reverse order might be better?).
Would I be missing much using the above method?
Cheers.
Color_Format = SourceVideo.PixelType()
# Video is converted to another format by SomeFunction()
New_Video = SourceVideo.SomeFunction()
# Conversion back to the original format
New_Video.Eval("ConvertTo"+Color_Format+"()")
Does Avisynth+ offer a similar level of simplicity I've missed? I realise there's bitdepth to consider too, but for PixelType() Avisynth+ returns format names such as YUV420P10 for bitdepths greater than 8, which can't be used the same way.
The closest I have to a cunning plan at the moment is to
- get the original bitdepth
- create a temporary video converted to 8 bit
- get PixelType() after the 8 bit conversion, which seems to result in "traditional" format names such as YV24
- convert the video to the original bitdepth, then convert to the original color format using the "traditional" name (maybe doing it in the reverse order might be better?).
Would I be missing much using the above method?
Cheers.