Timestamp¶
- class pymkv.Timestamp(timestamp: str | int | Timestamp = None, hh: int | None = None, mm: int | None = None, ss: int | None = None, nn: int | None = None, form: str | None = 'MM:SS')¶
- extract(timestamp: str | int) None ¶
Extracts time info from a timestamp.
- timestamp (str, int):
A str of a timestamp acceptable to mkvmerge or an int representing seconds. The timing info will be extracted from this parameter.
- splitting_timestamp(timestamp: str) None ¶
This method splits the given timestamp string into hours, minutes, seconds, and nanoseconds. The timestamp string should be in the format “HH:MM:SS.NNNNNNNNN”, where HH represents hours, MM represents minutes, SS represents seconds, and NNNNNNNNN represents nanoseconds.
- Parameters:
timestamp (str) – The timestamp string to be split.
- Return type:
None
Example
>>> obj.splitting_timestamp("12:34:56.789012345") # Assuming self._hh, self._mm, self._ss, and self._nn are all None initially The hours (self.hh) will be set to 12. The minutes (self.mm) will be set to 34. The seconds (self.ss) will be set to 56. The nanoseconds (self.nn) will be set to 789012345.
- property ts: str¶
Generates the timestamp specified in the object.
- static verify(timestamp: str) bool ¶
Verify a timestamp has the proper form to be used in mkvmerge.
- timestamp (str):
The timestamp to be verified.