mpc-like control interface for mpv - Programming On Unix

Users browsing this thread: 1 Guest(s)
Wildefyr
Long time nixers
Been writing this for the past couple of days. Mostly works though there's several things I still need to do. Feedback wanted.
venam
Administrators
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.
neeasade
Grey Hair Nixers
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
venam
Administrators
Tested it.
It works great but you forgot to mention that mpv needs to be started with:
Code:
--input-unix-socket=/tmp/mpvsocket
neeasade
Grey Hair Nixers
(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.
Wildefyr
Long time nixers
My bad guys, I'll update it when I get home.
apk
Long time nixers
*sniff* LEAVE. WILDEFYR. ALONE!
neeasade
Grey Hair Nixers
(13-01-2016, 04:01 PM)dsplayer14 Wrote: *sniff* LEAVE. WILDEFYR. ALONE!


/bully adam
Wildefyr
Long time nixers
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.
Wildefyr
Long time nixers
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.
Adrift
Members
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.
Wildefyr
Long time nixers
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".
Adrift
Members
Just tried it, fantastic. Except it gave me an error.

Code:
sed: -e expression #1, char 71: unterminated `s' command
Wildefyr
Long time nixers
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.
Adrift
Members
Okay, file is the nixers-workflow video, did set -x and strace, and here is all the output: https://paste.teknik.io/Raw/DQaXP
Wildefyr
Long time nixers
Can you link me the exact file?
Adrift
Members
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.
Wildefyr
Long time nixers
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.
Adrift
Members
Code:
sed (GNU sed) 4.2.2

The source files for sed?
Wildefyr
Long time nixers
Well that's my sed version too. I can't reproduce this at all so I can't fix it :(
Adrift
Members
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.
Adrift
Members
Still using this, it's great. I was wondering if it's possible to remove things from the playlist?
Wildefyr
Long time nixers
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.
Adrift
Members
Awesome, I somehow missed that. Occasionally I accidentally add something twice, I'd rather just remove it then skip it.
Wildefyr
Long time nixers
I actually just changed the GNU flags for this to '-r | --remove' and now use '-j | --track' and '-J | --tracknum' instead.