Skip to content

Export scene change to # keyframe format v1 #534

Open

Description

@moi15moi

Problem/Use Case

Export the generated scene list to a file and import them to aegisub.

Solutions

Be able to export # keyframe format v1 file with the cli.
This is a old format that some tool, like aegisub, use to represent the scene detection.

Examples:

keyframe format v1 format is really simple.
The first 2 lines are always theses (you can technically set an fps, but it doesn't do anything. Most parser just skip the fps line):

# keyframe format v1
fps 0

After that, each line will contain the frame number where a scene change is detected.
Ex:

# keyframe format v1
fps 0
0
120
156
343

Activity

  1. added this to the 0.8 milestone on Jul 5, 2026
  2. Breakthrough commented on Jul 5, 2026

    @Breakthrough
    Owner

    Does this format work with VFR video / is it presentation time or actual frame number? Can certainly add this in a future version.

  3. moi15moi commented on Jul 6, 2026

    @moi15moi
    Author

    It is frame number, so yes, it work really well with vfr.

  4. MuhammadBilalKhan267 commented on Aug 10, 2026

    @MuhammadBilalKhan267
    Contributor

    I would like to work on this.

  5. MuhammadBilalKhan267 commented on Aug 12, 2026

    @MuhammadBilalKhan267
    Contributor

    I found one issue with VFR input while implementing this.

    Detection processes frames sequentially, but cuts retain timestamps rather than decoded frame ordinals. FrameTimecode.frame_num converts the timestamp using the average frame rate, which can produce incorrect frame numbers for VFR video.

    There are two possible approaches:

    1. Make a second pass with decode=False and map each cut timestamp to its actual zero-based frame ordinal. This is isolated, but requires reading the video twice and assumes the input can be replayed.
    2. Retain exact ordinals during the initial decode. This requires broader pipeline changes because buffered or calculated cuts must preserve their ordinals. Starting detection partway through a video with time --start also makes the absolute ordinal harder to determine.

    I can handle this in a follow-up. If either approach seems like a better fit for the project, feel free to let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions