22.3.0
Create a VidiCore MetadataType from a simplified object structure
(object
= {}
)
object to create MetadataType from
object
:
a MetadataType object
Parses MetadataType according to specified options. The attributes can be targeted for each sub-type.
(Object
= {}
)
A MetadataType from VidiCore.
(Object
= {}
)
Options which change how the metadataType is parsed.
Name | Description |
---|---|
options.joinValue string
|
String to join the values, eg ','. |
options.includeAttributes boolean
|
Include attributes on all objects. |
options.includeMetadataAttributes boolean
|
Include attributes on root. |
options.includeTimespanAttributes boolean
|
Include attributes on timespans. |
options.includeGroupAttributes boolean
|
Include attributes on groups. |
options.includeFieldAttributes boolean
|
Include attributes on fields. |
options.includeValueAttributes boolean
|
Include attributes on values. |
options.flat boolean
|
Flatten to key/value (Note: keys may be overwritten). |
options.flatTimespan boolean
|
Flatten timespan. |
options.flatGroup boolean
|
Flatten group. |
options.sortTimespan boolean
|
Sort timespan by start time. |
options.timespanAsList boolean
|
Return timespans as list. |
options.groupAsList boolean
|
Return groups as list. |
options.fieldAsList boolean
|
Return fields as list. |
options.arrayOnSingle boolean
(default true )
|
Return fields as array even if single field. |
options.arrayOnSingleValue boolean
(default true )
|
Return fields as array even if single field value. |
Object
:
Metadata object parsed according to options.
Parses timespanList according to specified options. The attributes can be targeted for each sub-type.
(Object
= {}
)
Options which change how the metadataType is parsed.
Name | Description |
---|---|
options.joinValue string
|
String to join the values, eg ','. |
options.includeAttributes boolean
|
Include attributes on all objects. |
options.includeMetadataAttributes boolean
|
Include attributes on root. |
options.includeTimespanAttributes boolean
|
Include attributes on timespans. |
options.includeGroupAttributes boolean
|
Include attributes on groups. |
options.includeFieldAttributes boolean
|
Include attributes on fields. |
options.includeValueAttributes boolean
|
Include attributes on values. |
options.flat boolean
|
Flatten to key/value (Note: keys may be overwritten). |
options.flatTimespan boolean
|
Flatten timespan. |
options.flatGroup boolean
|
Flatten group. |
options.sortTimespan boolean
|
Sort timespan by start time. |
options.timespanAsList boolean
|
Return timespans as list. |
options.groupAsList boolean
|
Return groups as list. |
options.fieldAsList boolean
|
Return fields as list. |
options.arrayOnSingle boolean
(default true )
|
Return fields as array even if single field. |
options.arrayOnSingleValue boolean
(default true )
|
Return fields as array even if single field value. |
Object
:
Metadata object parsed according to options.
Parses timespan according to specified options. The attributes can be targeted for each sub-type.
(Object
= {}
)
A timespan from VidiCore.
(Object
= {}
)
Options which change how the metadataType is parsed.
Name | Description |
---|---|
options.joinValue string
(default undefined )
|
String to join the values, eg ','. |
options.includeAttributes boolean
(default false )
|
Include attributes on all objects. |
options.includeTimespanAttributes boolean
(default false )
|
Include attributes on timespans. |
options.includeGroupAttributes boolean
(default false )
|
Include attributes on groups. |
options.includeFieldAttributes boolean
(default false )
|
Include attributes on fields. |
options.includeValueAttributes boolean
(default false )
|
Include attributes on values. |
options.flat boolean
(default false )
|
Flatten to key/value (Note: keys may be overwritten). |
options.flatTimespan boolean
(default false )
|
Flatten timespan. |
options.flatGroup boolean
(default false )
|
Flatten group. |
options.groupAsList boolean
(default false )
|
Return groups as list. |
options.fieldAsList boolean
(default false )
|
Return fields as list. |
options.arrayOnSingle boolean
(default true )
|
Return fields as array even if single field. |
options.arrayOnSingleValue boolean
(default true )
|
Return fields as array even if single field value. |
Object
:
Metadata object parsed according to options.
Parses highlight timespans from VidiCore into key/value object. The attributes can be targeted for each sub-type.
(Object
= []
)
A list of timespans from VidiCore.
(Object
= {}
)
Options which change how the timespans are parsed.
Name | Description |
---|---|
options.arrayOnSingle boolean
(default true )
|
Return an array if there is a single value. |
options.joinValue string
|
String to join the values, eg ','. |
options.timespanAsList boolean
(default false )
|
Return timespans as list. |
options.flat boolean
(default false )
|
Flatten to field-name/field-value (Note: field-values may be overwritten). |
options.flatTimespan boolean
(default false )
|
Flatten timespan to object with start/end as key. |
options.joinTimespan string
(default _ )
|
Character to join the start/end timecodes. |
Parses highlight timespan in VidiCore into key/value object. The attributes can be targeted for each sub-type.
Name | Description |
---|---|
highlightTimespan.field any
(default [] )
|
|
highlightTimespan.start any
|
|
highlightTimespan.end any
|
(Object
= {}
)
Options which change how the timespans are parsed.
Name | Description |
---|---|
options.arrayOnSingle boolean
(default true )
|
Return an array if there is a single value. |
options.timespanAsList boolean
(default false )
|
Return timespans as list. |
options.joinValue string
|
String to join the values, eg ','. |
Convert subtitle groups to WebVtt subtitle format
string
:
WebVtt subtitles
TimeBase class representing the TimeBaseType in VidiCore
For more info, see the Time bases section in VidiCore API Docs
(object
= {}
)
A time base type object
Get TimeBase as a VidiCore TimeBaseType string
Default format: denominator(:numerator if > 1)
constant
has precedence over fraction
if both are true (e.g. NTSC > 30000:1001)
string
:
Text representation of the TimeBase
Output TimeBase as frame rate (by default max 16 decimal places)
For options.fixed
:
true
gives two decimal placesfalse
gives max amount of decimal placesnumber
gives that amount of decimal placesDefault format: rate with two decimals if needed (i.e. decimals are > 0)
Option precedence (when all true): constant
> rounded
> fixed
(object
= {}
)
For how to display it as rate
Name | Description |
---|---|
options.fixed (boolean | number)
(default true )
|
Amount of decimal places (true gives 2 decimal places) |
options.constant boolean
(default false )
|
Use constant representation (if applicable) |
options.rounded boolean
(default false )
|
Rounded to nearest integer |
number
:
Rate of the TimeBase
Create a TimeBase Instance from a string or object representation of a time base
TimeBase
:
A TimeBase instance
Format a string representation of a time base to a TimeBase Instance
(string)
The string to format to a TimeBase instance
TimeBase
:
A TimeBase Instance
Create a TimeBase instance of an object
(object)
A TimeBase object ({ numerator, denominator })
TimeBase
:
A TimeBase instance
TimeCode class representing the TimeCodeType in VidiCore
For more info, see the Time Codes section of VidiCore API Docs
(object
= {}
)
Object to create TimeCode of
(object
= {}
)
Options for the timeCode
Return this TimeCode added with the supplied timeCodeType If time bases differ, it will retain the time base of this TimeCode instance If supplied time code has a more granular time base - it will round down exceeding samples (hasn't reached that sample yet)
Note: This might make you "lose" frames depending on granularity of time bases, e.g. "51@50".add("25@25") => "101@50" while "25@25".add("51@50") => "50@25" (not "101@50")
(TimeCode)
A TimeCode instance you want to add with
any
:
A new TimeCode instance with the addition applied
Return this TimeCode subtracted with the supplied timeCodeType If time bases differ, it will retain the time base of the instance time code If supplied time code has a more granular time base - it will round down exceeding samples (hasn't reached that sample yet)
Note: This might make you "lose" frames depending on granularity of time bases, e.g. "101@50".subtract("25@25") => "51@50" while "50@25".subtract("51@50") => "25@25" (not "49@50")
(TimeCode)
A TimeCode instance you want to subtract with
any
:
A new TimeCode instance with the subtraction applied
Creates a new TimeCode instance with specified timeBase and samples adjusted to that.
If it conforms to a less granular time base - it will floor samples (hasn't reached that sample yet)
any
:
A new TimeCode instance with the conformTo timeBase applied
Get TimeCode as a text representation
Default format: samples@denominator(:numerator if > 1)
constant
has precedence over fraction
if both are true
any
:
Text representation of TimeCode
Get TimeCode in a duration representation The time unit char keys for the format string are:
Any other char will be kept in the duration output string.
Add consecutive chars for zero padding.
By default it:
string
:
Duration representation of the TimeCode
Create a TimeCode instance from smpte, seconds/samples, timeCode object or string
(object
= {}
)
For the format functions
TimeCode
:
A TimeCode instance
Format text to a TimeCode instance
(string)
A time code text (e.g. "25@PAL")
TimeCode
:
A TimeCode instance
Format an object to a TimeCode instance
TimeCode
:
A TimeCode instance
Format seconds to TimeCode object Input time base is always 1:1 since it expects seconds as input
Note: Max 15 digits accuracy (double precision float64), e.g.
(object
= {}
)
Options for how to format the seconds to a TimeCode
Name | Description |
---|---|
options.timeBase (object | string)
|
What TimeBase the resulting TimeCode should have (if unset and useGCD=false, denominator will be 10^ ) |
options.useGCD boolean
(default false )
|
Samples and denominator are divided with GCD (ignored if timeBase is set) (e.g. 1.04 => 104@100 => 26@25) |
TimeCode
:
A TimeCode instance
Format smpte text to a TimeCode Instance
exceedingMode:
(string)
String representation of smpte
(object
= {}
)
What options to use for creating the time code from smpte (all not specified below are passed to the TimeCode constructor)
Name | Description |
---|---|
options.timeBase (object | string | number)
|
TimeBase of smpte (and consequently TimeBase of output TimeCode) |
options.exceedingMode string
(default error )
|
How to handle exceeding values (
overflow|truncate|error
)
|
options.dropFrame boolean
|
If it should parse and create time code using dropFrame |
options.frameSeparator string
|
What frame separator the TimeCode should store (defaults to what the smpte has) |
TimeCode
:
A TimeCode instance