j-holub / Node-MPV

A NodeJs Module for MPV Player
https://www.npmjs.com/package/node-mpv
MIT License
116 stars 73 forks source link

Launch fails if mpv is built from source #38

Closed josduj closed 6 years ago

josduj commented 6 years ago

I think I've used mpv-build to build mpv.

mpv --version outputs this:

mpv git-2018-03-22-a04ac82 Copyright © 2000-2018 mpv/MPlayer/mplayer2 projects
 built on Fri Mar 23 22:46:33 UTC 2018

It fails at this line in util.js (regex match is null)

const match = (stdout.match(/(mpv) \d+.\d+.\d+/))[0];
j-holub commented 6 years ago

Hey there,

sorry for the trouble. MPV has recently changed the format of their version string. I already did a fix on that but it seems that it is not well enough. I'll look into it.

As a temporal fix you can pass the ipc command yourself, which will skip that part of the code

let mpvPlayer = new mpv({
    'ipc_command': '--input-ipc-server'
});

But I'll see how I can fix the issue. I'm also considering just removing it because probably nobody is using mpv 0.17.0 anymore at this point and it'd be fair to just assume the new command by default and give the user the possibly to pass the original command.

j-holub commented 6 years ago

I did the same as you, building mpv using the mpv-build project, but my version string looks like this

mpv 0.28.0-406-g965ba23303 Copyright © 2000-2018 mpv/MPlayer/mplayer2 projects
 built on Mon Mar 26 22:38:56 CEST 2018
ffmpeg library versions:
   libavutil       56.12.100
   libavcodec      58.16.100
   libavformat     58.10.100
   libswscale      5.0.102
   libavfilter     7.13.100
   libswresample   3.0.101
ffmpeg version: N-90443-gcfe1a9d311

and this works, because it has the version number attached. So I cannot really reproduce the error but I see the problem. I think catching if the match was null and launching it with the new command (because a self built version will hopefully be a recent one) should do the job