Script to feed cropping coordinates to ffmpeg (or a PIL.Image crop)
Project description
slopping
A script to make cropping easy when ffmpeg'ing. Needs slop, xdotool, and xwininfo.
Usage
$ ffmpeg -i input -vf crop=$(slopping) output
The window we are hovering with the mouse needs to be of the same size (w, h) of the video to extract the correct values.
To generate PIL.Image cropping coordinates, pass 'pil' as argument when executing the script:
$ slopping pil
Can also be imported as a module to query the coordinates:
[ins] In [1]: import slopping
[ins] In [2]: ffmpeg_crop = slopping.crop()
[nav] In [3]: pil_crop = slopping.crop('pil')
[ins] In [4]: ffmpeg_crop
Out[4]: (244, 210, 128, 228)
[ins] In [5]: pil_crop
Out[5]: (309, 367, 554, 484)
Installation
$ pip install slopping
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
slopping-1.0.0.tar.gz
(2.9 kB
view details)
Built Distribution
File details
Details for the file slopping-1.0.0.tar.gz
.
File metadata
- Download URL: slopping-1.0.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4abced1ea6797871dde6ea224cff396d236e2484d69e9e8ebf60f7b03b7a2d1 |
|
MD5 | 0bae036902c9c10aa493493f7e22cebf |
|
BLAKE2b-256 | 1a671d97511743261f37d15160b00bff6d6f086bc9eeba70e3d2c47d907f4b63 |
File details
Details for the file slopping-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: slopping-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | adbce3dafbdbc989a2fa5ff5ceb168fa4af30037f0688ed57ff6fd917681aae2 |
|
MD5 | 64f09694f4e8773a81e49d525630a139 |
|
BLAKE2b-256 | dae42ebd99e4f3bddcc18b1fe9cd0b58363fcd179f39ae79e8abd131c0247734 |