# Mementoizer
A python library to [Memento-ize](https://en.wikipedia.org/wiki/Memento_(film)) videos.
Meaning, cut the video up into scenes, pass the first half through a black-and-white filter, and interleave them.
Created for NaMoGenMo 2022. For an example, see:
https://www.youtube.com/watch?v=vkgGLhG3ccI
The original film for comparison can be viewed here:
https://en.wikipedia.org/wiki/File:The_Memphis_Belle_-_A_Story_of_a_Flying_Fortress.webm
## Installation
Mementoizer can be installed from PyPI:
`pip install mementoizer`
## Usage
Command-line usage:
`mementoize <video-filename>`
Programmatic usage:
```
from mementoizer import mementoize
mementoize(video_filename, ...)
```
### Options
`--skip-start` Number of seconds to ignore for cutting purposes at the beginning of the video file. For example, skipping intro credits. Default: 0
`--skip-end` Number of seconds to ignore for cutting purposes at the end of the video file. For example, skipping end credits. Default: 0
`--min-scene-length` Minimum number of seconds to count as a scene. If a cut is detected less than this many seconds after a previous one, it is disregarded. Default: 120 seconds
`--threshold` Parameter for tuning cut detection. Must be a float between 0 and 1. Typical values for normal shot detection are 0.4-0.6. Since we are trying to detect _scene_ boundaries rather than plain shots, it's set a little higher by default. Default: 0.7
`--overlap` Number of seconds to overlap between clips (chronologically). You will see this many seconds repeated to connect the previous scene to the one you are watching now. Default: 4
`--cuts` Manually specify cut times, in seconds after the start of the video. If this is provided, cut detection is skipped. `--skip-start`, `--skip-end`, and `--min-scene-length` are still applied. Values should be comma-separated integers.
NOTE: the resulting video will start at the first timestamp you provide. So you must start the list with `0` if you don't want to skip the first scene.
`--verbose` Print out the cut times detected (or supplied if `--cuts` is specified).
`--dry-run` Print detected cut timstamps and exit. Do not write or modify any files.
Raw data
{
"_id": null,
"home_page": "https://github.com/ryanfox/mementoizer",
"name": "mementoizer",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8, <4",
"maintainer_email": "",
"keywords": "video,image processing,computer vision",
"author": "Ryan Fox",
"author_email": "ryan@foxrow.com",
"download_url": "https://files.pythonhosted.org/packages/c7/38/b9f3eb8a2c45ede4031d3caf26a61250fa42f80b54bb959db21d94f7dfb7/mementoizer-0.0.3.tar.gz",
"platform": null,
"description": "# Mementoizer\n\nA python library to [Memento-ize](https://en.wikipedia.org/wiki/Memento_(film)) videos.\n\nMeaning, cut the video up into scenes, pass the first half through a black-and-white filter, and interleave them.\n\nCreated for NaMoGenMo 2022. For an example, see:\nhttps://www.youtube.com/watch?v=vkgGLhG3ccI\n\n\nThe original film for comparison can be viewed here:\nhttps://en.wikipedia.org/wiki/File:The_Memphis_Belle_-_A_Story_of_a_Flying_Fortress.webm\n\n## Installation\nMementoizer can be installed from PyPI:\n\n`pip install mementoizer`\n\n## Usage\n\nCommand-line usage:\n`mementoize <video-filename>`\n\nProgrammatic usage:\n```\nfrom mementoizer import mementoize\n\nmementoize(video_filename, ...)\n```\n\n### Options\n\n`--skip-start` Number of seconds to ignore for cutting purposes at the beginning of the video file. For example, skipping intro credits. Default: 0\n\n`--skip-end` Number of seconds to ignore for cutting purposes at the end of the video file. For example, skipping end credits. Default: 0\n\n`--min-scene-length` Minimum number of seconds to count as a scene. If a cut is detected less than this many seconds after a previous one, it is disregarded. Default: 120 seconds\n\n`--threshold` Parameter for tuning cut detection. Must be a float between 0 and 1. Typical values for normal shot detection are 0.4-0.6. Since we are trying to detect _scene_ boundaries rather than plain shots, it's set a little higher by default. Default: 0.7\n\n`--overlap` Number of seconds to overlap between clips (chronologically). You will see this many seconds repeated to connect the previous scene to the one you are watching now. Default: 4\n\n`--cuts` Manually specify cut times, in seconds after the start of the video. If this is provided, cut detection is skipped. `--skip-start`, `--skip-end`, and `--min-scene-length` are still applied. Values should be comma-separated integers.\nNOTE: the resulting video will start at the first timestamp you provide. So you must start the list with `0` if you don't want to skip the first scene.\n\n`--verbose` Print out the cut times detected (or supplied if `--cuts` is specified).\n\n`--dry-run` Print detected cut timstamps and exit. Do not write or modify any files.\n",
"bugtrack_url": null,
"license": "",
"summary": "Memento-ize a video",
"version": "0.0.3",
"split_keywords": [
"video",
"image processing",
"computer vision"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "defe55e3acdca2e79a50507e0d81ad9e",
"sha256": "337726205478286e39a5b34e434089f8a877feef566e0a674dc3d300ff6ae33b"
},
"downloads": -1,
"filename": "mementoizer-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "defe55e3acdca2e79a50507e0d81ad9e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8, <4",
"size": 3538,
"upload_time": "2022-12-21T23:59:32",
"upload_time_iso_8601": "2022-12-21T23:59:32.683449Z",
"url": "https://files.pythonhosted.org/packages/d8/48/cc3e7a9848e2edb012f694ff1619bd0337906f4712fc0b9fc65e7b5dc0eb/mementoizer-0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "a78b5522f07eeab8103fbca11fb8468f",
"sha256": "2b2d7453614c3557d5260f040f39e63997b6666963f37caf50d214a2082e079f"
},
"downloads": -1,
"filename": "mementoizer-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "a78b5522f07eeab8103fbca11fb8468f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8, <4",
"size": 3466,
"upload_time": "2022-12-21T23:59:34",
"upload_time_iso_8601": "2022-12-21T23:59:34.485671Z",
"url": "https://files.pythonhosted.org/packages/c7/38/b9f3eb8a2c45ede4031d3caf26a61250fa42f80b54bb959db21d94f7dfb7/mementoizer-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-21 23:59:34",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "ryanfox",
"github_project": "mementoizer",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "mementoizer"
}