BlankClip

From Avisynth wiki
Revision as of 13:43, 24 August 2014 by Raffriff42 (Talk | contribs)

Jump to: navigation, search

BlankClip([clip clip, int length, int width, int height, string pixel_type, int fps, int fps_denominator, int audio_rate, bool stereo, bool sixteen_bit, int color, int color_yuv])
BlankClip([clip clip, int length, int width, int height, string pixel_type, int fps, int fps_denominator, int audio_rate, int channels, string sample_type, int color, int color_yuv])
Blackness()

The BlankClip filter produces a solid color, silent video clip of the specified length (in frames). The clip passed as an argument is used as a template for frame rate, image size, and so on, but you can specify all clip properties without having to provide a template. Color should be given as hexadecimal RGB values -- see script variables. Without any argument, BlankClip will produce a pitch-black 10 seconds clip (RGB32), 640x480, 24 fps, 16 bit 44100 Hz mono.

clip
if present, the resulting clip will have the clip-properties of the template, except for the properties you define explicitly.
length
length of the resulting clip (in frames).
width, height
width and height of the resulting clip.
pixel_type
pixel type of the resulting clip, it can be "RGB24", "RGB32", "YUY2", "YV12", "YV16" (v2.60), "YV24" (v2.60), "YV411" (v2.60) or "Y8" (v2.60).
fps
the framerate of the resulting clip.
fps_denominator
you can use this option if "fps" is not accurate enough. For example: fps = 30000, fps_denominator = 1001 (ratio = 29.97) or fps = 24000, fps_denominator = 1001 (ratio = 23.976). It is 1 by default.
audio_rate
samplerate of the silent audio of the clip.
channels
specifies the number of audio channels of silent audio added to the blank clip (added in v2.58).
stereo
(boolean) when set to true the silent audio is in stereo, when set to false a silent mono track is added. Deprecated! Use the channels parameter instead.
sample_type
specifies the audio sample type of the resulting clip. It can be "8bit", "16bit", "24bit", "32bit" or "float" (added in v2.58).
sixteen_bit
(boolean) true and false give both 16 bit, except when a template is used where a different bit is set. Deprecated! Use the sample_type parameter instead.
color
specifies the color of the clip, black (= $000000) by default. See color presets for preset colors. See Colors for more information on specifying colors.
color_yuv
is added in v2.55, and it lets you specify 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.

Blackness is an alias for BlankClip, provided for backward compatibility.

When supplying a template you get identical clip properties to the template. If it's 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 modify the parameters to force a video track (for width, height or pixel_type) or audio track (for audio_rate, channels or sample_type), the remaining parameters will be the default parameters. (added in v2.60)

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)

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.
Personal tools