1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-23 16:23:41 +00:00
bazarr/custom_libs/subzero/modification/mods/fps.py

27 lines
735 B
Python
Raw Normal View History

2018-10-31 16:08:29 +00:00
# coding=utf-8
2019-09-17 02:04:27 +00:00
from __future__ import absolute_import
2018-10-31 16:08:29 +00:00
import logging
from subzero.modification.mods import SubtitleModification
from subzero.modification import registry
logger = logging.getLogger(__name__)
class ChangeFPS(SubtitleModification):
identifier = "change_FPS"
description = "Change the FPS of the subtitle"
exclusive = True
advanced = True
modifies_whole_file = True
long_description = "Re-syncs the subtitle to the framerate of the current media file."
def modify(self, content, debug=False, parent=None, **kwargs):
fps_from = kwargs.get("from")
fps_to = kwargs.get("to")
parent.f.transform_framerate(float(fps_from), float(fps_to))
registry.register(ChangeFPS)