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

Fix proprietary audio codec support for the new NW.js version #2062

Open
pcenta opened this issue Mar 16, 2021 · 56 comments
Open

Fix proprietary audio codec support for the new NW.js version #2062

pcenta opened this issue Mar 16, 2021 · 56 comments

Comments

@pcenta
Copy link
Contributor

pcenta commented Mar 16, 2021

Is your feature request related to a problem? Please describe.
Not related to a problem but the project is using outdated version.

Describe the idea you'd like
App loads NWjs from https://get.popcorntime.app/repo/nw/. First step would be to upload newer version to allow easier testing than manually tricking app on local build.

Describe alternatives you've considered
We can stay on existing version?

Additional context
NWjs link https://nwjs.io/

@pcenta
Copy link
Contributor Author

pcenta commented Mar 19, 2021

Locally I tried it with v0.52.0 and I've tested some basic functionalities and haven't found anything broken. Since our current version works there's no hurry to do this but I think that there are some benefits (recent memory usage optimizations).
Even though this is almost 10 releases newer I don't think that there will be any serious issues with it. Majority of those releases are only bumped versions of Chromium and Node and I don't think that any of them recently deprecated or removed anything PT uses.

If you could tag this as a Feature would be great. Could you upload new NWjs SDK too? Anyone can do this but it would be easier if anyone deletes their cache folders. From there it's all about changing version defined in one of the source files.

@Ouack23
Copy link

Ouack23 commented Apr 13, 2021

Hello,
I am curious about how you made https://nwjs.io/ work in PT.
I tried to use the following patch for gulpfile.js :

--- src/popcorn-desktop/gulpfile.js     2021-04-13 12:28:56.098245263 +0200
+++ gulpfile.js 2021-04-13 12:27:57.132266951 +0200
@@ -142,8 +142,7 @@
   macIcns: './src/app/images/butter.icns',
   version: nwVersion,
   flavor: nwFlavor,
-  manifestUrl: 'https://popcorntime.app/version.json',
-  downloadUrl: 'https://get.popcorntime.app/repo/nw/',
+  downloadUrl: 'https://dl.nwjs.io/',
   platforms: parsePlatforms()
 }).on('log', console.log);

PT successfully builds but do not launch (no clear log is output). I tested 0.44.5, 0.52.0 and 0.52.2 and none of them worked.
How did you do that ?

Thanks for reading

Edit : from what I understand, I have to include support at compile time for various proprietary codecs in NWJS. Still, it is unclear to me what steps I have to setup for a complete compile script.

@pcenta
Copy link
Contributor Author

pcenta commented Apr 14, 2021

Hello,
I am curious about how you made https://nwjs.io/ work in PT.
I tried to use the following patch for gulpfile.js :

--- src/popcorn-desktop/gulpfile.js     2021-04-13 12:28:56.098245263 +0200
+++ gulpfile.js 2021-04-13 12:27:57.132266951 +0200
@@ -142,8 +142,7 @@
   macIcns: './src/app/images/butter.icns',
   version: nwVersion,
   flavor: nwFlavor,
-  manifestUrl: 'https://popcorntime.app/version.json',
-  downloadUrl: 'https://get.popcorntime.app/repo/nw/',
+  downloadUrl: 'https://dl.nwjs.io/',
   platforms: parsePlatforms()
 }).on('log', console.log);

PT successfully builds but do not launch (no clear log is output). I tested 0.44.5, 0.52.0 and 0.52.2 and none of them worked.
How did you do that ?

Thanks for reading

Edit : from what I understand, I have to include support at compile time for various proprietary codecs in NWJS. Still, it is unclear to me what steps I have to setup for a complete compile script.

What've done is a bit different. I manually downloaded NWjs SDK and put it into my cache folder since I wanted minimal change in actual code. Also version that worked for me was 0.52.0, it might be that there were some additional changes in other versions that broke something?

@chengsokdara
Copy link

chengsokdara commented Apr 25, 2021

I removed those two lines without providing new downloadUrl.

--- src/popcorn-desktop/gulpfile.js     2021-04-13 12:28:56.098245263 +0200
+++ gulpfile.js 2021-04-13 12:27:57.132266951 +0200
@@ -142,8 +142,7 @@
   macIcns: './src/app/images/butter.icns',
   version: nwVersion,
   flavor: nwFlavor,
-  manifestUrl: 'https://popcorntime.app/version.json',
-  downloadUrl: 'https://get.popcorntime.app/repo/nw/',
   platforms: parsePlatforms()
 }).on('log', console.log);

The build fallback to download by itself, seem nwjs-sdk-v0.44.5 works perfectly.

Create cache folder in ~/Projects/popcorn-official/popcorn-desktop/cache/0.44.5-sdk
Downloading: https://dl.nwjs.io/v0.44.5/nwjs-sdk-v0.44.5-osx-x64.zip

