Git Product home page Git Product logo

mpv-gallery-view's Introduction

Playlist view and contact sheet scripts for mpv.

demo

Important

  • Make sure that the thumbnail directory exists for thumbnail generation to work.
  • The default directories are: ~/.cache/thumbnails/mpv-gallery on Unix, %APPDATA%\mpv\gallery-thumbs-dir on Windows. See Configuration for instructions on how to change it.

Installation

Copy the .lua files in scripts/ to your mpv scripts directory (See mpv's manual). Copy script-modules/gallery.lua to a directory called script-modules. This directory should be alongside the scripts directory in mpv's config path. Create the directories, if not already present.

If you are not interested in the playlist view or contact sheet, respectively remove the playlist-view.lua or contact-sheet.lua files.

You can make multiple copies (or symlinks) of gallery-thumbgen.lua to speed up thumbnail generation, they will register themselves automatically.

Usage

By default, the playlist-view can be opened with g and the contact-sheet with c.

In both you can navigate around using arrow keys or the mouse.

When you activate an item in the playlist-view, it will switch to that file. In the contact sheet, it will seek to that timestamp.

Configuration

Both scripts can be configured through the usual script-opts mechanism of mpv (see its manual). The files contact_sheet.conf and playlist_view.conf in this repository contain a detailed list of options.

Note that both scripts cannot be used at the same time, as they compete for the same resources. If you want to use both, I recommend using the following input.conf bindings:

g script-message contact-sheet-close; script-message playlist-view-toggle
c script-message playlist-view-close; script-message contact-sheet-toggle

To ensure that only one of the scripts is active at a time.

Playlist-view flagging

When the playlist-view is open, you can flag playlist entries (using SPACE by default). Flagged entries are indicated with a small frame. Then, when exiting mpv a text file will be created (default ./mpv_gallery_flagged) containing the filenames of the flagged entries, one per line.

Limitations

Yet another ad-hoc thumbnail library, which is not shared with any other program.

Management of the thumbnails is left to the user. In particular, stale thumbnails (whose file has been (re)moved) are not deleted by the script. This can be fixed by deleting thumbnails which have not been accessed since N days with such a snippet:

days=7
min=$((days * 60 * 24))
# run first without -delete to be sure
find ~/.cache/thumbnails/mpv-gallery/ -maxdepth 1 -type f -amin +$min -delete

Thumbnails are raw bgra, which is somewhat wasteful. With the default settings, a thumbnail uses 81KB (around 13k thumbnails in a GB).

Due to an mpv bug, the playlist-view or contact-sheet might not appear right away when toggled. Using the mpv config video-sync=display-resample or the script config pause_on_start=no indirectly solves the problem.

mpv-gallery-view's People

Contributors

occivink avatar microraptor avatar n-r-k avatar jgreco avatar alexherbo2 avatar djdv avatar ckath avatar defaultxr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.