Skip to content

Commit

Permalink
[time_type] Use the same interval as in the documentation proof
Browse files Browse the repository at this point in the history
  • Loading branch information
moi15moi committed Jan 2, 2025
1 parent 25de23c commit 773f306
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions video_timestamps/time_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class TimeType(Enum):
"""
Represents different types of time intervals for video frames in a player.
When working with a video that has a frame rate of 24000/1001 fps and using the RoundingMethod.ROUND,
When working with a video that has a frame rate of 24000/1001 fps, using the RoundingMethod.ROUND and with the Timescale 1000,
the first 4 frames will start at the following times in a video player:
- Frame 0: 0 ms
- Frame 1: 42 ms
Expand All @@ -17,42 +17,45 @@ class TimeType(Enum):
1. EXACT:
Corresponds to the precise frame time in the video player.
Each frame has an interval: [Current_frame_time_ms, Next_frame_time_ms - 1]
Each frame has an interval: [Current_frame_time, Next_frame_time[
Example:
- fps = 24000/1001
- rounding_method = RoundingMethod.ROUND
- time_scale = 1000
Frame intervals:
- Frame 0: [0, 41] ms
- Frame 1: [42, 82] ms
- Frame 2: [83, 124] ms
- Frame 0: [0, 42[ ms
- Frame 1: [42, 83[ ms
- Frame 2: [83, 125[ ms
2. START:
Corresponds to the start time of the subtitle.
Each frame has an interval: [Previous_frame_time_ms + 1, Current_frame_time_ms]
Each frame has an interval: ]Previous_frame_time, Current_frame_time]
Example:
- fps = 24000/1001
- rounding_method = RoundingMethod.ROUND
- time_scale = 1000
Frame intervals:
- Frame 0: 0 ms
- Frame 1: [1, 42] ms
- Frame 2: [43, 83] ms
- Frame 1: ]0, 42] ms
- Frame 2: ]42, 83] ms
3. END:
Corresponds to the end time of the subtitle.
Each frame has an interval: [Current_frame_time_ms + 1, Next_frame_time_ms]
Each frame has an interval: ]Current_frame_time, Next_frame_time]
Example:
- fps = 24000/1001
- rounding_method = RoundingMethod.ROUND
- time_scale = 1000
Frame intervals:
- Frame 0: [1, 42] ms
- Frame 1: [43, 83] ms
- Frame 2: [84, 125] ms
- Frame 0: ]0, 42] ms
- Frame 1: ]42, 83] ms
- Frame 2: ]83, 125] ms
"""

START = "START"
Expand Down

0 comments on commit 773f306

Please sign in to comment.