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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd February 2023, 23:29   #1  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Compare oddity

The Avisynth wiki says Compare() only supports RGB24, RGB32, YUY2 and YV12.

I couldn't find any changes in the Avisynth+ version history to indicate that had changed, but it does seem to support unsupported formats (Avisynth+ 3.7.2 on XP). For example these seem okay.

Code:
Compare(BlankClip(Pixel_Type="YV411"), BlankClip(Pixel_Type="YV411"))
Compare(BlankClip(Pixel_Type="YUV422P16"), BlankClip(Pixel_Type="YUV422P16"))
However this results an error message:

Code:
"Convert: Input chroma placement only available with 4:2:0 or 4:2:2 sources"

Compare(\
BlankClip(Pixel_Type="YV411").propSet("_ChromaLocation", 0), \
BlankClip(Pixel_Type="YV411").propSet("_ChromaLocation", 0))
Also specifying a log file seems to control whether the graph displays, while show_graph does nothing.

Code:
Compare(A, B, show_graph=false)                       # displays the graph
Compare(A, B, logfile="compare.log", show_graph=true) # doesn't display the graph
And while I'm here, the ColorBars/ColorBarsHD staticframes argument seems not to work.

Code:
ColorBarsHD(staticframes=true) # 1 hour video with lots of frames
ColorBarsHD(staticframes=false) # 1 hour video with lots of frames
Cheers.
hello_hello is offline   Reply With Quote
Old 3rd February 2023, 00:15   #2  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,493
Quote:
the ColorBars/ColorBarsHD staticframes argument seems not to work.
I don't think staticframes has any effect on the visible output. It just changes whether it serves the same frame each time, or generates a new (but still identical frame) each time.

Quote:
Also specifying a log file seems to control whether the graph displays, while show_graph does nothing.
The code specifically skips all drawing code if you specify a logfile, so that is a bit misleading. But show_graph = false (without logfile) works okay for me.

Code:
"Convert: Input chroma placement only available with 4:2:0 or 4:2:2 sources"
What are you viewing it with? If something is adding a ConverttoRGB32 for display, that's what's throwing the error, not Compare.
__________________
My AviSynth filters / I'm the Doctor

Last edited by wonkey_monkey; 3rd February 2023 at 00:37.
wonkey_monkey is online now   Reply With Quote
Old 3rd February 2023, 06:39   #3  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Quote:
Originally Posted by wonkey_monkey View Post
I don't think staticframes has any effect on the visible output. It just changes whether it serves the same frame each time, or generates a new (but still identical frame) each time.
I thought I'd lost the plot for a minute because you're correct when viewing the ColorBars "directly", but check this out (bottom right corner).

Z = ColorBarsHD(width=960, height=540, staticframes=true, Pixel_Type="YV24")
Compare(Z, Z)
ConvertToYV12()
Trim(0,99)

ColorBars.mkv (44kB)

Quote:
Originally Posted by wonkey_monkey View Post
The code specifically skips all drawing code if you specify a logfile, so that is a bit misleading. But show_graph = false (without logfile) works okay for me.
Odd. I'm still seeing the graph, although disabling it does prevent the movement in the bottom right corner.

Z = ColorBarsHD(width=960, height=540, staticframes=true, Pixel_Type="YV24")
Compare(Z, Z, show_graph=false)
ConvertToYV12()
Trim(0,99)

Quote:
Originally Posted by wonkey_monkey View Post
Code:
"Convert: Input chroma placement only available with 4:2:0 or 4:2:2 sources"
What are you viewing it with? If something is adding a ConverttoRGB32 for display, that's what's throwing the error, not Compare.
I was opening the script with MPC-HC, although I did have a ConvertToRGB at the end of it.

You're probably correct as this produces the same error.

BlankClip(Pixel_Type="YV411")
propSet("_ChromaLocation", 0)
ConvertToRGB32()
PropShow()

And now I've looked at it, ConvertToYV11 has no ChromaOutPlacement, so I assume YV411 has a fixed chroma location?

For Y8 there's no error though when doing the same thing, despite the complete lack of chroma.

BlankClip(Pixel_Type="Y8")
propSet("_ChromaLocation", 0)
ConvertToRGB32()
PropShow()
killAudio()

RGB doesn't seem bothered by an erroneous _ChromaLocation, as long as it's not present when converting from YV411. Moving propShow's location in the script indicates that after a conversion from YUV to RGB, the _ChromaLocation frame property is deleted, but a _ChromaLocation when converting between RGB formats isn't.

BlankClip(Pixel_Type="YV24")
propSet("_ChromaLocation", 3)
ConvertToRGB64()
propSet("_ChromaLocation", 4)
ConvertToRGB32()
PropShow()

Last edited by hello_hello; 3rd February 2023 at 14:47.
hello_hello is offline   Reply With Quote
Old 3rd February 2023, 18:31   #4  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,493
Quote:
but check this out (bottom right corner).
I'm not sure what you mean by "but". That's working as expected - ColorBarsHD is passing the same frame each time to Compare, which then makes it writeable (which in this case means making a copy in memory; if staticframes=false, then AviSynth will allow it to draw directly on the passed frame without copying) and draws the graph on it.
__________________
My AviSynth filters / I'm the Doctor

Last edited by wonkey_monkey; 3rd February 2023 at 19:01.
wonkey_monkey is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:30.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.