Topic: Clarification of mpv-1.dll build required...

I'm currently messing about embedding libmpv into my video playing app. I have it working using the latest DLL which is 0.17.0.

I noticed one of the new features in 0.17.0 is:

"ipc: add Windows implementation with named pipes"

Does this provide what is needed for SVP to work (apart from compiling in vapoursynth support), or if I wanted to use 0.17.0 code with SVP would I still need to compile what is described on this site here:

"Windows version lacks "JSON IPC" feature in the master branch which is needed by the SVP Manager"

If 0.17.0 still lacks the above, where can I find that code please - the link on this site to your GitHub repo doesn't work (I've tried several PCs and two locations):

https://github.com/svpteam/mpv

Thanks!

Re: Clarification of mpv-1.dll build required...

I noticed one of the new features in 0.17.0 is:
"ipc: add Windows implementation with named pipes"
Does this provide what is needed for SVP to work (apart from compiling in vapoursynth support)

yep
mpv installed by SVP is just an official git version now built with that toolchain with vapoursynth enabled

3 (edited by oviano 13-04-2016 12:08:13)

Re: Clarification of mpv-1.dll build required...

Thanks.

Can't get it to work with my player though. I installed the necessary bits from SVP4 and verified that this works:

mpv --input-ipc-server=mpvpipe test.mov

However, doing the equivalent from within my app linking against the correct mpv-1.dll doesn't get picked up by SVP. I.e. nothing appears in the log.

I verified that it is accepting the "input-ipc-server" option in my code (I'm using mpv_set_option_string). If I mistype either input-ipc-server or mpvpipe then this command gives an error so it's definitely recognising it and therefore is the correct DLL.

I even tried copying everything from the mpv64 directory installed by SVP into where I am running my app from, but this still didn't work (but running mpv.exe from here did work).

I'm a bit stumped! I'm using the OpenGL method of the mpv client API, i.e. it draws to the GL context that my (SDL) code has created.

Maybe there is another step I am missing?

Re: Clarification of mpv-1.dll build required...

all I know about libmpv is that Plex Media Player (based on libmpv) works with SVP when I replace its mpv-1.dll with the one from SVP' package
so it definitely works as expected

5 (edited by oviano 13-04-2016 12:14:03)

Re: Clarification of mpv-1.dll build required...

Ok thanks. Yeah I'm sure it's something I'm not doing right.

There are two ways of using libmpv it seems - either giving it the window handle to draw to, or you can give it a GL context.

Maybe Plex uses the former, and it doesn't work with the latter or something.

Can I ask - how does SVP know to connect to the pipe that has been setup by the player? Maybe there is some kind of registration step I'm supposed to do or something?

Re: Clarification of mpv-1.dll build required...

I believe the IPC server in the mpv doesn't depend on the method of video output...
You should see something in the SVP's log when the connection to mpv's pipe is established, either "VideoPlayer: unable to find mpv's PID" or "VideoPlayer: mpv connected, waiting for the video info..."

7 (edited by oviano 13-04-2016 12:18:20)

Re: Clarification of mpv-1.dll build required...

Yep, that's the thing - there is nothing at all in the SVP log when I run my app. It seems as if there is no attempt to even connect.

Whereas I can see the entries you describe when I run mpv itself.

I'm going to reduce my app down to the bare minimum SDL example from the client API documentation and see if that can be persuaded to work.

Re: Clarification of mpv-1.dll build required...

you can pass "log-file=path" to mpv and search for "ipc" tag in that log to see if it's working

9 (edited by oviano 13-04-2016 12:51:22)

Re: Clarification of mpv-1.dll build required...

Thanks, I will try that.

Ok I've established that it works with the "simple.c" example on the mpv site but this is where the library creates its own window which isn't suitable for me as I am overlaying my own UI. Maybe Plex uses this method.

The OpenGL version on their site fails as my app does.

Re: Clarification of mpv-1.dll build required...

Ok, I worked it out.

It turns out you have to specify the option to enable the pipe before calling initialise on the mpv instance.

Wrong:

mpv_handle *ctx = mpv_create();
mpv_initialize(ctx)
mpv_set_option_string(ctx, "input-ipc-server", "mpvpipe");

Right:

mpv_handle *ctx = mpv_create();
mpv_set_option_string(ctx, "input-ipc-server", "mpvpipe");
mpv_initialize(ctx)

I guess I should have read more into the comment in the API that reads:

"Some minor options can only be set before mpv_initialize()."

Anyway, maybe this will help someone someday.