GstVideo.VideoTimeCode¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
config |
r/w |
the corresponding |
|
field_count |
r/w |
Interlaced video field count |
|
frames |
r/w |
the frames field of |
|
hours |
r/w |
the hours field of |
|
minutes |
r/w |
the minutes field of |
|
seconds |
r/w |
the seconds field of |
Methods¶
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class GstVideo.VideoTimeCode¶
field_count must be 0 for progressive video and 1 or 2 for interlaced.
A representation of a SMPTE time code.
hours must be positive and less than 24. Will wrap around otherwise. minutes and seconds must be positive and less than 60. frames must be less than or equal to config.fps_n / config.fps_d These values are *NOT* automatically normalized.
New in version 1.10.
- classmethod new(fps_n, fps_d, latest_daily_jam, flags, hours, minutes, seconds, frames, field_count)[source]¶
- Parameters:
fps_n (
int
) – Numerator of the frame ratefps_d (
int
) – Denominator of the frame ratelatest_daily_jam (
GLib.DateTime
) – The latest daily jam of theGstVideo.VideoTimeCode
flags (
GstVideo.VideoTimeCodeFlags
) –GstVideo.VideoTimeCodeFlags
hours (
int
) – the hours field ofGstVideo.VideoTimeCode
minutes (
int
) – the minutes field ofGstVideo.VideoTimeCode
seconds (
int
) – the seconds field ofGstVideo.VideoTimeCode
frames (
int
) – the frames field ofGstVideo.VideoTimeCode
field_count (
int
) – Interlaced video field count
- Returns:
a new
GstVideo.VideoTimeCode
with the given values. The values are not checked for being in a valid range. To see if your timecode actually has valid content, useGstVideo.VideoTimeCode.is_valid
().- Return type:
field_count is 0 for progressive, 1 or 2 for interlaced. latest_daiy_jam reference is stolen from caller.
New in version 1.10.
- classmethod new_empty()[source]¶
- Returns:
a new empty, invalid
GstVideo.VideoTimeCode
- Return type:
New in version 1.10.
- classmethod new_from_date_time(fps_n, fps_d, dt, flags, field_count)[source]¶
- Parameters:
fps_n (
int
) – Numerator of the frame ratefps_d (
int
) – Denominator of the frame ratedt (
GLib.DateTime
) –GLib.DateTime
to convertflags (
GstVideo.VideoTimeCodeFlags
) –GstVideo.VideoTimeCodeFlags
field_count (
int
) – Interlaced video field count
- Returns:
the
GstVideo.VideoTimeCode
representation of dt.- Return type:
The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.
This might return a completely invalid timecode, use
GstVideo.VideoTimeCode.new_from_date_time_full
() to ensure that you would getNone
instead in that case.New in version 1.12.
- classmethod new_from_date_time_full(fps_n, fps_d, dt, flags, field_count)[source]¶
- Parameters:
fps_n (
int
) – Numerator of the frame ratefps_d (
int
) – Denominator of the frame ratedt (
GLib.DateTime
) –GLib.DateTime
to convertflags (
GstVideo.VideoTimeCodeFlags
) –GstVideo.VideoTimeCodeFlags
field_count (
int
) – Interlaced video field count
- Returns:
the
GstVideo.VideoTimeCode
representation of dt, orNone
if no valid timecode could be created.- Return type:
The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.
New in version 1.16.
- classmethod new_from_string(tc_str)[source]¶
- Parameters:
tc_str (
str
) – The string that represents theGstVideo.VideoTimeCode
- Returns:
a new
GstVideo.VideoTimeCode
from the given string orNone
if the string could not be passed.- Return type:
New in version 1.12.
- add_frames(frames)[source]¶
- Parameters:
frames (
int
) – How many frames to add or subtract
Adds or subtracts frames amount of frames to self. tc needs to contain valid data, as verified by
GstVideo.VideoTimeCode.is_valid
().New in version 1.10.
- add_interval(tc_inter)[source]¶
- Parameters:
tc_inter (
GstVideo.VideoTimeCodeInterval
) – TheGstVideo.VideoTimeCodeInterval
to add to self. The interval must contain valid values, except that for drop-frame timecode, it may also contain timecodes which would normally be dropped. These are then corrected to the next reasonable timecode.- Returns:
A new
GstVideo.VideoTimeCode
with tc_inter added orNone
if the interval can’t be added.- Return type:
This makes a component-wise addition of tc_inter to self. For example, adding (“01:02:03:04”, “00:01:00:00”) will return “01:03:03:04”. When it comes to drop-frame timecodes, adding (“00:00:00;00”, “00:01:00:00”) will return “00:01:00;02” because of drop-frame oddities. However, adding (“00:09:00;02”, “00:01:00:00”) will return “00:10:00;00” because this time we can have an exact minute.
New in version 1.12.
- clear()[source]¶
Initializes self with empty/zero/
None
values and frees any memory it might currently use.New in version 1.10.
- compare(tc2)[source]¶
- Parameters:
tc2 (
GstVideo.VideoTimeCode
) – another validGstVideo.VideoTimeCode
- Returns:
1 if self is after tc2, -1 if self is before tc2, 0 otherwise.
- Return type:
Compares self and tc2. If both have latest daily jam information, it is taken into account. Otherwise, it is assumed that the daily jam of both self and tc2 was at the same time. Both time codes must be valid.
New in version 1.10.
- copy()[source]¶
- Returns:
a new
GstVideo.VideoTimeCode
with the same values as self.- Return type:
New in version 1.10.
- frames_since_daily_jam()[source]¶
- Returns:
how many frames have passed since the daily jam of self.
- Return type:
New in version 1.10.
- init(fps_n, fps_d, latest_daily_jam, flags, hours, minutes, seconds, frames, field_count)[source]¶
- Parameters:
fps_n (
int
) – Numerator of the frame ratefps_d (
int
) – Denominator of the frame ratelatest_daily_jam (
GLib.DateTime
orNone
) – The latest daily jam of theGstVideo.VideoTimeCode
flags (
GstVideo.VideoTimeCodeFlags
) –GstVideo.VideoTimeCodeFlags
hours (
int
) – the hours field ofGstVideo.VideoTimeCode
minutes (
int
) – the minutes field ofGstVideo.VideoTimeCode
seconds (
int
) – the seconds field ofGstVideo.VideoTimeCode
frames (
int
) – the frames field ofGstVideo.VideoTimeCode
field_count (
int
) – Interlaced video field count
field_count is 0 for progressive, 1 or 2 for interlaced. latest_daiy_jam reference is stolen from caller.
Initializes self with the given values. The values are not checked for being in a valid range. To see if your timecode actually has valid content, use
GstVideo.VideoTimeCode.is_valid
().New in version 1.10.
- init_from_date_time(fps_n, fps_d, dt, flags, field_count)[source]¶
- Parameters:
fps_n (
int
) – Numerator of the frame ratefps_d (
int
) – Denominator of the frame ratedt (
GLib.DateTime
) –GLib.DateTime
to convertflags (
GstVideo.VideoTimeCodeFlags
) –GstVideo.VideoTimeCodeFlags
field_count (
int
) – Interlaced video field count
The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.
Will assert on invalid parameters, use
GstVideo.VideoTimeCode.init_from_date_time_full
() for being able to handle invalid parameters.New in version 1.12.
- init_from_date_time_full(fps_n, fps_d, dt, flags, field_count)[source]¶
- Parameters:
fps_n (
int
) – Numerator of the frame ratefps_d (
int
) – Denominator of the frame ratedt (
GLib.DateTime
) –GLib.DateTime
to convertflags (
GstVideo.VideoTimeCodeFlags
) –GstVideo.VideoTimeCodeFlags
field_count (
int
) – Interlaced video field count
- Returns:
True
if self could be correctly initialized to a valid timecode- Return type:
The resulting config->latest_daily_jam is set to midnight, and timecode is set to the given time.
New in version 1.16.
- is_valid()[source]¶
- Returns:
whether self is a valid timecode (supported frame rate, hours/minutes/seconds/frames not overflowing)
- Return type:
New in version 1.10.
- nsec_since_daily_jam()[source]¶
- Returns:
how many nsec have passed since the daily jam of self.
- Return type:
New in version 1.10.
- to_date_time()[source]¶
- Returns:
the
GLib.DateTime
representation of self orNone
if self has no daily jam.- Return type:
The self.config->latest_daily_jam is required to be non-
None
.New in version 1.10.
- to_string()[source]¶
- Returns:
the SMPTE ST 2059-1:2015 string representation of self. That will take the form hh:mm:py:data::ss<GstVideo.VideoTimeCode.props.ss>
:ff
. The last separator (between seconds and frames) may vary:’;’ for drop-frame, non-interlaced content and for drop-frame interlaced field 2 ‘,’ for drop-frame interlaced field 1 ‘:’ for non-drop-frame, non-interlaced content and for non-drop-frame interlaced field 2 ‘.’ for non-drop-frame interlaced field 1
- Return type:
New in version 1.10.