y5gfunc.source.timecodes¶
timecodes
¶
Functions:
| Name | Description |
|---|---|
get_frame_timestamp |
Get the timestamp of a frame in a video clip. |
clip_to_timecodes |
Generate timecodes for a video clip. |
get_frame_timestamp
¶
get_frame_timestamp(frame_num: int, clip: VideoNode, precision: Literal['second', 'millisecond', 'microsecond', 'nanosecond'] = 'millisecond', timecodes_v2_file: Optional[str] = None) -> str
Get the timestamp of a frame in a video clip.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
The frame number to get the timestamp for. |
required |
|
VideoNode
|
The video clip to get the timestamp for. |
required |
|
Literal['second', 'millisecond', 'microsecond', 'nanosecond']
|
The precision of the timestamp. |
'millisecond'
|
|
Optional[str]
|
The optional path to the timecodes file. If provided, the timestamp will be read from the file. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
The timestamp of the frame. |
Source code in y5gfunc/source/timecodes.py
clip_to_timecodes
cached
¶
Generate timecodes for a video clip.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VideoNode
|
The video clip to generate timecodes for. |
required |
|
Optional[str]
|
The optional path to the timecodes file. If provided, the timecodes will be written to the file. |
None
|
Returns:
| Type | Description |
|---|---|
deque[float]
|
A deque of timecodes. |