pysubs2 icon indicating copy to clipboard operation
pysubs2 copied to clipboard

Error: Framerate must be specified when writing MicroDVD.

Open tin2tin opened this issue 1 year ago • 1 comments

How can the framerate be set when this line results in the mentioned error? subs.save(file_name, format_="microdvd", fps=24)

tin2tin avatar Mar 14 '23 12:03 tin2tin

@tin2tin Can you describe the problem in more detail? I don't see what the issue is:

from pysubs2 import SSAFile, SSAEvent, make_time

subs = SSAFile()
subs.append(SSAEvent(
    start=make_time(s=0),
    end=make_time(s=10),
    text="First subtitle"
))
subs.append(SSAEvent(
    start=make_time(s=10),
    end=make_time(s=20),
    text="Second subtitle"
))

subs.save("test.sub", format_="microdvd", fps=24)

Results in file:

{0}{0}24
{0}{240}First subtitle
{240}{480}Second subtitle

tkarabela avatar Apr 02 '23 13:04 tkarabela