Updated for Snowmix 0.4.4.
This is the reference manual for Snowmix for the commands belonging to the feeds commands for creating, inspecting and positioning video feeds. See also:
Name
feed add - Add a place holder for a feed
Synopsis
feed add [<feed no> <feed name>]
Description
The feed add command, when given without any parameters will list created feeds. If given with the feed no parameter and a feed name being any characters different from a newline, a place holder for a video feed with the name given and identified by the feed no will be created. The name must contain more characters than just whitespace. The feed no must be a positive integer larger than zero. The feed with the feed no 0 is the system feed and it is created by default. The name of a feed can be changed later by the command feed name*. A created feed can currently not be deleted. This may change in the future.
A maximum of 12 feeds can be created. This is controlled by the constant MAX_VIDEO_FEEDS in the src/video_feed.h file and can be changed upon need.
Example
feed add 1 Video Feed #1
See also
feed name, feed socket, feed geometry, feed idle, feed cutout, feed shift, feed live/recorded, feed buffers, feed scale, feed par, feed help, feed info
Name
feed buffers - print debugging information on feed buffers
Synopsis
feed buffers
Description
The feed buffers command will print debug information on feed buffers. This is mainly a debugging tool for internal use.
Example
feed buffers DBG: Feed 0 Internal DBG: Feed 1 Feed #1 DBG: Area ID: 1 Blocks: 0 1 DBG: Feed 2 Feed #2
See also
feed add, feed list, feed help, feed info
Name
feed cutout - sets a cutout window for the stack command.
Synopsis
feed cutout <feed no> <start col> <start row> <columns> <rows>
Description
The feed cutout command is an optional command that can be used to define a cutout window of the feed identified by the parameter feed no. The cutout window will be used when the feed is overlayed using the stack command. The cutout window can have the same size as the feed itself or usually smaller. The command together with the stack command is deprecated and should only be used for simple quick setups.
The parameter start col and start row defines where the cutout in the feed geometry should start. The parameter columns and rows defines how many columns and rows the cutout should include. Obviously start col plus columns should not be larger than the feed width. The same applies for the rows and the feed height.
Example
feed cutout 2 32 16 320 240
The example defines a cutout of feed 2 where the cutout starts in 32,16 and has the geometry 320x240. The actual placement of the cutout will be defined by the feed shift command and the stack command.
See also
feed name, feed socket, feed geometry, feed idle, feed cutout, feed shift, feed live/recorded, feed buffers, feed scale, feed par, feed help, feed info, stack
Name
feed geometry - set the feed geometry
Synopsis
feed geometry <feed no> <width> <height>
Description
The feed geometry command will set the pixel geometry for the feed identified by the parameter feed no. A feed geometry can not be changed after being set.
Example
feed geometry 2 1024 576
The example sets the geometry for feed number 2 to 1024x576 (WxH).
See also
feed add, feed name, feed socket, feed idle, feed cutout, feed shift, feed live/recorded, feed buffers, feed scale, feed par, feed help, feed info
Name
feed fast overlay - overlay a feed with a specific set of settings.
Synopsis
feed fast overlay <feed id> <col> <row> <feed col> <feed row> <cut cols> <cut rows> [ <scale 1> <scale 2> [ <par_w> <par_h> [ center ]]]
Description
The command feed fast overlay replaces the undocumented command overlay feed available in Snowmix prior to version 0.4.4. The command can be used to overlay/mix a feed using a specific set of parameters without affecting whatever parameters set for the specific feed. The command will only have effect when it is executed as part of the command macro that is set with the command overlay finish*.
The command has the required arguments 7 required arguments, but can also be used with 9 arguments, 11 arguments or 12 arguments.
The 7 first arguments are feed id, col, row, feed col, feed row, cut cols, cut rows. The first argument specifies the id for the feed that is to be overlayed. The col, row argument specify the start row and column on the system frame where the feed is to be overlayed. The next 4 arguments feed col, feed row, cut cols, cut rows specify the cutout of the feed that is going to be overlayed. If a cutout the size of 800x400 of a feed with the geometry 1024x576 is going to be overlayed and the cutout is to be centered, the arguments will be:
feed col = (1024 - 800) / 2 = 112 feed row = (576 - 400) / 2 = 88 cut cols = 800 cut row = 400
The next 2 optional arguments scale_1 and scale_2 determind how the feed is scaled. The 2 arguments specify a scale ratio = scale_1 / scale_2. If a feed is to be scaled down to half the size, the arguments would be scale_1 = 1 and scale_2 = 2 as 1/2 = 0.5.
The next 2 optional arguments par_w and par_h specify the Pixel Aspect Ratio (PAR). If a feed has the width and height 704x576 and the PAR arguments is 12 and 11, this mean that the feed would be stretch its width to 704*12/11 = 768. The display geometry is then 768x576. This is done by scaling the with by par_w/par_h or in this case by 12/11.
The last argument center overrides the feed col and feed row argument by centering the cutout of the feed in the window defined by cut cols and cut rows.
Example
feed fast overlay 1 20 10 112 88 800 400 feed fast overlay 1 20 10 112 88 800 400 1 1 feed fast overlay 1 20 10 112 88 800 400 1 1 12 11
See also
feed add, feed geometry,feed name, feed socket, feed idle, feed cutout, feed shift, feed live/recorded, feed buffers, feed scale, feed par, feed help, feed info.
Name
feed filter - set the scaling/overlaying method for a feed.
Synopsis
feed filter [ <feed no> (fast | good | best | nearest | bilinear | gaussian)]
f
Description
The command feed filter controls what method is used to possibly scale and overlay a feed.
WARNING: Any filter setting not being fast or nearest will make the overlaying of that feed if scaled 30-50 times slower compared to the fast method. This can be detrimental to running SNowmix if the hardware on which SNowmix is running is not fast enough.
Example
feed filter 2 bilinear
The example sets the filter/scaling method for feed 2 to be bilinear instead of the default fast method.
See also
feed add, feed geometry,feed name, feed socket, feed idle, feed cutout, feed shift, feed live/recorded, feed buffers, feed scale, feed par, feed help, feed info
Name
feed help - print the command syntax for feeds
Synopsis
feed help
Description
The feed help command will print the command syntax for feed commands.
Example
feed help
See also
feed add, feed list, feed info, feed buffers
Name
feed idle - set timeout and idle image for a feed stalled/disconnected.
Synopsis
feed idle <feed no> <timeout in frames> <idle image file>
Description
The feed idle command can be used to set the idle image to be used for a feed that is stalling or has been disconnected. A feed is said to be stalled, if it has an external process connected to its control pipe, but is missing timeout frames in a row. A feed is disconnected if it has no external processing connected to its control pipe. In either case, the idle image file is shown, when the feed is used for overlay.
The image file must be a valid file name with an image, where the bytes are arranged as BGRABGRA..... line for line matching the size of the the feed.
Idle frame or dead feed images are located in the frames directory. An image file can be created in many ways. One of the ways would be to use gstreamer and dd to create a single frame. The script frames/make_frame does that. The script will ask for width and height.
Another way to create a frame in the right format is to use any image program such as gimp to create an image with the right size and with the alpha channel enabled. This file if saved as a PNG file (remember to add an alpha channel if it does not have one). It can then be loaded into Snowmix using the command image load. The image loaded can then be written back using the command image write. This command writes in the BGRA format.
WARNING. The command feed idle should only be used once per feed and *it should only be used in the initializing/start-up phase as reading a file can block for shorter or longer period. If that was to happen, the main video loop of Snowmix would be affected.
Example
feed idle 1 100 ../frames/dead-768x576.bgra
This example sets the dead/stalled/disconnected image for feed 1 to be loaded from the file ../frames/dead-768x576.bgra. If the feed is missing 100 frames in a row, or being disconnected, the feed will display the image instead of the last received frame.
See also
feed name, feed socket, feed geometry, feed add, feed cutout, feed shift, feed live/recorded, feed buffers, feed scale, feed par, feed help, feed info
Name
feed info - print information on feeds
Synopsis
feed info
Description
The feed info command will print information on the feeds. The information printed for the individual feeds is:
state : Feed State. The feed states are SETUP, READY, PENDING, RUNNING, STALLED and DISCONNECTED.
islive : Stream type is either live or recorded.
oneshot : Either continuously or oneshot. A oneshot feed will be deleted upon disconnect. However this is not yet fully implemented.
geometry : The piuxel geometry of a feed.
cutstart : Parameters set with the command feed cutout.
cutsize : Parameters set with the command feed cutout.
offset : Parameters set with the command feed shift.
fifo : The number of fifos used and available.
good : Frames received.
missed : Frames missed (late).
dropped : Frames dropped (too fast).
Example
feed info STAT: Feed info: STAT: Feed count : 2 of 12 STAT: time : 1374178017.631 STAT: feed id : state islive oneshot geometry cutstart cutsize offset fifo good missed dropped <name> STAT: feed 0 : STALLED recorded continuously 1280x720 0,0 1280x720 0,0 0:0 0 0 0 <Internal> STAT: feed 1 : RUNNING live continuously 1280x720 0,0 1280x720 0,0 2:10 127 0 0 <Feed #1> STAT: feed 2 : PENDING live continuously 1280x720 0,0 1280x720 0,0 0:10 0 147 0 <Feed #2> STAT:
See also
feed add, feed list, feed help, feed buffers
Name
feed list - print detailed information on feeds
Synopsis
feed list [verbose]
Description
The feed list command will print information on the feeds. When the command is used without the argument verbose, the command will list the feeds comparable, but not identical to how the command feed add will print information on feeds. If the argument verbose is given, the command will print many details on the every feed.
Example
feed list verbose STAT: Feed ID 0 STAT: Name: Internal STAT: State: STALLED STAT: Socket: N/A STAT: Fullscreen: Yes STAT: Geometry: 1024 576 STAT: Cutout: 0 0 1024 576 STAT: Shift: 0 0 STAT: Open: No STAT: Is Live: No STAT: Oneshot: No STAT: Idle Time: 1 STAT: Image file: STAT: Frames: 0 STAT: Dropped: 0 STAT: Missed: 0 STAT: Feed ID 1 STAT: Name: Feed #1 STAT: State: PENDING STAT: Socket: /tmp/feed1-control-pipe STAT: Fullscreen: No STAT: Geometry: 768 576 STAT: Cutout: 32 96 320 192 STAT: Shift: 704 0 STAT: Open: No STAT: Is Live: Yes STAT: Oneshot: No STAT: Idle Time: 100 STAT: Image file: ../frames/dead-768x576.bgra STAT: Frames: 0 STAT: Dropped: 0 STAT: Missed: 5800 STAT:
See also
feed add, feed help, feed buffers, feed info
Name
feed name - set or change the name of a feed
Synopsis
feed name <feed no> <feed name>
Description
The feed name command will set or change the name for a feed created with the feed add command. The feed is identified by the parameter feed no.
Example
feed name 2 Some Other Feed Name
The example sets the feed name for feed number 2 to Some Other Feed Name.
See also
feed add, feed geometry, feed socket, feed idle, feed cutout, feed shift, feed live/recorded, feed buffers, feed scale, feed par, feed help, feed info
Name
feed overlay - overlay a feed.
Synopsis
feed overlay (<id> | <id>..<id> | all | end | <id>..end) [ (<id> | <id>..<id> | all | end | <id>..end) ] ....
Description
The command feed overlay can be used to overlay a feed or list of feeds identified by their ids. The command will only have effect when it is executed as part of the command macro that is set with the command overlay finish. The command is a supplement to the command stack that would normally be used to overlay feeds. The command can used instead of the stack command where greater control of when a feed is overlayed is needed. The command stack will overlay feeds before the command macro specified by the command overlay finish while the command overlay feed can be used in the command macro specified by the command overlay finish. When a feed is overlayed using this macro, the parameters set for the feed will be used.
Example
feed overlay 4 1..3
This example will overlay first feed 4 and then feed 1 through 3.
See also
feed add, feed geometry,feed name, feed socket, feed idle, feed cutout, feed shift, feed live/recorded, feed buffers, feed scale, feed par, feed help, feed info, feed filter, overlay finish, virtual feed overlay.
Name
feed par - set the feed's pixel aspect ratio
Synopsis
feed par <feed no> <scale_1> <scale_2>
Description
The feed par command will set the pixel aspect ratio or PAR for a feed for the feed identified by the parameter feed no. . The default value for PAR is 1:1. The PAR value is not by default used by virtual feeds nor by shapes when these are sourced by feeds. This may change in the future though it is rather trivial to change the aspect ratio of both virtual feeds and shapes sourced by feeds. All values of PAR except 0:x and x:0 can be used from version 0.4.3. The Snowmix lib in slib/scenes.slib repect the PAR information when displaying frames in scenes.
Example
feed par 2 12 11
The example sets the PAR for feed number 2 to 12:11. If video feed 2's geometry is 704x576, the display geometry for square pixels is 12*704/11x576 = 768x576
See also
feed add, feed name, feed socket, feed idle, feed cutout, feed shift, feed live/recorded, feed buffers, feed scale, feed par, feed help, feed info
Name
feed socket - set the feed's control socket for input from GStreamer shmsink
Synopsis
feed socket <feed no> <file name>
Description
The feed socket command will set the feeds control socket that GStreamer's module shmsink utilize to signal availability of a new frame for the feed. Each feed must have its own unique control socket. From Snowmix version 0.5.0 it will be mandatory for the command feed socket to use absolute path/file name starting with a leading '/'.
Example
feed socket 1 /tmp/feed1-control-socket
The example sets the control socket for feed number 1 to /tmp/feed1-control-socket. The GStreamer pipeline must then have a pipeline ending as shown below
gst-launch .........! $MIXERCAPS ! shmsink socket-path=/tmp/feed1-control-socket shm-size=$SHMSIZE wait-for-connection=0
The variable MIXERCAPS must include the following to match the Snowmix video format:
GStreamer 0.10 'video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216,.........' GStreamer 1.0 'video/x-raw, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216,.........'
A full example can be seen in scripts/input2feed.
See also
feed add, feed name, feed socket, feed idle, feed cutout, feed shift, feed live/recorded, feed buffers, feed scale, feed par, feed help, feed info
Name
feed shift - set where the feed should be overlayed when using the stack command.
Synopsis
feed shift <feed no> <column> <row>
Description
The feed shift command will set coordinates where the feed will be placed when using the command stack. The column and row indicates where the feed's upper left corner will be placed on the mixers system geometry. As for the stack command, this command is deprecated and should only be used for small quick setups.
Example
feed shift 2 320 192
The example will place the feed at 320,192, if set by the command stack.
See also
feed add, feed name, feed socket, feed idle, feed cutout, feed geometry, feed live/recorded, feed buffers, feed scale, feed par, feed help, feed info, system geometry, stack.
Name
feed live/recorded - set whether the feed is a live feed or a recorded feed.
Synopsis
feed live
feed recorded
Description
The feed live and feed recorded command will set the feed either as live stream or recorded stream (file).
A live feed will drop frames if they are arriving "too fast" meaning faster than the specified system frame rate. A recorded feed will not drop the frames, but rather queue them in the fifo eventually slowing down the GStreamer input pipeline.
For both a live and a recorded applies, that if frames are arriving late, the last used frame will be used.
Example
feed live 2 feed recorded 2
See also
feed add, feed name, feed socket, feed idle, feed cutout, feed geometry, feed buffers, feed scale, feed shift, feed par, feed help, feed info, system geometry, stack.
Name
feed scale - scale the feed for overlaying using the stack command.
Synopsis
feed shift <feed no> <scale_1> <scale_2>
Description
The feed scale command will scale the feed to a fraction when overlaying using the command stack. The scale_1 and scale_2 is the fraction scale_1:scale_2. As for the stack command, this command is deprecated and should only be used for small quick setups. From version 0.4.3 scaling feeds is as fast as scaling virtual feeds and all values for scaling except 0:x and x:0 can be used.
Example
feed shift 2 2 5
The example will scale the feed 2 by 2:5 if the feed is overlayed using the command stack.
See also
feed add, feed name, feed socket, feed idle, feed cutout, feed geometry, feed live/recorded, feed buffers, feed scale, feed par, feed help, feed info, system geometry, stack.
Discussion: Reference mnual for feeds available.
Wiki: Audio
Wiki: Home
Wiki: Reference Audio Feeds
Wiki: Reference Audio Mixers
Wiki: Reference Audio Sinks
Wiki: Reference Cairo Graphics
Wiki: Reference Command
Wiki: Reference Feeds
Wiki: Reference GL Shapes
Wiki: Reference General
Wiki: Reference Images
Wiki: Reference Placed GL Shapes
Wiki: Reference Placed Shapes
Wiki: Reference Shapes
Wiki: Reference Texts
Wiki: Reference Virtual Feeds
Wiki: Reserved Commands
Wiki: Shapes
Wiki: Snowmix Guide
Wiki: Tutorials
Wiki: Video Text