home - plugins - tutorials - showcase - history - manual - design


mpv plugin

plugin for the mpv media player

mpv plugin can remote control mpv media player using the JSON-based IPC protocol to open and play videos, apply video filters, pause video, slow down playback speed and so on

example (open ~/video.mp4 and apply chromahold filter)

#!mpv

loadfile ${HOME}/video.mp4

vf set "chromahold:color=green:blend=0.08"

when this code is evaluated by pressing "CTRL + e" dublang sends it to mpv unix socket file by default located at /tmp/dublang-mpv.sock

to see a list of available commands go to the mpv documentation

the ffmpeg documentation can also be useful

mpv commands synthatic sugar

dublang plugin add synthatic sugar to mpv commands, specially for video filters, including also the ffmpeg filters supported by mpv

example

#!mpv

vf set "chromahold:color=green:blend=0.08"

the same code can also be expressed as

#!mpv

chromh $ col green $ ble 0.08

the function chromh and its arguments represented by $ col green and $ ble 0.08 are translated to vf set "chromahold:color=green:blend=0.08"

this feature is in a very experimental stage and might change in next versions

the list of available functions can be found at mpv plugin source code

mpv function: video

the Lua global variable config.path.mpv can be used to to tell mpv plugin where is the default path for videos

#!dublang

config.path.mpv = "/home/user/videos"

#!mpv

video "dune/01.mp4"

video command accept an optional argument to change the time position to start the playback as a relative percent number

(example loading a movie on relative time of 50%)

#!mpv

video "dune/01.mp4" 50%

mpv functions

mpv plugin video demonstration


home - plugins - tutorials - showcase - history - manual - design