aeidon.agents.PositionAgent

Source: aeidon/agents/position.py

Anchestors: aeidon.delegate.Delegate, builtins.object

class aeidon.agents.PositionAgent
Manipulating times and frames.

Methods

PositionAgent.adjust_durations(indices=None, speed=None, lengthen=False, shorten=False, minimum=None, maximum=None, gap=None, register=-1)

Lengthen or shorten durations by changing end positions.

indices can be None to process all subtitles. speed is reading speed in characters per second. lengthen is True to increase durations to match reading speed. shorten is True to decrease durations to match reading speed. maximum is the greatest allowed duration in seconds. minimum is the smallest allowed duration in seconds. gap is seconds to be left between consecutive subtitles. Using a gap of at least zero is always a good idea if overlapping is not desired. Return changed indices.

PositionAgent.convert_framerate(indices, framerate_in, framerate_out, register=-1)

Set the value of framerate and convert subtitles to it.

indices can be None to process all subtitles.

PositionAgent.set_framerate(framerate, register=-1)

Set the value of framerate.

PositionAgent.shift_positions(indices, value, register=-1)

Make subtitles appear earlier or later.

indices can be None to process all subtitles.

PositionAgent.transform_positions(indices, p1, p2, register=-1)

Change positions by a linear two-point correction.

indices can be None to process all subtitles. p1 and p2 should be tuples of index, position.