SubTranslater/utils/utils.py
Djalim Simaila b792802e47 feat(data): add new subtitle files for episodes 1, 2, and 3 to enhance user experience and accessibility
feat(subtitles): add support for loading and displaying subtitles in the application
feat(video): implement video capture and frame navigation functionality
feat(ui): create main window UI for subtitle and video management
test: add unit tests for utility functions related to subtitle processing
chore: set up project structure with necessary files and directories for functionality

feat(ui_hardsubripper.py): add UI implementation for HardSubRipper application to provide a graphical interface for subtitle extraction and translation functionalities
2025-02-06 00:34:06 +01:00

15 lines
450 B
Python

import math
def milliseconds_to_framenumber(milliseconds,framerate)->int:
"""
This function takes a time in ms and a framerate then converts the time in ms
to a framenumber
:params:
:milliseconds (int) : the millisecond time to convert
:framerate (int) : the framerate of the video
:return (int): the framenumber correspondind to the millisecond
"""
return math.floor(milliseconds * framerate / 1000)