Version

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (1 revision)
(add link to avs+ documentation)
 
(12 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Template:FuncDef|Version()}}
+
<div style="max-width:62em" >
  
Version()  # [AviSynth 2.51 beta]
+
<div {{BlueBox2|40|0|3px solid purple}} >
 +
{{AvsPlusFullname}}<br>
 +
Up-to-date documentation: [https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/version.html https://avisynthplus.readthedocs.io]
 +
</div>
  
generates a 468x80 pixel, 24.000fps, 10-second, RGB24-format video clip with a short version and copyright statement in manila 16-point Arial text on 25% grey background.
 
  
Version() # [AviSynth 2.08]
+
{{FuncDef|Version()}}
  
generates a 420x80 pixel, 24.000fps, 10-second, RGB24-format video clip with a short version and copyright statement in manila 16-point Arial text on 25% grey background.  
+
Generates a 24[[wikipedia:Frame_rate|fps]], 10-second, [[RGB24]]-format video clip with a version, build time, copyright statement, and homepage information in 24-point, Arial, light yellow ([[Colors|$ECF2BF]]) text on a 25% grey ($404040) background. Width and height are chosen to fit the message, so clip size varies by version.  
  
Version()  # [Legacy versions]
 
  
generates a 512x32 pixel, 15fps, 10-second, RGB-format video clip with a short version and copyright statement in orange 24-point Arial text.
+
:[[File:avisynth-version-2.6.png]]
 +
 
 +
 
 +
 
 +
If the '''Version''' message is presented by itself (as is the normal case, when simply checking the installed AviSynth version), you don't care about the exact size, frame rate etc; but if you want to [[Splice]] this clip with other video clips, the [[Clip_properties|properties]] must be compatible: you will need more control. The following script implements a variant of the '''Version''' filter with a clip argument {{FuncArg|bg}} which defines the resulting properties, and (if {{FuncArg|showbg}}=true) the audio/video content in the background.
 +
<div {{BoxWidthIndent|48|2}} >
 +
### 'Version' filter with background/template clip
 +
function Version(clip bg, bool "showbg")
 +
{
 +
    showbg = [[Internal_functions/Default|Default]](showbg, false)
 +
    bg = (showbg) ? bg : [[BlankClip]](bg, color=$404040)
 +
    v=Version
 +
    m=v.[[ConvertToRGB32]].[[ColorKeyMask]]($404040, 0).[[ShowAlpha]]
 +
    [[Overlay]](bg, v, mask=m.[[Blur]](0.2),
 +
    \      x=(bg.Width/2-v.Width/2),
 +
    \      y=(bg.Height/2-v.Height/2))
 +
    return Last
 +
}
 +
</div>
 +
 
 +
:''Usage with template clip:''
 +
:<code>Version(BlankClip(width=600, height=336, pixel_type="YV24"))</code>
 +
:[[File:Avisynth-version-template-2.61.png]]
 +
 
 +
 
 +
:''Showing the clip under the message:''
 +
:<code>Version([[ColorBarsHD]](width=600, height=336), '''showbg=true'''))</code>
 +
:[[File:Avisynth-version-overlay-2.61.png]]
 +
 
 +
</div>
  
  
 
[[Category:Internal filters]]
 
[[Category:Internal filters]]
 +
[[Category:Debugging/Diagnostic filters]]

Latest revision as of 09:44, 17 September 2022

AviSynth+
Up-to-date documentation: https://avisynthplus.readthedocs.io


Version()

Generates a 24fps, 10-second, RGB24-format video clip with a version, build time, copyright statement, and homepage information in 24-point, Arial, light yellow ($ECF2BF) text on a 25% grey ($404040) background. Width and height are chosen to fit the message, so clip size varies by version.


Avisynth-version-2.6.png


If the Version message is presented by itself (as is the normal case, when simply checking the installed AviSynth version), you don't care about the exact size, frame rate etc; but if you want to Splice this clip with other video clips, the properties must be compatible: you will need more control. The following script implements a variant of the Version filter with a clip argument bg which defines the resulting properties, and (if showbg=true) the audio/video content in the background.

### 'Version' filter with background/template clip 
function Version(clip bg, bool "showbg")
{
    showbg = Default(showbg, false)
    bg = (showbg) ? bg : BlankClip(bg, color=$404040)
    v=Version
    m=v.ConvertToRGB32.ColorKeyMask($404040, 0).ShowAlpha
    Overlay(bg, v, mask=m.Blur(0.2),
    \       x=(bg.Width/2-v.Width/2), 
    \       y=(bg.Height/2-v.Height/2))
    return Last
}
Usage with template clip:
Version(BlankClip(width=600, height=336, pixel_type="YV24"))
Avisynth-version-template-2.61.png


Showing the clip under the message:
Version(ColorBarsHD(width=600, height=336), showbg=true))
Avisynth-version-overlay-2.61.png
Personal tools