BlankClip
Raffriff42 (Talk | contribs) m (one more touch-up) |
(add link to avs+ documentation) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<div style="max-width:62em" > | <div style="max-width:62em" > | ||
+ | |||
+ | <div {{BlueBox2|40|0|3px solid purple}} > | ||
+ | {{AvsPlusFullname}}<br> | ||
+ | Up-to-date documentation: [https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/blankclip.html https://avisynthplus.readthedocs.io] | ||
+ | </div> | ||
+ | |||
'''BlankClip''' produces a solid color video clip with silent audio. The ''clip'' passed as an argument is used as a ''template'' - for frame rate, image size, and so on, but the template is optional. You can specify as many clip properties explicitly as you wish. By default, '''BlankClip''' will produce a pitch-black 10 second clip; 24 fps, 640x480, RGB32, with 16 bit, 44100 Hz, mono, silent audio. | '''BlankClip''' produces a solid color video clip with silent audio. The ''clip'' passed as an argument is used as a ''template'' - for frame rate, image size, and so on, but the template is optional. You can specify as many clip properties explicitly as you wish. By default, '''BlankClip''' will produce a pitch-black 10 second clip; 24 fps, 640x480, RGB32, with 16 bit, 44100 Hz, mono, silent audio. | ||
Line 34: | Line 40: | ||
:{{Par2|pixel_type|string|"RGB32"}} | :{{Par2|pixel_type|string|"RGB32"}} | ||
− | ::Pixel type of the resulting clip; | + | ::Pixel type of the resulting clip; can be any of the following: |
− | :::{|class="wikitable" | + | :::{|class="wikitable" style="width:48em" |
|style="width:5em; text-align:center;"|[[RGB24]] | |style="width:5em; text-align:center;"|[[RGB24]] | ||
|style="width:5em; text-align:center;"|[[RGB32]] | |style="width:5em; text-align:center;"|[[RGB32]] | ||
Line 45: | Line 51: | ||
|style="width:5em; text-align:center;"|[[Y8]] '''*''' | |style="width:5em; text-align:center;"|[[Y8]] '''*''' | ||
|- | |- | ||
− | |align="left" colspan="9" | * ''AviSynth v2.60'' | + | |align="left" colspan="9" | '''*''' AviSynth v2.60 |
+ | |} | ||
+ | ::{{AvsPluscon}} these [[Avisynthplus_color_formats|color formats]] are allowed: | ||
+ | :::{| class="wikitable" style="width:48em" | ||
+ | ! style="width:4em" |''bits'' | ||
+ | !RGB(A) | ||
+ | !YUV(A)444 | ||
+ | !YUV(A)422 | ||
+ | !YUV(A)420 | ||
+ | !YUV411 | ||
+ | !Y only | ||
+ | |- | ||
+ | |style="text-align:center" |32 | ||
+ | |RGBPS | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |- | ||
+ | |style="text-align:center" |16 | ||
+ | | | ||
+ | RGB48<br> | ||
+ | RGBP16 | ||
+ | |YUV444P16 | ||
+ | |YUV422P16 | ||
+ | |YUV420P16 | ||
+ | | | ||
+ | |Y16 | ||
+ | |- | ||
+ | |style="text-align:center" |14 | ||
+ | |RGBP14 | ||
+ | |YUV444P14 | ||
+ | |YUV422P14 | ||
+ | |YUV420P14 | ||
+ | | | ||
+ | |Y14 | ||
+ | |- | ||
+ | |style="text-align:center" |12 | ||
+ | |RGBP12 | ||
+ | |YUV444P12 | ||
+ | |YUV422P12 | ||
+ | |YUV420P12 | ||
+ | | | ||
+ | |Y12 | ||
+ | |- | ||
+ | |style="text-align:center" |10 | ||
+ | |RGBP10 | ||
+ | |YUV444P10 | ||
+ | |YUV422P10 | ||
+ | |YUV420P10 | ||
+ | | | ||
+ | |Y10 | ||
+ | |- | ||
+ | |style="text-align:center" |8 | ||
+ | | | ||
+ | RGB24<br> | ||
+ | RGBP<br> | ||
+ | RGBP8 | ||
+ | |YV24 | ||
+ | | | ||
+ | YUY2<br> | ||
+ | YV16 | ||
+ | | | ||
+ | |YV411 | ||
+ | |Y8 | ||
+ | |- | ||
+ | ! colspan="7" style="text-align:left; font-weight:normal" |''with alpha channel'' | ||
+ | |- | ||
+ | |style="text-align:center" |32 | ||
+ | |RGBAPS | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |- | ||
+ | |style="text-align:center" |16 | ||
+ | | | ||
+ | RGB64<br> | ||
+ | RGBAP16 | ||
+ | |YUVA444P16 | ||
+ | |YUVA422P16 | ||
+ | |YUVA420P16 | ||
+ | | | ||
+ | | | ||
+ | |- | ||
+ | |style="text-align:center" |14 | ||
+ | |RGBAP14 | ||
+ | |YUVA444P14 | ||
+ | |YUVA422P14 | ||
+ | |YUVA420P14 | ||
+ | | | ||
+ | | | ||
+ | |- | ||
+ | |style="text-align:center" |12 | ||
+ | |RGBAP12 | ||
+ | |YUVA444P12 | ||
+ | |YUVA422P12 | ||
+ | |YUVA420P12 | ||
+ | | | ||
+ | | | ||
+ | |- | ||
+ | |style="text-align:center" |10 | ||
+ | |RGBAP10 | ||
+ | |YUVA444P10 | ||
+ | |YUVA422P10 | ||
+ | |YUVA420P10 | ||
+ | | | ||
+ | | | ||
+ | |- | ||
+ | |style="text-align:center" |8 | ||
+ | |style="line-height:80%" | | ||
+ | RGB32<br> | ||
+ | RGBAP<br> | ||
+ | RGBAP8 | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | | ||
|} | |} | ||
Line 53: | Line 179: | ||
:{{Par2|fps_denominator|int|1}} | :{{Par2|fps_denominator|int|1}} | ||
::Specify frame rate in ''rational'' form (numerator/denominator). For example, <tt>fps=30000,fps_denominator=1001</tt> (approximately 29.97 fps) or <tt>fps=24000,fps_denominator=1001</tt> (approximately 23.976 fps). | ::Specify frame rate in ''rational'' form (numerator/denominator). For example, <tt>fps=30000,fps_denominator=1001</tt> (approximately 29.97 fps) or <tt>fps=24000,fps_denominator=1001</tt> (approximately 23.976 fps). | ||
− | :: | + | ::''Note'' – if {{FuncArg|fps_denominator}} is given (even if it is "1"), {{FuncArg|fps}} is '''rounded to the nearest integer'''. |
:{{Par2|audio_rate|int|44100}} | :{{Par2|audio_rate|int|44100}} | ||
::Sample rate of the (silent) audio. | ::Sample rate of the (silent) audio. | ||
+ | ::''Note'' – <code>BlankClip(audio_rate=0)</code> produces the same result as <code>BlankClip.[[KillAudio]]</code>. | ||
:{{Par2|channels|int|1}} | :{{Par2|channels|int|1}} | ||
Line 66: | Line 193: | ||
:{{Par2|sample_type|string|"16bit"}} | :{{Par2|sample_type|string|"16bit"}} | ||
− | ::Specifies the audio sample type. It can be | + | ::Specifies the audio sample type. It can be ''8bit'', ''16bit'', ''24bit'', ''32bit'' or ''float''. |
:{{Par2|sixteen_bit|bool|true}} | :{{Par2|sixteen_bit|bool|true}} | ||
Line 95: | Line 222: | ||
<div {{BoxWidthIndent|56|1}} > | <div {{BoxWidthIndent|56|1}} > | ||
− | # | + | # adds a silent audio stream (with a samplerate of 48 kHz) to a video clip: |
− | + | ||
video = AviSource("E:\pdwork\DO-Heaven.AVI") | video = AviSource("E:\pdwork\DO-Heaven.AVI") | ||
audio = BlankClip(video, audio_rate=48000) | audio = BlankClip(video, audio_rate=48000) |
Latest revision as of 19:30, 16 September 2022
AviSynth+
Up-to-date documentation: https://avisynthplus.readthedocs.io
BlankClip produces a solid color video clip with silent audio. The clip passed as an argument is used as a template - for frame rate, image size, and so on, but the template is optional. You can specify as many clip properties explicitly as you wish. By default, BlankClip will produce a pitch-black 10 second clip; 24 fps, 640x480, RGB32, with 16 bit, 44100 Hz, mono, silent audio.
When supplying a template, BlankClip returns a clip with properties copied from that template. If the template is audio-only, you get a blank audio-only clip, and if it's video-only you get a blank video-only clip. If you start to add parameters that force a video track (i.e. width, height or pixel_type) or audio track (i.e. audio_rate, channels or sample_type), the remaining parameters for that track will be the defaults. (AviSynth v2.60)
Blackness is an alias for BlankClip. The parameters are the same.
[edit] Syntax and Parameters
BlankClip( [clip clip, int length, int width, int height, string pixel_type,
float fps, int fps_denominator, int audio_rate, bool stereo, bool sixteen_bit,
int color, int color_yuv] ) (deprecated)
BlankClip( [clip clip, int length, int width, int height, string pixel_type,
float fps, int fps_denominator, int audio_rate, int channels, string sample_type,
int color, int color_yuv] )
Blackness( ...same parameters as BlankClip )
- clip clip =
- if supplied, the resulting clip will have the clip properties of the template, except for the properties you define explicitly.
- int length = 240
- Length of the resulting clip, in frames.
- int width = 640
- int height = 480
- Width and height of the resulting clip.
- string pixel_type = "RGB32"
- Pixel type of the resulting clip; can be any of the following:
- AVS+ these color formats are allowed:
bits RGB(A) YUV(A)444 YUV(A)422 YUV(A)420 YUV411 Y only 32 RGBPS 16 RGB48
RGBP16YUV444P16 YUV422P16 YUV420P16 Y16 14 RGBP14 YUV444P14 YUV422P14 YUV420P14 Y14 12 RGBP12 YUV444P12 YUV422P12 YUV420P12 Y12 10 RGBP10 YUV444P10 YUV422P10 YUV420P10 Y10 8 RGB24
RGBP
RGBP8YV24 YUY2
YV16YV411 Y8 with alpha channel 32 RGBAPS 16 RGB64
RGBAP16YUVA444P16 YUVA422P16 YUVA420P16 14 RGBAP14 YUVA444P14 YUVA422P14 YUVA420P14 12 RGBAP12 YUVA444P12 YUVA422P12 YUVA420P12 10 RGBAP10 YUVA444P10 YUVA422P10 YUVA420P10 8 RGB32
RGBAP
RGBAP8
- float fps = 24
- Frame rate of the resulting clip.
- int fps_denominator = 1
- Specify frame rate in rational form (numerator/denominator). For example, fps=30000,fps_denominator=1001 (approximately 29.97 fps) or fps=24000,fps_denominator=1001 (approximately 23.976 fps).
- Note – if fps_denominator is given (even if it is "1"), fps is rounded to the nearest integer.
- int audio_rate = 44100
- Sample rate of the (silent) audio.
- Note –
BlankClip(audio_rate=0)
produces the same result asBlankClip.KillAudio
.
- int channels = 1
- Specifies the number of channels of (silent) audio.
- bool stereo = false
- Deprecated: use channels instead.
- If true, the (silent) audio is in stereo: channels=2.
- string sample_type = "16bit"
- Specifies the audio sample type. It can be 8bit, 16bit, 24bit, 32bit or float.
- bool sixteen_bit = true
- Deprecated: use sample_type instead.
- true and false give both 16 bit, except when a template is used where a different bit is set.
- int color = $000000
- Specifies the color of the clip, black (= $000000) by default. See color presets for preset color. See Colors for more information on specifying colors.
- int color_yuv =
- Specifies the color of the clip using YUV values. It requires setting pixel_type to one of the YUV formats; otherwise it doesn't do anything.
[edit] Examples
# produces a black clip (3000 frames, width 720, height 576, framerate 25), # with a silent audio track (16 bit 44.1 kHz stereo): BlankClip(length=3000, width=720, height=576, fps=25, color=$000000)
# produces a black clip (3000 frames) with the remaining clip properties of the AVI: video = AviSource("E:\pdwork\DO-Heaven.AVI") BlankClip(video, length=3000, color=$000000)
# adds a silent audio stream (with a samplerate of 48 kHz) to a video clip: video = AviSource("E:\pdwork\DO-Heaven.AVI") audio = BlankClip(video, audio_rate=48000) AudioDub(video, audio)
[edit] Changes
v2.55 | Added color_yuv. |
v2.58 | Added channels and sample_type. |
v2.60 | Added pixel_type="YV24"/"YV16"/"YV411"/"Y8". |
Supply useful defaults for new Audio/Video when using a Video/Audio only template clip. |