Coder Social home page Coder Social logo

ekut-es / chaptinator Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 21 KB

Add chapters on scene changes to videos (e.g. slide changes in presentations)

Home Page: https://pypi.org/project/chaptinator/

License: The Unlicense

Python 100.00%
ffmpeg video slideshow powerpoint chapters

chaptinator's Introduction

chaptinator

Add chapters on scene changes to videos (e.g. slide changes in presentations)

Install

chaptinator requires ffmpeg to be installed on your system and for it to be in PATH. Follow the instructions on https://ffmpeg.org/ and make sure the commands ffmpeg and ffprobe are available in your favorite shell (bash, zsh, Powershell, ...).

Then install this package via pip. For a global installation use

sudo pip install chaptinator

and for a user-local installation use

pip install --user chaptinator

Usage

chaptinator VIDEO [-t TITLE] [-a AUTHOR] [-c CHANGE_THRESH] [-s] [-r] [-v] [-o] [-d] [-m METADATA_FILE]

-t TITLE sets the title in the metadata (default: filename)

-a ARTIST sets the artist in the metadata

-c CHANGE "value between 0 and 1 to indicate a new scene; a low value reflects a low probability for the current frame to introduce a new scene, while a higher value means the current frame is more likely to be one" -- https://ffmpeg.org/ffmpeg-filters.html#select_002c-aselect

-s scales the tagged result video to a height 720 while keeping the aspect ratio

-r reduces the framerate to 5fps, which is optimal to save bandwidth when powerpoint slides are the sole video content. Lower values cause problems with some browser video players

-o activates the ffmpeg tune 'stillimage' that lowers the deblocking filter, optimizing for still images like slides

-v converts the audio to MP3 with VBR (Variable BitRate) and a quality setting of 8, which is optimal for speech with relatively long segments of silence. (Lame is compiled into the standard ffmpeg library while the Frauenhofer AAC, which supports VBR, is not)

-d downmixes both audio channels into a single mono audio channel

-m METADATA_FILE disables the cut detection and instead uses the provided metadata file. This file has to have the structure described in https://ffmpeg.org/ffmpeg-formats.html#Metadata-1

Example

# increase cut detection threshold to 0.4, scale the video and reduce framerate
chaptinator foo.mp4 -t "Video Title" -a "Author Name" -c 0.4 -s -r

# read cuts from metadata file
chaptinator foo.mp4 -m metadata.txt

Use Cases

chaptinator could be used to add chapters to presentation slides that were recorded in PowerPoint and exported as video.

But of course it works with any video file that has cuts in it, just adjust the -c parameter to your preference.

chaptinator's People

Contributors

alexvonb avatar mikuhn avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.