Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

packing and building with ffmpeg-static-electron #22

Closed
yafp opened this issue Dec 13, 2019 · 4 comments
Closed

packing and building with ffmpeg-static-electron #22

yafp opened this issue Dec 13, 2019 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@yafp
Copy link
Owner

yafp commented Dec 13, 2019

The builds for each single platform do currently contain the ffmpeg binaries for all supported platforms

This is due to the usage of: https://github.com/pietrop/ffmpeg-static-electron

Example:

The windows x64 build contains ffmpeg binaries for

  • win32
  • win64
  • mac
  • linux32
  • linux 64

this heavily raises the build size.

The question is - how to improve that?

Maybe using some package.json scripts which is used to post-process the packaging and removes the un-needed files.

@yafp yafp added the help wanted Extra attention is needed label Dec 13, 2019
@yafp yafp added this to the 0.3.0 milestone Dec 13, 2019
@yafp
Copy link
Owner Author

yafp commented Dec 13, 2019

Other idea:
check if electron-builder offers an IGNORE option

@yafp
Copy link
Owner Author

yafp commented Dec 13, 2019

@yafp
Copy link
Owner Author

yafp commented Dec 13, 2019

Seems like i got a working solution

adding a files section to the win build specification helped

"win": {
      "icon": "resources/installer/icon.ico",
      "publisherName": "yafp",
      "artifactName": "${productName}-${version}-win-${arch}.${ext}",
      "files": [
        "!node_modules/ffmpeg-static-electron/bin/linux/*",
        "!node_modules/ffmpeg-static-electron/bin/mac/*"
      ],
      "target": [
        "zip",
        "nsis",
        "portable"
      ]
    },

so i've added:

"files": [
        "!node_modules/ffmpeg-static-electron/bin/linux/*",
        "!node_modules/ffmpeg-static-electron/bin/mac/*"
      ],

This reduced the build size about 40-50 MB.

Using this approach i still have the binaries for:

  • 64 bit
  • 32 bit

in my 64bit windows build .... but not the linzx&mac os versions anymore.

Should test a bit more with the structure of my package.json and the files section ...but it seems like the way to go.

@yafp yafp self-assigned this Dec 13, 2019
@yafp yafp added enhancement New feature or request and removed help wanted Extra attention is needed labels Dec 14, 2019
yafp added a commit that referenced this issue Dec 14, 2019
@yafp yafp closed this as completed Dec 14, 2019
@derhuerst
Copy link

Let's solve this upstream! See also eugeneware/ffmpeg-static#35 .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants