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
15 lines
450 B
Python
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)
|
|
|