mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.39k stars 2.91k forks source link

Customizing the TUI cplayer #10011

Closed LamprosPitsillos closed 2 years ago

LamprosPitsillos commented 2 years ago

Is there a way for me to customize , make the TUI prettier ?

❯ mpv --input-ipc-server=/tmp/mpvsocket . --no-vid --msg-module --term-title=' Playing: ${filename} '              
      file: This is a directory - adding to playlist.
   cplayer: 
   cplayer: Playing: ./******.opus
   cplayer:      Video --vid=1 [P] (png 1280x720 1.000fps)
   cplayer:  (+) Audio --aid=1 --alang=eng (opus 2ch 48000Hz)
   cplayer: AO: [pulse] 48000Hz stereo 2ch float
statusline: A: 00:02:41 / 00:05:16 (51%)

I have read the manual but only found small changes/additions can be made. If such a thing doesnt exist , i would later open a feature request, a nice TUI would be a great small addition to mpv.

cloud11665 commented 2 years ago

A TUI would require additional dependency on a ncurses, so I don't think I will happen anytime soon given the dislike for anything terminal related by the maintainers.

Also, ncurses support was "dropped" back in 2014: https://github.com/mpv-player/mpv/commit/7593706af0c32f67a6caa9d4bc772ec3ffb2d4d2

LamprosPitsillos commented 2 years ago

I never mentioned ncurses, although it would be nice, but as i understand is not worth implementing or maintaining, which is understandable.

Would i be able to implement something with any of the provided libs? Maybe in lua or python? I know it's off the scope of the question but it would be greatly appreciated.

cloud11665 commented 2 years ago

I'm fairly certain that it'd be "doable" using a C plugin. First of all, you would have to dissable all terminal output --term-osd=no --msg-level=no and then initialize ncurses from the plugin and get/set information using the plugin api.

gmt4 commented 1 year ago

Shameless plug. I've scratched the itch, by building a minimal tui at https://github.com/gmt4/mpvc