Documentation:Modules/alphamask: Difference between revisions

From VideoLAN Wiki
Jump to navigation Jump to search
New page: {{Module|name=alphamask|type=Video filter|first_version=0.9.0|description=change the video's alpha channel}} This filter can be used in the mosaic framework to set a video's alpha channel...
 
m Repair external link, +sc × 2, misc.
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Module|name=alphamask|type=Video filter|first_version=0.9.0|description=change the video's alpha channel}}
{{Mosaic framework}}
 
{{Module|name=alphamask|type=Video filter|first_version=0.9.0|description=Change the video's alpha channel|sc=alphamask|sc2=mask}}
This filter can be used in the mosaic framework to set a video's alpha channel (or transparency) based on a PNG image's alpha channel. You can thus blend only parts of the mosaic substream on the background.


This filter can be used in the mosaic framework to set a video's alpha channel (or transparency) based on a [[PNG]] image's alpha channel. You can thus blend only parts of the mosaic substream on the background.
__TOC__
== Options ==
{{Option
{{Option
|name=alphamask-mask
|name=alphamask-mask
|value=string
|value=string
|default=
|default=NULL
|description=PNG file to use as a mask. The alpha channel only will be used to build the mask. This image needs to have the same size as the video it will be used with.
|description=[[PNG]] file to use as a mask. The alpha channel only will be used to build the mask. This image needs to have the same size as the video it will be used with.
}}
}}


Example use:
== Example ==
  % '''vlc -I telnet --color -vvv --vlm-conf mosaic.vlm --mosaic-width 360 \
  % '''vlc -I telnet --color -vvv --vlm-conf mosaic.vlm --mosaic-keep-picture \'''
--mosaic-height 270 --mosaic-rows 6 --mosaic-cols 6 --mosaic-keep-picture \
  '''--fake-file ~/images/mire.jpg --fake-width 360 --fake-height 270 \'''
--fake-file ~/images/mire.jpg --fake-width 360 --fake-height 270 \
  '''--no-audio --sub-filter mosaic'''
--no-audio --sub-filter mosaic'''


And the vlm config:
And the vlm config:


  new channel0 broadcast enabled
  new channel0 broadcast enabled
  setup channel0 input /home/dionoea/media/redefined-nintendo.mpg
  setup channel0 input redefined-nintendo.mpg
  setup channel0 output #duplicate{dst=mosaic-bridge{id=0,height=270,width=360,mask=/home/dionoea/images/cone_360x270.png},select=video,dst=bridge-out{id=0},select=audio}
  setup channel0 output #duplicate{dst=mosaic-bridge{height=270,width=360,chroma=YUVA,vfilter=alphamask{mask=cone_360x270.png}},select=video}
 
 
  new background broadcast enabled
  new background broadcast enabled
  setup background input fake:
  setup background input fake:
  control background play
  control background play
 
control channel0 play


control channel0 play
The files used are available on [https://web.archive.org/web/20121015070412/https://people.videolan.org/~dionoea/mosaic/ people.videolan.org/~dionoea/mosaic (archived)] if you want to test. (This will blend the redefined nintendo video in a cone like region)
 
== Source code ==
* {{VLCSourceFile|modules/video_filter/alphamask.c}}


The files used are available on http://people.videolan.org/~dionoea/mosaic/ if you want to test. (This will blend the redefined nintendo video in a cone like region)
{{Documentation footer}}

Latest revision as of 08:05, 31 May 2019

Mosaic framework (How-To)
Modules: mosaic (mosaic-bridge • bridge-in • bridge-out) • alphamask • bluescreen
Module: alphamask
Type Video filter
First VLC version 0.9.0
Last VLC version -
Operating system(s) all
Description Change the video's alpha channel
Shortcut(s) alphamask, mask

This filter can be used in the mosaic framework to set a video's alpha channel (or transparency) based on a PNG image's alpha channel. You can thus blend only parts of the mosaic substream on the background.

Options

  • alphamask-mask <string> : PNG file to use as a mask. The alpha channel only will be used to build the mask. This image needs to have the same size as the video it will be used with. default value: NULL

Example

% vlc -I telnet --color -vvv --vlm-conf mosaic.vlm --mosaic-keep-picture \
  --fake-file ~/images/mire.jpg --fake-width 360 --fake-height 270 \
  --no-audio --sub-filter mosaic

And the vlm config:

new channel0 broadcast enabled
setup channel0 input redefined-nintendo.mpg
setup channel0 output #duplicate{dst=mosaic-bridge{height=270,width=360,chroma=YUVA,vfilter=alphamask{mask=cone_360x270.png}},select=video}
 
new background broadcast enabled
setup background input fake:
control background play
 
control channel0 play

The files used are available on people.videolan.org/~dionoea/mosaic (archived) if you want to test. (This will blend the redefined nintendo video in a cone like region)

Source code

This page is part of official VLC media player Documentation (User Guide • Streaming HowTo • Hacker Guide • Modules)
Please read the Documentation Editing Guidelines before you edit the documentation
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.