Difference between revisions of "Video overlay"

From edgertronic high speed video camera
Jump to: navigation, search
m
m (Notes parameters)
 
(28 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Anticipated release: 2.2
+
<blockquote style="background-color: khaki; border: solid thin gray;">
 +
<center>Video overlay is supported in 2.2.0 and later releases.</center>
 +
</blockquote>
  
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.
 +
 
 +
There are different overlay features that can be individually enabled or disabled:
 +
 
 +
* Overlay frame number
 +
* Overlay notes text with parameter expansion
 +
* Overlay settings
 +
* Overlay logo
  
= Description =
+
The trigger frame is frame zero.  Frames prior to the trigger event have a negative frame number and frames after the trigger frame have a positive number.  The trigger frame is the frame that occurs coincident or immediately after the trigger input fall edge or trigger event. This delay of zero to one frame time will be recorded in the [[metadata file]].  The text overlay can contain parameters, like camera serial number, which are set appropriately when the video is saved.
 +
 
 +
= Settings =
  
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.
+
{|
 +
| [[File:Overlay.png|400px|thumb|right|Overlay tab]] || [[File:Sc2-web-ui-overlay-labeled.jpg|400 px|thumb|right|Example video frame with overlays]]
 +
|}
  
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.
+
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 ampersand '''&''' parameters that are expanded when the video is being saved.
  
= Customization =
+
== Custom logo ==
  
Video overlay is supported using two custom GStreamer elements:
+
The camera ships with 422 x 96 pixel version of the edgertronic logo pre-installed.  If you enable logo overlay, you will get the edgertronic logo if no other logo has been installed.
  
* border
+
To install a custom logo, you need to provide PNG file named logo.png, store the logo.png file on the big SD card, and power on the camera.  If you provide a corrupt PNG file, you will likely need to do a [[Multi-function_button#Factory_reset|factory reset]] to get your camera to operate properly again.
* 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.
+
When generating the logo PNG file, keep the following in mind:
  
Since video overlay is supported by GStreamer, all customization is done in the [[Pipeline support|GStreamer pipeline file]].
+
* At full camera resolution the logo is overlaid pixel for pixel.  For lower resolutions, the camera scales the logo to make it smaller so it covers approximately the same percentage of the overall frame.
 +
* The camera supports alpha channel if you want the underlying video to show though portions of the logo.  Only full transparency / full opacity are supported.
 +
* The [[Pipeline_support#Pipeline_file|pipelines file]] that ships with the camera positions the text in the lower left and the logo in the lower right.  The text will overlay on top of the logo if the two overlap.
 +
* If you have loaded one logo file into the camera and then put a second logo file on the big SD card, the new file from the big SD card will replace the previous custom logo.
  
== Pipeline file ==
+
== Notes parameters ==
  
There are two defined names you can include in each section of your customized pipeline files.
+
The following ampersand 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 ampersand 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.
  
{| border=2
+
{| class="wikitable"
! Name !! Description
+
! Variable !! Camera Setting
 +
|-
 +
| &b || Multishot buffer
 +
|-
 +
| &d || Trigger date (DD-MMM-YY)
 +
|-
 +
| &e || Extended dynamic range
 +
|-
 +
| &f || Frame rate
 +
|-
 +
| &g || Genlock
 +
|-
 +
| &i || Sensitivity (ISO)
 +
|-
 +
| &m || Model number
 +
|-
 +
| &n || Serial number
 
|-
 
|-
| 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.
+
| &N || Name of file
 
|-
 
|-
| 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.
+
| &o || Overclock
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.
+
| &s || Shutter Speed
 
|-
 
|-
| overlay_time || String containing GStreamer emboverly element parameters and values relating to time content and rendering.
+
| &S || Sub-sampling
 
|-
 
|-
| overlay_frame_number || String containing GStreamer emboverly element parameters and values relating to frame numbering rendering.
+
| &t || Trigger time (HH-MM-SS)
 
|-
 
|-
| overlay_notes || String containing GStreamer emboverly element parameters and values relating to notes rendering.
+
| &T || Trigger Epoch (seconds since Jan 1, 1970)
 
|}
 
|}
  
== Overlay string syntax ==
+
= Preview =
  
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 backslash.  Use two percent (%) signs instead of one.
+
When an overlay is enabled, the live preview visible in the Web UI for a few seconds after camera calibration completesThis allows you to verify the overlay layoutSome 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.
  
== Example configuration strings ==
+
During preview, the camera uses X's instead of the actual value if the actual value is dependent on the trigger time.  When the video is saved, the X's are replaced with the correct value.  The purpose of the X's are so you can properly frame what is being captured so that the overlay doesn’t cover the important part of the video.
  
The follow examples can be included in your custom GStream pipeline files.
+
= Customization =
 
 
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 [[Pipeline support#Overlay support|customized pipelines file]] if you want to modify the location of  the text and logo overlays.
  
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:Features]]

Latest revision as of 12:52, 21 February 2020

Video overlay is supported in 2.2.0 and later releases.

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.

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

  • Overlay frame number
  • Overlay notes text with parameter expansion
  • Overlay settings
  • Overlay logo

The trigger frame is frame zero. Frames prior to the trigger event have a negative frame number and frames after the trigger frame have a positive number. The trigger frame is the frame that occurs coincident or immediately after the trigger input fall edge or trigger event. This delay of zero to one frame time will be recorded in the metadata file. The text overlay can contain parameters, like camera serial number, which are set appropriately when the video is saved.

Settings

Overlay tab
Example video frame with overlays

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 ampersand & parameters that are expanded when the video is being saved.

The camera ships with 422 x 96 pixel version of the edgertronic logo pre-installed. If you enable logo overlay, you will get the edgertronic logo if no other logo has been installed.

To install a custom logo, you need to provide PNG file named logo.png, store the logo.png file on the big SD card, and power on the camera. If you provide a corrupt PNG file, you will likely need to do a factory reset to get your camera to operate properly again.

When generating the logo PNG file, keep the following in mind:

  • At full camera resolution the logo is overlaid pixel for pixel. For lower resolutions, the camera scales the logo to make it smaller so it covers approximately the same percentage of the overall frame.
  • The camera supports alpha channel if you want the underlying video to show though portions of the logo. Only full transparency / full opacity are supported.
  • The pipelines file that ships with the camera positions the text in the lower left and the logo in the lower right. The text will overlay on top of the logo if the two overlap.
  • If you have loaded one logo file into the camera and then put a second logo file on the big SD card, the new file from the big SD card will replace the previous custom logo.

Notes parameters

The following ampersand 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 ampersand 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
&b Multishot buffer
&d Trigger date (DD-MMM-YY)
&e Extended dynamic range
&f Frame rate
&g Genlock
&i Sensitivity (ISO)
&m Model number
&n Serial number
&N Name of file
&o Overclock
&s Shutter Speed
&S Sub-sampling
&t Trigger time (HH-MM-SS)
&T Trigger Epoch (seconds since Jan 1, 1970)

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.

During preview, the camera uses X's instead of the actual value if the actual value is dependent on the trigger time. When the video is saved, the X's are replaced with the correct value. The purpose of the X's are so you can properly frame what is being captured so that the overlay doesn’t cover the important part of the video.

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 location of the text and logo overlays.