-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Web socket does not work in build for electron #101
Comments
Hi, do you have a example of this bug, perhaps a basic repository where I can test this? It's difficult to help without seeing any code. |
Hi. |
There is a memory leak, if you run a lot of streams in good quality, then you can see in the task dispatcher how RAM is spent over time. |
Is there any way of opening the dev tools in production? Pretty difficult to debug the issue otherwise |
I just started learning electron. I don't know how to get the logs from the local server. 😞 |
for some reason Perhaps the issue is that in production, you're serving the react app from a |
You can delete Or something I didn't understand |
This may be caused by '@ffmpeg-installer/ffmpeg' package, It's a known issue that Asar breaks native paths. As a workaround, if you use Asar, you can do something like this: const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path.replace('app.asar', 'app.asar.unpacked'); Since the relevant code is in this package, I cannot change it. Look here, I can only use translation tools to reply this issues. Forgive me for my poor English. |
Thanks for the suggestion @evalor, are you experiencing the same issue? I just tried the reproduction example from @na-613c (https://github.com/na-613c/web-rtsp-relay-electron), and it seems to work fine in production. Not sure why it didn't work 10 months ago... |
I use vite+vue3 to build electron application and encounter the same problem. I try to change the following code( in index.js line 42 ): this.stream = spawn(
ffmpegPath.replace('app.asar', 'app.asar.unpacked'), // [!!!] It's changed here
[
...(transport ? ['-rtsp_transport', transport] : []), // this must come before `-i [url]`, see #82
'-i',
url,
'-f', // force format
'mpegts',
'-codec:v', // specify video codec (MPEG1 required for jsmpeg)
'mpeg1video',
'-r',
'30', // 30 fps. any lower and the client can't decode it
...additionalFlags,
'-',
],
{ detached: false, windowsHide },
); Now my application can work after it is built. Due to my busy work, I can't follow up this problem immediately. Later, I will try to provide a "minimal" problem recurrence code to help solve this problem. By the way, you can enable the electron menu to open the developer tools. Please do not hide the menu bar. After starting the application, click 'View - > toggle developer tools' in the menu bar, the developer tool will open. |
Potential memory leaks may come from jsmpeg, on large (4K) RSTP streams, memory stack growth can be significantly observed, and applications will soon crash due to memory exhaustion. When I destroy instances of jsmpeg and recreate them every 10 minutes, this situation is suppressed. I'm trying to trace the source of memory leaks. |
I have a project on electron + react js + local node js server (use
rtsp-relay to convert RTSP stream to web socket). In the dev version it works, in the prod version the web socket does not work (the server is working, it was processing a get request)
I'm sorry for the bad english ☺
The text was updated successfully, but these errors were encountered: