Difference between revisions of "Video overlay"

From edgertronic high speed video camera
Jump to: navigation, search
m (overlay_settings)
(overlay_settings)
Line 94: Line 94:
 
| %%n || Serial number
 
| %%n || Serial number
 
|-
 
|-
| %%F || File name
+
| %%N || Name of file
 +
|-
 +
| %%F || Scaled font size
 
|-
 
|-
 
| %%x || Camera calculated x (horizontal) position
 
| %%x || Camera calculated x (horizontal) position

Revision as of 10:18, 20 March 2016

Anticipated release: 2.2

Video overlay has not been released yet.

Description

The edgertronic camera supports modifying the pixels in each video frame to overlay text and graphics. The video frames with the overlay applied are then encoded into a video file. To keep from obscuring the captured video, a black border is added to the bottom of each video frame with the overlay being displayed in the black border region.

When enabled, video overlay adds the note text and the frame number to each video frame. The trigger frame number is zero, pre-trigger frames have a negative number and frames captured after the trigger have a positive number.

Customization

Video overlay is supported using two custom GStreamer elements:

  • border
  • emboverlay

The border element supports XXX parameters and the emboverlay element supports 19 parameters. Because of the general purpose nature of GStreamer, you can do just about anything you want with overlays. Becuase of the general purpose nature of GStream, it is difficult to get correct.

Since video overlay is supported by GStreamer, all customization is done in the GStreamer pipeline file.

Pipeline file

There are two defined names you can include in each section of your customized pipeline files.

Name Description
border String containing all parameters and values that is used by the GStreamer border element. The supported parameters are listed below. An equal sign (no spaces) separate the parameter name from its value. parameter name, value pairs are separated by whitespace.
overlay_text String containing GStreamer emboverly element parameters and values relating to text content and rendering. CAMAPI first processes the string to replace fields with camera configuration values.

An equal sign (no spaces) separate a parameter name from its value. Parameter name, value pairs are separated by white space.

overlay_logo String containing GStreamer emboverly element parameters and values relating to graphics logo rendering.
overlay_time String containing GStreamer emboverly element parameters and values relating to time content and rendering.
overlay_frame_number String containing GStreamer emboverly element parameters and values relating to frame numbering rendering.
overlay_notes String containing GStreamer emboverly element parameters and values relating to notes rendering.

Overlay string syntax

An equal sign (no spaces) separate a parameter name from its value. Parameter name, value pairs are separated by whitespace. You can escape a character (such as the space character) using a backslash. Use two percent (%) signs instead of one.

overlay_settings

The defined parameters for controlling which camera settings are included and how they are rendered includes:

Name Type Data
Range
Example Value Description
settings-text string %%f\ fps String to be rendered with substitutions for various camera settings.
settings-offseth integer -frame width .. frame width 100 Horizontal location to start overlay placement.
settings-offsetv integer -frame width .. frame width -100 Vertical location to start overlay placement.
settings-font-height integer -frame width .. frame width 60 Font size (REVISIT: explain units).
setting-scolor integer -frame width .. frame width 0xFF0000 24 bit color value in the format 0xRRGGBB.
enable-settings boolean true .. false true

The defined 'settings-text camera settings variables include:

Variable Camera Setting
%%d Trigger date (DD-MMM-YY)
%%t Trigger time (HH-MM-SS)
%%T Trigger time (seconds since Jan 1, 1970)
%%i Sensitivity (ISO)
%%s Shutter
%%f Frame rate
%%S Sub-sampling
%%o Overclock
%%e Extended dynamic range
%%g Genlock
%%b Multishot buffer
%%n Serial number
%%N Name of file
%%F Scaled font size
%%x Camera calculated x (horizontal) position
%%y Camera calculated y (vertical) position


Example settings string:

%%f\ fps\ \ %%b\ buffer

Example configuration strings

The follow examples can be included in your custom GStream pipeline files.

Control the placement and size of the notes text. A negative vertical offset means from the bottom of the video frame.

emboverlay=text-offseth=100 text-offsetv=-100 text-font-height=60 text-color=0xFF0000 enable-text=true


border parameters

emboverlay parameters

  logo                : Overlayed image path, must be a png file
                        flags: readable, writable
                        String. Default: null Current: null
  text                : Overlayed text to display
                        flags: readable, writable
                        String. Default: null Current: null
  logo-offseth        : Overlayed image horizontal offset
                        flags: readable, writable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 Current: 0
  logo-offsetv        : Overlayed image vertical offset
                        flags: readable, writable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 Current: 0
  logo-transp         : Overlayed image transparency. Enable = 1 Disable = 0
                        flags: readable, writable
                        Integer. Range: 0 - 1 Default: 0 Current: 0
  enable-logo         : Enable or disable logo rendering
                        flags: writable
                        Boolean. Default: false  Write only
  text-offseth        : Overlayed text horizontal offset
                        flags: readable, writable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 Current: 0
  text-offsetv        : Overlayed text vertical offset
                        flags: readable, writable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 Current: 0
  text-font-height    : Overlayed text font height
                        flags: readable, writable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 Current: 0
  text-color          : Overlayed text color. RGB format 0xRRGGBB
                        flags: readable, writable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 Current: 0
  text-border         : Overlayed text border color. RGB format 0xRRGGBB
                        flags: readable, writable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 Current: 0
  enable-text         : Enable or disable text rendering
                        flags: writable
                        Boolean. Default: false  Write only
  time-offseth        : Overlayed time horizontal offset
                        flags: readable, writable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 Current: 0
  time-offsetv        : Overlayed time vertical offset
                        flags: readable, writable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 Current: 0
  time-font-height    : Overlayed time font size
                        flags: readable, writable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 Current: 0
  time-color          : Overlayed time font color. RGB format color=0xRRGGBB
                        flags: readable, writable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 Current: 0
  time-param          : Overlayed time parameters %b %Y; %H:%M:%S will render: month year; hour:minutes:seconds
                        flags: readable, writable
                        String. Default: null Current: null
  time-border         : Overlayed time border color. RGB format color=0xRRGGBB
                        flags: readable, writable
                        Integer. Range: -2147483648 - 2147483647 Default: 0 Current: 0
  enable-time         : Enable or disable time rendering
                        flags: writable
                        Boolean. Default: false  Write only

Time overlay

By default emboverly time capability is disabled, because the time used is not the time when the video was captured.

The time-param field is just passed to strftime(), which itself supports 44 parameters. The time used for the overlay is the time when the file is saved, not when the video was captured. Use the metadata file to determine the time the video was captured.