Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lags initially and freezes a few moments later on Nw.js 0.46.0+ #75

Open
anesuc opened this issue Aug 27, 2020 · 3 comments
Open

Lags initially and freezes a few moments later on Nw.js 0.46.0+ #75

anesuc opened this issue Aug 27, 2020 · 3 comments

Comments

@anesuc
Copy link

anesuc commented Aug 27, 2020

Hi all,

I'm not sure what is actually responsible for this, if it's the plugin or Nw.js. this worked fine until 0.46.0. The reason I am posting this here first is to make sure it's not some node compatibility issue that's already known. Here is the release notes for 0.46.0. It doesn't throw any errors or anything. If this happens to work perfectly fine in the latest version of Electron (haven't really used it to test it) then I'll link this to the Nw.js issues. Here is a Linux zip (I also re-compiled it, incase it was to do with that, but just check to make sure I compiled it correctly. Either way, it didn't fix the problem).

To run use npm run nw (or just ./nw)

  • To see the code: it's in index.html
  • Pre-built mpv.js in mpv.js directory. You can replace that with whatever for testing
  • The nw.js files in here are from Nw.js 0.46.0. The same applies all the way up to the latest version. I tasted practically every one of them until this point. To test 0.45.5 for example, just download it from the official website here select the sdk build and just replace all files in the zip with the ones from there. Make sure to replace the libffmpeg using gcc -Wl,--no-as-needed -shared -lavformat -o /path/to/libffmpeg.so

This is rather important for my project so let me know if anyone has any idea how to fix this.

If you are on another platform just grab the index.html and package.json, download the appropriate platform version of Nw.js from the link above, copy those 2 files into that directory (make sure the plugin url links to your platform one's location in package.json) and run Nw in whichever way they say to do it.

Thanks

@anesuc
Copy link
Author

anesuc commented Sep 2, 2020

@Kagami Possibility of porting this to WASM? From the other issue linked above that I reported directly to Nwjs, it seems Pepper plugins are slowly being phased out in favour of WASM

@tmm1
Copy link

tmm1 commented Nov 6, 2020

Can you attach a debugger and see where it is stuck inside libmpv or the pepper plugin?

@sirisian
Copy link

sirisian commented Feb 4, 2021

@anesuc Also not sure if you've tried this with your stream, but you might need:

this.mpv.addEventListener('message', msg => {
	if (msg.data.type === 'ready') {
		//...
		this.setProperty('untimed', true);
	}
});

(This won't work with RTP or RTSP streams). I had issues with blackmagic hardware where that fixed stuttering.

Other flags to look into maybe also (I've had to use these on some hardware):

this.setProperty('opengl-swapinterval', 0);
this.setProperty('opengl-glfinish', true);
this.setProperty('display-fps', 30);
this.setProperty('ao', 'wasapi');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants