Difference between revisions of "Video overlay"

From edgertronic high speed video camera
Jump to: navigation, search
(overlay_settings)
Line 5: Line 5:
 
= Description =
 
= 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.
+
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 can be 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.
+
There are different overlay features that can be individually enabled or disabled:
  
= Customization =
+
* Adding a black border to the bottom of each frame
 
+
* Overlay frame number
Video overlay is supported using two custom GStreamer elements:
+
* Overlay notes text with parameter expansion
 
+
* Overlay settings
* border
+
* Overlay logo
* 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 [[Pipeline support|GStreamer pipeline file]].
 
 
 
== Pipeline file ==
 
 
 
There are two defined names you can include in each section of your customized pipeline files.
 
 
 
{| border=2
 
! 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 ==
+
= Settings =
  
An equal sign (no spaces) separate a parameter name from its valueParameter name, value pairs are separated by whitespaceYou can escape a character (such as the space character) using a backslashUse two percent (%) signs instead of one.
+
The Overlay tab in the Settings modal allows on/off setting for each of the 4 overlay features along with a Notes field that can contain a text stringThe camera comes with pre-defined layout control for the frame number, settings, and logoUsing the web UI, you can specify the Notes textThe Notes text can contain special double percent '''%%''' parameters that are expanded when the video is being saved.
  
=== overlay_settings ===
+
== Notes parameters ==
  
The defined parameters for controlling which camera settings are included and how they are rendered includes:
+
The following double percent parameters can be included in the Notes text.  When the file is being saved, the camera will substitute the actual value in place of the  double percent parameter. An overlay preview is displayed in the web UI for a few seconds after calibrate completesDummy parameter values are used during overlay preview if the actual value is not available until a video is captured.
 
 
{| border=1
 
! Name !! Type !! Data<br>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:
 
  
 
{| border=1
 
{| border=1
Line 104: Line 60:
 
|}
 
|}
  
 +
= Preview =
  
Example settings string:
+
When an overlay is enabled, the live preview visible in the web UI for a few seconds after camera calibration completes.  This allows you to verify the overlay layout.  Some of the Notes parameters, such as trigger time, are only available when the camera is saving the video, so during overlay preview, dummy values are used.
  
%%f\ fps\ \ %%b\ buffer
+
= Customization =
 
 
== 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 ==
 
 
 
<pre>
 
  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
 
</pre>
 
 
 
=== Time overlay ===
 
  
By default emboverly time capability is disabled, because the time used is not the time when the video was captured.
+
The pipelines file contains the actual information used by GStreamer to generate the overlay.  You can supply our own customized pipelines file if you want to modify the overlay.
  
The '''time-param''' field is just passed to [http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html 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.
+
[[Category:Feature]]

Revision as of 21:44, 21 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 can be added to the bottom of each video frame with the overlay being displayed in the black border region.

There are different overlay features that can be individually enabled or disabled:

  • Adding a black border to the bottom of each frame
  • Overlay frame number
  • Overlay notes text with parameter expansion
  • Overlay settings
  • Overlay logo

Settings

The Overlay tab in the Settings modal allows on/off setting for each of the 4 overlay features along with a Notes field that can contain a text string. The camera comes with pre-defined layout control for the frame number, settings, and logo. Using the web UI, you can specify the Notes text. The Notes text can contain special double percent %% parameters that are expanded when the video is being saved.

Notes parameters

The following double percent parameters can be included in the Notes text. When the file is being saved, the camera will substitute the actual value in place of the double percent parameter. An overlay preview is displayed in the web UI for a few seconds after calibrate completes. Dummy parameter values are used during overlay preview if the actual value is not available until a video is captured.

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

Preview

When an overlay is enabled, the live preview visible in the web UI for a few seconds after camera calibration completes. This allows you to verify the overlay layout. Some of the Notes parameters, such as trigger time, are only available when the camera is saving the video, so during overlay preview, dummy values are used.

Customization

The pipelines file contains the actual information used by GStreamer to generate the overlay. You can supply our own customized pipelines file if you want to modify the overlay.