Giter Site home page Giter Site logo

bnfour / mpv-per-folder-tracks Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 84 KB

A little script for mpv to set preferred audio and subtitles for a folder of video files at once

License: MIT License

Lua 100.00%
audio-tracks automation mpv-script subtitle-tracks

mpv-per-folder-tracks's Introduction

mpv-per-folder-tracks

A little script for the mpv to set preferred audio and subtitles for a folder of video files at once.

Installation

Drop per-folder-tracks.lua into your scripts folder.

Usage

Setting the tracks settings

Press y (default, configurable) to write current audio and subtitles settings to a file .mpv (default, configurable) located in the folder with the currently playing video.
If you wish to change these settings, these are set at the top of the script -- the very first assignment statements.

Applying the tracks settings

If the file is present, previously set tracks will be restored for any video file from the same folder, if these exists. Please note that matching is done only by number as it appears in the player UI, not by track name, language, or anything else.

Explanation and demo

Let's suppose that for some reason there is a folder, where several video files are stored. These files all have multiple audio and subtitle tracks, with same languages having same track IDs.
Let's suppose that we want to play these files with non-default audio and subtitle tracks. With this handy script, you can open one of these files, change the tracks once, hit y (default) to save configuration. You can enjoy the video files without ever having to switch "Signs&Songs" to "Full" again (for this folder).

Before After configuring once for the entire folder
meh now we're talking
not pictured: dub not pictured: glorious original audio

The original video files are not modified in any way. To remove track preselection, simply remove the file created by the script.

Limitations

This is a quick and dirty script to automate my own tedious clicking, so be aware of the following:

  • It is only tested on local files on GNU/Linux.
    (I don't know whether or not will it work with other video types and/or operating systems.)
  • It only provides a way to set audio and/or subtitle tracks with little to none error proofing.
    (It is not a tool to store any other setting for the player. The filename may be misleading, but i couldn't come up with a better one. See script's comments for some of the shortcomings.)

Basically, works on my machine. Have fun.

License

MIT

mpv-per-folder-tracks's People

Contributors

bnfour 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.