MergeRGB
Raffriff42 (Talk | contribs) m (added category) |
Raffriff42 (Talk | contribs) (formatting, links, phrasing) |
||
Line 1: | Line 1: | ||
− | {{Template:Func2Def|MergeARGB(clip ''clipA'', clip ''clipR'', clip ''clipG'', clip ''clipB'')|MergeRGB(clip ''clipR'', clip ''clipG'', clip ''clipB'' [, string ''pixel_type''])}} | + | {{Template:Func2Def |
+ | |MergeARGB(clip ''clipA'', clip ''clipR'', clip ''clipG'', clip ''clipB'') | ||
+ | |MergeRGB(clip ''clipR'', clip ''clipG'', clip ''clipB'' [, string ''pixel_type'' ] ) | ||
+ | }} | ||
− | + | Merge the ''alpha'' (transparency) and color channels from the source video clips into the output video clip. | |
− | + | {{FuncArg|clipA}} provides the alpha data to merge into the output clip. For a [[YUV]] format clip, the data is taken from the ''Y'' (luma) channel. For an [[RGB32]] format clip, the data is taken from the ''A'' (alpha) channel. [[RGB24]] clips cannot be used. | |
− | '' | + | {{FuncArg|cliprR}}, {{FuncArg|clipG}} and {{FuncArg|clipB}} provide the ''R'', ''G'' and ''B'' data respectively to merge into the output clip. For [[YUV]] format clips, the data is taken from the ''Y'' (luma) channel. For [[RGB]] format clips, the data is taken from the respective source channel&ndashi.e. ''R'' to ''R'', ''G'' to ''G'', ''B'' to ''B''. The unused chroma or color channels of the input clips are ignored. |
− | All YUV luma pixel data is assumed to be pc-range | + | All YUV luma pixel data is assumed to be pc-range (0..255); there is no tv-range (16..235) scaling. Chroma data from YUV clips is ignored. Input clips may be a mixture of all formats. [[YV12]] is the most efficient format for transporting single channels thru any required filter chains. |
− | + | {{FuncArg|pixel_type}} (default "RGB32", optionally "RGB24") specifies the output pixel format. | |
− | + | Audio, [[Clip_properties|FrameRate]] and [[Clip_properties|FrameCount]] are taken from the first clip. | |
− | + | === Examples === | |
− | + | <div {{BoxWidthIndent|46|0}} > | |
− | # | + | # Blur the Green channel only. |
− | + | [[DGDecode/MPEG2Source|MPEG2Source]]("main.d2v") | |
[[ConvertToRGB24]]() | [[ConvertToRGB24]]() | ||
− | MergeRGB(Last, Blur(0.5), Last) | + | MergeRGB(Last, [[Blur]](0.5), Last) |
+ | </div> | ||
− | # | + | <div {{BoxWidthIndent|46|0}} > |
− | # load the alpha from a second | + | # Swap the red and blue channels; |
− | vid1 = [[AviSource]](" | + | # load the alpha from a second source. |
− | vid2 = AviSource(" | + | vid1 = [[AviSource]]("main.avi") |
− | MergeARGB(vid2, vid1.[[ShowBlue]]("YV12"), vid1, vid1.[[ShowRed]]("YV12")) | + | vid2 = AviSource("alpha.avi") |
+ | MergeARGB( | ||
+ | \ vid2, | ||
+ | \ vid1.[[ShowBlue]]("YV12"), | ||
+ | \ vid1, | ||
+ | \ vid1.[[ShowRed]]("YV12") | ||
+ | \ ) | ||
[[AudioDub]](vid1) | [[AudioDub]](vid1) | ||
+ | </div> | ||
− | + | === Changelog === | |
{| border="1" | {| border="1" | ||
|- | |- |
Revision as of 18:11, 24 January 2016
MergeARGB(clip clipA, clip clipR, clip clipG, clip clipB)
MergeRGB(clip clipR, clip clipG, clip clipB [, string pixel_type ] )
Merge the alpha (transparency) and color channels from the source video clips into the output video clip.
clipA provides the alpha data to merge into the output clip. For a YUV format clip, the data is taken from the Y (luma) channel. For an RGB32 format clip, the data is taken from the A (alpha) channel. RGB24 clips cannot be used.
cliprR, clipG and clipB provide the R, G and B data respectively to merge into the output clip. For YUV format clips, the data is taken from the Y (luma) channel. For RGB format clips, the data is taken from the respective source channel&ndashi.e. R to R, G to G, B to B. The unused chroma or color channels of the input clips are ignored.
All YUV luma pixel data is assumed to be pc-range (0..255); there is no tv-range (16..235) scaling. Chroma data from YUV clips is ignored. Input clips may be a mixture of all formats. YV12 is the most efficient format for transporting single channels thru any required filter chains.
pixel_type (default "RGB32", optionally "RGB24") specifies the output pixel format.
Audio, FrameRate and FrameCount are taken from the first clip.
Examples
# Blur the Green channel only. MPEG2Source("main.d2v") ConvertToRGB24() MergeRGB(Last, Blur(0.5), Last)
# Swap the red and blue channels; # load the alpha from a second source. vid1 = AviSource("main.avi") vid2 = AviSource("alpha.avi") MergeARGB( \ vid2, \ vid1.ShowBlue("YV12"), \ vid1, \ vid1.ShowRed("YV12") \ ) AudioDub(vid1)
Changelog
v2.56 | Initial release. |