sammoth / foo_mpv

mpv video player UI element for foobar2000
GNU General Public License v3.0
57 stars 2 forks source link

foo_mpv

mpv video player UI element for foobar2000.

Features

Configuration

The component is not a decoder, you will need to make sure foobar2000 can play the audio from whichever video files you want to play first. For anything not supported by default, you can install and configure the ffmpeg decoder wrapper component.

Note that the default keybindings are disabled. You can copy the ones you want back from here.

Some mpv options might intefere with the operation of the component. Good options to set would be things like video filters. The special profiles [video] and [albumart] are applied automatically when video is playing or album art is showing. Any other profiles will be available to apply at runtime using the context menu.

The mpv profile folder is set to <foobar profile>/mpv, so you can use paths relative to this in mpv.conf by using ~~ as normal, or place scripts in <foobar profile>/mpv/scripts.

Mouse input is passed to mpv except for the right mouse button which is reserved for the context menu, and keyboard input is passed to mpv when in popup or fullscreen modes. You can bind input in input.conf to foobar menu or context menu commands using the special script-messages foobar menu and foobar context. There are helpers for adding these in the preferences.

Scripting

There are two messages for communicating track information between mpv Lua scripts and foobar. It is possible to register a titleformatting string to be published for the currently displayed track video/artwork using the script-message:

foobar register-titleformat <unique id> <titleformatting script>.

Updates will then be sent whenever the displayed track changed, as:

foobar titleformat <unique id> <string>

This can be used to display or react to information about the current track in mpv.

There is an example of using this to customise the OSC in the source code. A love heart button is added to the OSC that turns pink when the current track has %loved% = 1. Clicking the button invokes a context menu entry for a Masstagger script which toggles the value of %loved% for the current file. By placing a customised OSC in <foobar profile>/mpv/scripts/osc.lua, the component will not load the built-in OSC file, so that you can use a customised OSC while still using the component's UI features for controlling it (eg. disabling it per-panel).

Issues

Some files will not synchronise well, if foobar and mpv have a different idea of what the timestamps are for the audio in a file, or sometimes if the audio starts at a different time to the video (it should be possible to improve this in future). If an mkv file (or something that can fit into one) doesn't seem to synchronize well, try remuxing with mkvmerge with the default settings. Some ffmpeg-muxed mkv files seem problematic in foobar. Files with split FLAC streams (which used to be allowed in older mkvmerge versions) also seem problematic.