@memarko
Copy link

memarko commented Apr 25, 2021

Thanks it works.

I have problems accessing https://get.popcorntime.app/repo/nw/ is this domain down or is it just blocked by my ISP?

I removed those two lines without providing new downloadUrl.

--- src/popcorn-desktop/gulpfile.js     2021-04-13 12:28:56.098245263 +0200
+++ gulpfile.js 2021-04-13 12:27:57.132266951 +0200
@@ -142,8 +142,7 @@
   macIcns: './src/app/images/butter.icns',
   version: nwVersion,
   flavor: nwFlavor,
-  manifestUrl: 'https://popcorntime.app/version.json',
-  downloadUrl: 'https://get.popcorntime.app/repo/nw/',
   platforms: parsePlatforms()
 }).on('log', console.log);

The build fallback to download by itself, seem nwjs-sdk-v0.44.5 works perfectly.

Create cache folder in ~/Projects/popcorn-official/popcorn-desktop/cache/0.44.5-sdk
Downloading: https://dl.nwjs.io/v0.44.5/nwjs-sdk-v0.44.5-osx-x64.zip

@ivan1986
Copy link
Contributor

@memarko domain is down
if you use https://dl.nwjs.io you get version without proprietary codecs
i also save copy of 0.44.5

manifestUrl: 'http://popcorn-ru.tk/version.json',
downloadUrl: 'http://popcorn-ru.tk/nw/',

@isaamos
Copy link

isaamos commented Jun 6, 2021

@memarko domain is down
if you use https://dl.nwjs.io you get version without proprietary codecs
i also save copy of 0.44.5

manifestUrl: 'http://popcorn-ru.tk/version.json',
downloadUrl: 'http://popcorn-ru.tk/nw/',

Is this reliable or secure?

@ivan1986
Copy link
Contributor

ivan1986 commented Jun 6, 2021

@isaamos it's safe

@pcenta
Copy link
Contributor Author

pcenta commented Jul 22, 2021

@memarko domain is down
if you use https://dl.nwjs.io you get version without proprietary codecs
i also save copy of 0.44.5

manifestUrl: 'http://popcorn-ru.tk/version.json',
downloadUrl: 'http://popcorn-ru.tk/nw/',

FFmpeg can be added manually to SDK or SDK itself can be built with included codec (it's an option if you build NWjs manually). So this means we can download NWjs from https://nwjs.io/downloads/ and add prebuilt FFmpeg codec from https://github.com/iteufel/nwjs-ffmpeg-prebuilt. I've tested it locally with NWjs 54.1 and prebuilt FFmpeg for 54.

Can someone else test this and report if there are any issues/benefits with newer version of Chromium?

@ivan1986
Copy link
Contributor

ivan1986 commented Jul 22, 2021

For me build with external ffmpeg not work - many films without sound
@team-pct said that he has a build script
and https://github.com/iteufel/nwjs-ffmpeg-prebuilt has not codecs
i try to add codecs - it's some better, but not so good
https://github.com/popcorn-time-ru/nwjs-ffmpeg-prebuilt/tree/codecs

@ivan1986
Copy link
Contributor

ivan1986 commented Oct 2, 2021

i commit current build script to
https://github.com/popcorn-time-ru/nwjs-build
it build nwjs with codecs, but some incorrect flags
eac3 (a52) audio not working and avi files not play

for build full nwjs need about 60gb space and it work about week on oracle free vm
somebody have ideas what i do wrong?

@Kief5555
Copy link

I removed those two lines without providing new downloadUrl.

--- src/popcorn-desktop/gulpfile.js     2021-04-13 12:28:56.098245263 +0200
+++ gulpfile.js 2021-04-13 12:27:57.132266951 +0200
@@ -142,8 +142,7 @@
   macIcns: './src/app/images/butter.icns',
   version: nwVersion,
   flavor: nwFlavor,
-  manifestUrl: 'https://popcorntime.app/version.json',
-  downloadUrl: 'https://get.popcorntime.app/repo/nw/',
   platforms: parsePlatforms()
 }).on('log', console.log);

The build fallback to download by itself, seem nwjs-sdk-v0.44.5 works perfectly.

Create cache folder in ~/Projects/popcorn-official/popcorn-desktop/cache/0.44.5-sdk
Downloading: https://dl.nwjs.io/v0.44.5/nwjs-sdk-v0.44.5-osx-x64.zip

How did you download it on mac? Its not opening for me

@Kief5555
Copy link

Kief5555 commented Dec 8, 2021

