Skip to main content

Add chapters to video based on scene cuts

Project description

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] [-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

-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)

-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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chaptinator-0.4.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chaptinator-0.4-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file chaptinator-0.4.tar.gz.

File metadata

  • Download URL: chaptinator-0.4.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for chaptinator-0.4.tar.gz
Algorithm Hash digest
SHA256 ef0914dc4351ef374181ffaea12cf5acd9df248e9f8a11d2c997881b9033b256
MD5 700645449698c99e6ca91679a90c2ecb
BLAKE2b-256 f30613df3811a048edae623ab8c177123eb3494d7722f21238b0c088f9b7cdc6

See more details on using hashes here.

File details

Details for the file chaptinator-0.4-py3-none-any.whl.

File metadata

  • Download URL: chaptinator-0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for chaptinator-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3e042af08f05640d95e28251acee00cff9cdaff46a1e6a2f532ac1b250bff2fe
MD5 1b86e7d5fe842e7aa88eb96f5b45ced3
BLAKE2b-256 db1353eb24798ec983bc9523ef0d5b2c4015e5685f491ce1c072efb2b4744b11

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page