Giter Site home page Giter Site logo

chapsnap's Introduction

ChapSnap

Resync Chapters by snapping them to Scene Changes.

Usage

Usage: chapsnap [OPTIONS] VIDEO [CHAPTERS]

  Snap Chapters to Scene Changes.

  VIDEO       The video file to snap chapters to scene changes. All video formats are
              supported. You may alternatively provide a directory path to process
              video files in batch.
  [CHAPTERS]  Optional chapters file if you want to use chapters from a file
              rather than ones already muxed with the video.

Options:
  -t, --threshold FLOAT  Threshold on Scene Change probability scores. The
                         lower the value, the more unlikely the frame is to be
                         a Scene Change. Range: 0.0 (Impossible) - 1.0
                         (Definite).
  -o, --offset FLOAT     Offset to apply to each Chapter. A negative offset
                         may result in fewer Chapters.
  --trim INTEGER         Remove n Chapters from the start of the Video. A
                         negative value will remove n Chapters from the end of
                         the Video. Timestamps will be offset respectively.
  -nf, --no-forward      Do not try to resync Chapters forward in time.
  -nb, --no-backward     Do not try to resync Chapters backward in time.
  -k, --keyframes        Only sync to Scene Changes on Keyframes (I-frames).
  -0, --zero             Force the first chapter to be at `00:00:00.000`, even
                         after offsets and trims.
  -c, --chain            Chain sync adjustments from one Chapter to the next.
                         E.g., Chapter 1 had -2, so Chapter 2 will begin with
                         an offset of -2. Chapter 2 with -2 has a change of
                         -1, so Chapter 3 will begin with an offset of -3 and
                         so on.
  --overwrite            Apply new Chapters to the input video file in-place,
                         without making a duplicate.
  --help                 Show this message and exit.

Contributors

License

ยฉ 2023 rlaphoenix โ€” GNU General Public License, Version 3.0

chapsnap's People

Contributors

rlaphoenix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

har0ldfinch01

chapsnap's Issues

Fade-out then Fade-in is not detected as a Scene Change

The algorithm used is just a simple threshold on the scene change score calculated by FFmpeg.

Since a Fade-out doesn't wildly differ from its previous frame, the entire transition occurs without detection. Similarly, the Fade-in works out the same.

This is only a problem when a Fade-out is met with a Fade-in directly after. A Fade-out to then a jump-cut works fine. A jump-cut to a Fade-in also works fine.

The only fix I can think of is to remove the frames after the start of the transition, and before or on the end of the transition. This results in what looks to be a jump cut instead of a fade transition and the algorithm by FFmpeg with the threshold will pick it up as a Scene Change. However, doing so in an automated way is not such an easy task to pull off.

Analyzing takes quite long on UHD HEVC videos

Some way to speed up analyzing UHD HEVC videos would be nice. It's likely long simply due to the amount of time needed to decode and run scene detection on every frame.

On my end, it's taking 5-6 minutes per 22 minutes of content. That doesn't seem too bad but when you need to run this on 100s of files, that adds up quickly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.