Locally I tried it with v0.52.0 and I've tested some basic functionalities and haven't found anything broken. Since our current version works there's no hurry to do this but I think that there are some benefits (recent memory usage optimizations). Even though this is almost 10 releases newer I don't think that there will be any serious issues with it. Majority of those releases are only bumped versions of Chromium and Node and I don't think that any of them recently deprecated or removed anything PT uses.

If you could tag this as a Feature would be great. Could you upload new NWjs SDK too? Anyone can do this but it would be easier if anyone deletes their cache folders. From there it's all about changing version defined in one of the source files.

How did you test?

@Kief5555
Copy link

Kief5555 commented Dec 8, 2021

I removed those two lines without providing new downloadUrl.

--- src/popcorn-desktop/gulpfile.js     2021-04-13 12:28:56.098245263 +0200
+++ gulpfile.js 2021-04-13 12:27:57.132266951 +0200
@@ -142,8 +142,7 @@
   macIcns: './src/app/images/butter.icns',
   version: nwVersion,
   flavor: nwFlavor,
-  manifestUrl: 'https://popcorntime.app/version.json',
-  downloadUrl: 'https://get.popcorntime.app/repo/nw/',
   platforms: parsePlatforms()
 }).on('log', console.log);

The build fallback to download by itself, seem nwjs-sdk-v0.44.5 works perfectly.

Create cache folder in ~/Projects/popcorn-official/popcorn-desktop/cache/0.44.5-sdk
Downloading: https://dl.nwjs.io/v0.44.5/nwjs-sdk-v0.44.5-osx-x64.zip

Can you provide me with a download link to the working version? (I am on mac)

@Kief5555
Copy link

Kief5555 commented Dec 9, 2021

@Kief5555 An easy way to build without installing any build tools or libraries or having to learn anything is to just fork the dev branch, enable 'Actions' in your branch, open gulpfile.js for edit, remove those two lines about the custom nwjs above and save the file. A new commit should have been merged and new builds for all OSes should start building in the Actions page, wait about 15 minutes and download the macOS one once its done.

(mentioning this so you dont have to rely on someone else for builds every time there is an update if you are going to try using the latest nwjs version without codecs)

Hey, I did it a different way. I bumped the NWJS version to 0.55 in gulpfile.js then removed the 2 lines where it takes downloads from. I built it using instructions in readme, but did not start. Then I downloaded Ivan's audio fixed and put it in builds then ran it. Ran just fine on Monterey.

0.55 Nwjs downloaded into my cache

@Kief5555
Copy link

https://youtu.be/3IZid6lBMJM I have a fix, you can watch from the link.

@ivan1986
Copy link
Contributor

@Kief5555 you write this 5 times
try to read thread
it's not work - many videos have not sound

@Kief5555
Copy link

@Kief5555 you write this 5 times try to read thread it's not work - many videos have not sound

some videos do, wont they have sound if they have the codecs?

@ivan1986
Copy link
Contributor

@Kief5555 need rebuild full nwjs with enable codecs patch
i try to do this - #2062 (comment)
it works better, and play many films with sound, but ac3 audio not work, some icorrct flags
if you want - try to build and test this on your mac - it will be more useful than a video that can be replaced with a couple of paragraphs of text

@Kief5555
Copy link

Kief5555 commented Jan 6, 2022

@ivan1986 Do you have the link to downloaded these codecs?

@ivan1986
Copy link
Contributor

ivan1986 commented Jan 7, 2022

what link?
this codecs is part of ffmpeg, need compile this with enable codecs
https://github.com/popcorn-time-ru/nwjs-build/blob/master/build_linux64.sh#L73-L108
i apply patch after download sources

@tio-trom

This comment was marked as off-topic.

@Kief5555

This comment was marked as off-topic.

@tio-trom

This comment was marked as off-topic.

@pcenta

This comment was marked as off-topic.

@Kief5555

This comment was marked as off-topic.

@Kief5555

This comment was marked as off-topic.

@Kief5555

This comment was marked as off-topic.

@kiriles90 kiriles90 changed the title NWjs update Fully fix proprietary audio codec support for the new NW.js build Jun 24, 2023
@kiriles90 kiriles90 added bug and removed feature labels Jun 24, 2023
@kiriles90 kiriles90 moved this from Features to Bugs in Popcorn Time Desktop Jun 24, 2023
@kiriles90 kiriles90 changed the title Fully fix proprietary audio codec support for the new NW.js build Fix proprietary audio codec support for the new NW.js build Jun 24, 2023
@kiriles90 kiriles90 changed the title Fix proprietary audio codec support for the new NW.js build Fix proprietary audio codec support for the new NW.js version Jun 24, 2023
@Vhee22
Copy link

Vhee22 commented Oct 22, 2023

it seems the build artifacts are expired: https://github.com/popcorn-official/popcorn-desktop/actions/runs/5496485657

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

No branches or pull requests