Home

Awesome

mpv-osc

This is a fairly simple OSC server/listener for mpv. Pretty hacky to say the least.

Usage

mpv --script=mpv-osc.lua ~/Videos/awesome-video.mp4

Config

This script uses 5005 port by default but it's possible to overwrite this config:

--script-opts osc-port=50723

VJing

Ideally, you'd like to remove audio and on-screen stuff when playing with this:

mpv --volume=-1 \ # mute audio
    --osd-level=0 --no-osc \ # disable on-screen stuff
    --script=mpv-osc.lua \ # the actual script
    --script-opts osc-port=50723 \ # custom options
    ~/Videos/awesome-video.mp4 # our favourite vid

Addresses

Since I only needed a couple of mpv functions, just went for the basic stuff, such as:

Examples

In SCLang format:

m = NetAddr.new("127.0.0.1", 5005);

(
Pdef(\mpv,
  Pbind(
    \dur, 1,
    \position, Pxrand((10,10.1..90), inf).stutter(Pwhite(1,4)),
    \play, Pfunc{ |e| m.sendMsg("/position", e.position); }
  )
)
)
Pdef(\mpv).play
Pdef(\mpv).clear

Dependencies

LICENSE

See LICENSE