Skip to main content

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

slopping_and_ffmpeg.webm

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


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

Uploaded Source

Built Distribution

slopping-1.0.0-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

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