All Projects → Ashyni → mpv-scripts

Ashyni / mpv-scripts

Licence: MIT license
dynamic-crop.lua script for mpv player/lib.

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to mpv-scripts

Tocropviewcontroller
A view controller for iOS that allows users to crop portions of UIImage objects
Stars: ✭ 4,210 (+9690.7%)
Mutual labels:  crop, cropping
mpv crop script
A Lua script to take cropped screenshots in mpv, sans external dependencies
Stars: ✭ 77 (+79.07%)
Mutual labels:  mpv, cropping
React Native Image Crop Picker
iOS/Android image picker with support for camera, video, configurable compression, multiple images and cropping
Stars: ✭ 5,261 (+12134.88%)
Mutual labels:  crop, cropping
Prynttrimmerview
A set of tools to trim, crop and select frames inside a video
Stars: ✭ 553 (+1186.05%)
Mutual labels:  crop, cropping
Rskimagecropper
An image cropper / photo cropper for iOS like in the Contacts app with support for landscape orientation.
Stars: ✭ 2,371 (+5413.95%)
Mutual labels:  crop, cropping
Mantis
A photo cropping tool which mimics Photo.app written by Swift.
Stars: ✭ 270 (+527.91%)
Mutual labels:  crop, cropping
Alloycrop
The best and tiny size mobile cropping component - 做最好且最小的移动裁剪组件
Stars: ✭ 907 (+2009.3%)
Mutual labels:  crop, cropping
react-native-avatar-crop
Highly customisable <Crop /> component for React Native < 💅 >
Stars: ✭ 47 (+9.3%)
Mutual labels:  crop, cropping
Pixelsdk
The modern photo and video editor for your iPhone / iPad app. A fully customizable image & video editing iOS Swift framework.
Stars: ✭ 192 (+346.51%)
Mutual labels:  crop, cropping
Svelte Easy Crop
A Svelte component to crop images with easy interactions
Stars: ✭ 80 (+86.05%)
Mutual labels:  crop, cropping
React Easy Crop
A React component to crop images/videos with easy interactions
Stars: ✭ 1,093 (+2441.86%)
Mutual labels:  crop, cropping
Android Imagecropview
android image crop library
Stars: ✭ 225 (+423.26%)
Mutual labels:  crop, cropping
Igrphototweaks
Drag, Rotate, Scale and Crop
Stars: ✭ 212 (+393.02%)
Mutual labels:  crop, cropping
Mpv Scripts
Various scripts for mpv
Stars: ✭ 164 (+281.4%)
Mutual labels:  mpv, crop
tuijam
A fancy TUI client for Google Play Music
Stars: ✭ 119 (+176.74%)
Mutual labels:  mpv
Tubefeeder
A Youtube, Lbry and Peertube client made for the Pinephone
Stars: ✭ 88 (+104.65%)
Mutual labels:  mpv
mpv-search-page
An in-window search page for mpv player
Stars: ✭ 32 (-25.58%)
Mutual labels:  mpv
mpv-winbuild
Use Github Action to build mpv for Windows with latest commit.
Stars: ✭ 78 (+81.4%)
Mutual labels:  mpv
adl
🍿 anime-downloader + trackma wrapper
Stars: ✭ 91 (+111.63%)
Mutual labels:  mpv
bShaders
Video playback Effects/Filters (DirectX .hlsl pixel shaders, mpv .hook)
Stars: ✭ 29 (-32.56%)
Mutual labels:  mpv

dynamic-crop.lua

Script to "cropping" dynamically, hard-coded black bars detected with lavfi-cropdetect filter for Ultra Wide Screen or any screen (Smartphone/Tablet).

Status

It's now really stable, but can probably be improved to handle more case.

Usage

Save dynamic-crop.lua in ~/.config/.mpv/scripts/ (Linux/macOS) or %AppData%\mpv\scripts\ (Windows).

Or edit your mpv.conf file to add script=<custom path to the script>, use absolute path and don't add it if you already put it in directory scripts:

## Example
# Linux/macOS:
script=/home/<username>/<any custom path you choose>/dynamic-crop.lua
# Windows:
script=C:\Users\<username>\<any custom path you choose>\dynamic-crop.lua
# Android mpv-android:
script=/storage/emulated/0/<any custom path you choose>/dynamic-crop.lua

Features

  • 4 modes available: 0 disable, 1 on-demand, 2 one-shot, 3 dynamic-manual, 4 dynamic-auto.
  • The new metadata are validated with a known list of aspect ratio that allows a faster timer (option new_known_ratio_timer) then without it, must be a longer timing to avoid unwanted cropping (option new_fallback_timer).
  • Correction of random metadata to an already trusted one, this mostly help to get a fast aspect ratio change with dark/ambiguous scene.
  • Support asymmetric offset (Re-center video).
  • Auto adjust black threshold (cropdetect=limit, max is define by the option detect_limit).
  • Ability to prevent aspect ratio change during a certain time (option prevent_change_timer and prevent_change_mode).
  • Allows the segmentation of normally continuous data required to approve a new metadata (option segmentation).
  • Handle seeking/loading and any change of speed handled by MPV.

Shortcut

SHIFT+C do:

The first press maintains the cropping and disables the script, a second pressure eliminates the cropping and a third pressure is necessary to restart the script.

  • Mode = 1-2, single cropping on demand, stays active until a valid cropping is apply.
  • Mode = 3-4, enable / disable continuous cropping.

To-Do

  • Improve Documentation.
  • Improve the stability of the automatic limit, to reduce the impact caused by the insertion of the crop_detect filter.
  • Rework buffer to split fallback/offset validation and get more flexibility to turn off different timers.
  • Find a way to work on data ahead to get perfect cropping timing (the dream).

Troubleshooting

To collect the log, add to mpv.conf, log-file=<any path you can find easily>

If the script doesn't work, make sure mpv is build with the libavfilter crop and cropdetect by starting mpv with ./mpv --vf=help or by adding at the #1 line in mpv.conf vf=help and check the log for Available libavfilter filters:.

Also make sure mpv option hwdec= is no(default) or any *-copy (doc), otherwise the filters will not work.

Performance issue with mpv client:
mpv.conf: Try different value for gpu-api= (doc).
Script settings: Increase option detect_skip = 6 or 12, check built-in doc.

Performance issue with Jellyfin Media Player/Qt client:
JMP settings: Try with UseOpenGL.
Script settings: Increase option detect_skip = 6 or 12, check built-in doc.

Download on phone

Use the Desktop mode with a navigator on this page to access the button Code > Download Zip.
Or transfer it from a computer or any other device.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].