nixers
mpc-like control interface for mpv - Printable Version
+- nixers (https://nixers.net)
+-- Forum: Development & Graphics (https://nixers.net/Forum-Development-Graphics)
+--- Forum: Programming On Unix (https://nixers.net/Forum-Programming-On-Unix)
+--- Thread: mpc-like control interface for mpv (/Thread-mpc-like-control-interface-for-mpv)


mpc-like control interface for mpv - Wildefyr - 12-01-2016

Been writing this for the past couple of days. Mostly works though there's several things I still need to do. Feedback wanted.


RE: mpc-like control interface for mpv - venam - 13-01-2016

I knew mplayer and mpv had socket interface to interact with but it's the first time I see them well used.

Great job, I'll test it as soon as I can.


RE: mpc-like control interface for mpv - neeasade - 13-01-2016

super cool I'm a fan.

edit: when home today my plan is to take this and combine it with the mpc portion of my panel to make the controls work for either/both depending on if mpv is running. hype


RE: mpc-like control interface for mpv - venam - 13-01-2016

Tested it.
It works great but you forgot to mention that mpv needs to be started with:
Code:
--input-unix-socket=/tmp/mpvsocket



RE: mpc-like control interface for mpv - neeasade - 13-01-2016

(13-01-2016, 12:36 PM)venam Wrote: Tested it.
It works great but you forgot to mention that mpv needs to be started with:
Code:
--input-unix-socket=/tmp/mpvsocket

Yeah, the link to this is in like the 5th line of the script, but it would have been nice to know from the README.


RE: mpc-like control interface for mpv - Wildefyr - 13-01-2016

My bad guys, I'll update it when I get home.


RE: mpc-like control interface for mpv - apk - 13-01-2016

*sniff* LEAVE. WILDEFYR. ALONE!


RE: mpc-like control interface for mpv - neeasade - 13-01-2016

(13-01-2016, 04:01 PM)dsplayer14 Wrote: *sniff* LEAVE. WILDEFYR. ALONE!


/bully adam


RE: mpc-like control interface for mpv - Wildefyr - 15-01-2016

Well the readme has been updated now and should be at a much better standard. Probably going to leave this as a 'stable' version for now seeing as I've implemented speed control properly now and cleaned a bit more of the code up. Feel free to send me pull requests for any of the stuff in the TODO section.


RE: mpc-like control interface for mpv - Wildefyr - 30-01-2016

You can now append files to the current playlist or start a new mpv instance altogether! You can also view the tracks in the playlist with another command.


RE: mpc-like control interface for mpv - Adrift - 21-02-2016

Finally got an excuse to try this with my new two monitor setup. That and I have issues with fixed (sticky) windows in 2bwm, so being able to control it without focusing it is great.

However I wanted to ask if it's at all doable to add a fast forward/rewind / jump to minutes feature? That's way more convenient than seconds for movies. I'm not sure if requests are a thing, but I thought I'd ask. Otherwise, it's quite nifty.


RE: mpc-like control interface for mpv - Wildefyr - 21-02-2016

Yeah I've been meaning to hack that out actually... Not sure how I'd do it for timestamps but I am looking to probably make it easier to jump through time a little bit easier.

EDIT: okay I've a basic phraser to jump through a track somewhat more easily, just append 's', 'm' or 'h' on the end of the number, like so:

Code:
mpvc -t 10m

I'm looking to implement a phraser to take absolute timestamps for the function "setTimeAbsolute".


RE: mpc-like control interface for mpv - Adrift - 21-02-2016

Just tried it, fantastic. Except it gave me an error.

Code:
sed: -e expression #1, char 71: unterminated `s' command



RE: mpc-like control interface for mpv - Wildefyr - 21-02-2016

Yeah I've had some issues with that hacky method of returning metadata about the track. Hard to diagnose remotely though. If you could run a shell trace for me and send it to me that'd be great.


RE: mpc-like control interface for mpv - Adrift - 21-02-2016

Okay, file is the nixers-workflow video, did set -x and strace, and here is all the output: https://paste.teknik.io/Raw/DQaXP


RE: mpc-like control interface for mpv - Wildefyr - 21-02-2016

Can you link me the exact file?


RE: mpc-like control interface for mpv - Adrift - 21-02-2016

I do believe I got it from here: http://lab.xero.nu/nixers-workflow.webm

Sorry about the delay, I'm failing at setting these monitors up.

EDIT: Until you asked that I didn't even think to try another file due to being preoccupied. It works on movies just fine. Great work.


RE: mpc-like control interface for mpv - Wildefyr - 23-02-2016

Can you give me your sed version along with your source (i.e. bsd sed, gnu sed, etc)? Adding the file didn't give me any error.


RE: mpc-like control interface for mpv - Adrift - 23-02-2016

Code:
sed (GNU sed) 4.2.2

The source files for sed?


RE: mpc-like control interface for mpv - Wildefyr - 23-02-2016

Well that's my sed version too. I can't reproduce this at all so I can't fix it :(


RE: mpc-like control interface for mpv - Adrift - 23-02-2016

Yeah, I re-downloaded the workflow video and it still did it. Don't worry about it, I'm sure I'm the only fucker with this problem -- I always get the weird bugs that only I have. It hasn't had any problems with any of the movies/shows I've watched since then.


RE: mpc-like control interface for mpv - Adrift - 20-04-2016

Still using this, it's great. I was wondering if it's possible to remove things from the playlist?


RE: mpc-like control interface for mpv - Wildefyr - 21-04-2016

Yes, there is a way! Using the -d or --delete option with the number of the track, or using the mpc compatibility layer with 'mpvc del $NUM'. There's no way to remove items based on what their filename is though for example.


RE: mpc-like control interface for mpv - Adrift - 21-04-2016

Awesome, I somehow missed that. Occasionally I accidentally add something twice, I'd rather just remove it then skip it.


RE: mpc-like control interface for mpv - Wildefyr - 21-04-2016

I actually just changed the GNU flags for this to '-r | --remove' and now use '-j | --track' and '-J | --tracknum' instead.