-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it more useable out of the box #1
Changes from 8 commits
79bb2ac
88068cd
12630a9
b9c12ab
b4f00e7
6c78a01
c122f6d
69ea75d
0c5ec81
d2157f9
9966251
321fa72
4ab673d
e8c1a98
1abeb14
a58e3e2
679905b
bc833db
ccf2bc8
4bac9ba
916b50c
97c23a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,83 @@ | ||
# Video Gestalt | ||
|
||
[![gestalt-Vespa-Scooter-Commercial ia mp4][1]][3] | ||
[![gestalt-Vespa-Scooter-Commercial ia mp4][1]][2] | ||
|
||
Presents a video in a summary form that shows the entire video at once as an array of moving video thumbnails. | ||
|
||
## Description | ||
|
||
Video Gestalt presents a condensed video array, showing the entire video at once as moving video thumbnails. | ||
|
||
The above is an example of the Video Gestalt for a 50-second commercial for Vesta scooters. (Click the Video Gestalt to see the original video.) | ||
|
||
As you can see, it is a looping video with moving thumbnails of the original video. In one second, you can see every frame of the original video at a glance, without any discontinuities as it loops. This is done by arranging that each thumbnail slides over exactly its width in one loop so that the next thumbnail takes over seamlessly. | ||
|
||
Hence, the video gestalts can be read in two ways: 1- an overall quick glance shows all the scenes of the entire video, 2- by focusing on one animated thumbnail, we can watch the entire video, by starting in the upper left corner, and following to the right, then descending one block lower and moving from right to left, then descending one block and moving left to right again, etc. | ||
|
||
A longer explanation is available in [this blog post](https://eamonn.org/video-gestalt-one-glance-overview-of-a-video). | ||
|
||
## Installation | ||
|
||
So far this has only been tested on Linux and Chrome OS, but it will likely work on MacOS too, and maybe even on Windows. | ||
So far this has been tested on Linux, Chrome OS and Windows, but it will likely work on MacOS too. | ||
|
||
The only file you need from this repo is `gestalt.py`. You can grab this however you want, and make it executable. For example, do the following from the command line: | ||
To install, simply use `pip`: | ||
|
||
```bash | ||
wget https://raw.githubusercontent.com/eobrain/videogestalt/main/gestalt.py | ||
chmod +x gestalt.py | ||
pip install --upgrade videogestalt | ||
``` | ||
|
||
If they are not already installed, you will need to install `python3` and the corresponding Python package manager `pip`. | ||
|
||
If they are not already installed, you will need to install `python3` and the corresponding Python package manager `pip` beforehand. | ||
|
||
On Linux and friends you might be able to do this like so: | ||
```bash | ||
sudo apt-get install python3 python3-pip | ||
``` | ||
|
||
You will need to install the `moviepy` Python library: | ||
## Usage | ||
|
||
An executable binary `videogestalt` is automatically installed in the local environment. | ||
|
||
The following examples assume you cloned the repository to get access to the `example` folder. | ||
|
||
To generate a video file: | ||
|
||
```bash | ||
videogestalt -i example/test.mp4 -o test-gestalt --video | ||
``` | ||
|
||
To generate an animated GIF (warning, output can be large): | ||
|
||
```bash | ||
pip install moviepy | ||
videogestalt -i example/test.mp4 -o test-gestalt --gif | ||
``` | ||
|
||
The application can also be used as a Python module: | ||
|
||
## Usage | ||
```python | ||
>>> from videogestalt import videogestalt as vg | ||
>>> vg.main('-i example/test.mp4 -o test-gestalt --gif') | ||
``` | ||
|
||
Put the `gestalt.py` in the same directory as an input video file `test.mp4`. | ||
## Building | ||
|
||
Generate a video file: | ||
The module can be built with PEP517 standard tools, such as `pypa/build`: | ||
|
||
```bash | ||
./gestalt.py -i test.mp4 -v | ||
python -sBm build . | ||
``` | ||
|
||
Generate an animated GIF (warning, can be large): | ||
It can also be installed in development/editable mode after cloning this git repository: | ||
|
||
```bash | ||
./gestalt.py -i test.mp4 -g | ||
pip install --upgrade -e . | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest adding the commands to run the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apart from the git cloning, this is the only command that should be needed. Now that I fixed the |
||
|
||
[1]: https://user-images.githubusercontent.com/179320/226146985-d67db97e-bcd6-4377-a1da-cc6020135d84.gif | ||
[3]: https://ia904607.us.archive.org/11/items/vespa-scooter-commercial/Vespa%20Scooter%20Commercial.mp4 | ||
## License | ||
|
||
Created by Eamonn O'Brien-Strain. | ||
|
||
Licensed under the Mozilla Public License 2.0 | ||
|
||
[1]: https://github.com/eobrain/videogestalt/master/resources/vespa-commercial-gestalt.gif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a particular reason for pulling the example GIF output into the repo? If not, I suggest leaving it in its original position in GitHib static images. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes usually when an image is meant to be included in the README and not just in the static website, I prefer to include them in the repository to be more future proof, as URLs of static sites may change or be down at any point in the future (it already happened in the past). There is also another pragmatic reason, it's because I don't know where the image is stored currently (I cannot find the source branch from which the image is pushed to GitHub pages?). |
||
[2]: https://ia904607.us.archive.org/11/items/vespa-scooter-commercial/Vespa%20Scooter%20Commercial.mp4 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
[build-system] | ||
# never uppercap requirements unless we have evidence it won't work https://iscinumpy.dev/post/bound-version-constraints/ | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] # beware if using setuptools: setup.py still gets executed, and even if pyproject.toml fields take precedence, if there is any code error in setup.py, building will fail! | ||
name = "videogestalt" | ||
version = "0.2.0" # see PEP 440 https://peps.python.org/pep-0440/#pre-releases and https://packaging.python.org/en/latest/guides/single-sourcing-package-version/ | ||
description = "Regular Expression Path Matcher - Easily batch manipulate folders and files trees with regular expression!" | ||
authors = [ | ||
{name = "Eamonn O'Brien-Strain"}, | ||
] | ||
maintainers = [ | ||
{name = "Eamonn O'Brien-Strain"}, | ||
] | ||
requires-python = ">=3.7" | ||
license = {text = "Mozilla Public License 2.0"} # { file = "LICENSE" } | ||
keywords = ["video", "gestalt", "movie", "summary", "summarization", "thumbnails"] | ||
classifiers = [ | ||
'Development Status :: 3 - Alpha', | ||
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)', | ||
'Environment :: Console', | ||
'Operating System :: POSIX :: Linux', | ||
'Operating System :: MacOS :: MacOS X', | ||
'Operating System :: Microsoft :: Windows', | ||
'Environment :: Console', | ||
'Intended Audience :: Developers', | ||
'Intended Audience :: End Users/Desktop', | ||
'Intended Audience :: Information Technology', | ||
'Intended Audience :: System Administrators', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: 3.9', | ||
'Programming Language :: Python :: 3.10', | ||
'Programming Language :: Python :: 3.11', | ||
'Programming Language :: Python :: 3.12', | ||
'Topic :: Multimedia :: Video', | ||
'Topic :: Multimedia :: Video :: Display', | ||
'Topic :: Software Development :: Libraries', | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
'Topic :: Utilities', | ||
] | ||
dependencies = [ | ||
"moviepy", | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/eobrain/videogestalt" | ||
Documentation = "https://github.com/eobrain/videogestalt/blob/master/README.md" | ||
"Source" = "https://github.com/eobrain/videogestalt" | ||
Tracker = "https://github.com/eobrain/videogestalt/issues" | ||
Download = "https://github.com/eobrain/videogestalt/releases" | ||
#Changelog = "https://url/changelog" | ||
|
||
[project.optional-dependencies] | ||
testmeta = [ # dependencies to test meta-data | ||
"build", | ||
"twine", | ||
"validate-pyproject", | ||
"rstcheck", | ||
] | ||
|
||
[project.readme] | ||
file = "README.md" | ||
content-type = "text/markdown" | ||
|
||
[project.scripts] | ||
videogestalt = "videogestalt.videogestalt:main" | ||
|
||
#[tool.setuptools] | ||
#package-dir = {"" = "src"} | ||
|
||
[tool.setuptools.packages.find] | ||
# IMPORTANT: systematically delete `src/<project.name>.egg-info` folder before rebuilding, otherwise the list of included files will not get updated (it's in `SOURCES.txt` file in this folder) | ||
where = ["src"] | ||
include = ["videogestalt*"] | ||
#namespaces = true # already the default | ||
|
||
[tool.setuptools.package-data] | ||
# Check the <mypkg>.egg-info/SOURCES.txt file generated after a `build` or `pip install` to check if the following files are correctly included in the sdist. | ||
# Check also the list of files included by default: https://packaging.python.org/en/latest/guides/using-manifest-in/ | ||
"*" = [ | ||
"LICENSE*", | ||
"README*", | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me (using Python 3.9.2 on Linux) this failed with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmmm I guess your pip version is not updated to the latest, as it should be fixed since pip versions of last year. Nevertheless, I have implemented a workaround now, please retry with my updated PR and let me know if this works :-)