eugeneware / ffmpeg-static

ffmpeg static binaries for Mac OSX and Linux and Windows
GNU General Public License v3.0
1.07k stars 175 forks source link

`ffmpeg-static` does not seem to rebuild if the binary already exists at ./ffmpeg #136

Open busterbogheart opened 2 months ago

busterbogheart commented 2 months ago

ffmpeg-static version

5.2.0

Node.js version

v18.20.3

operating system and/or environment

MacOS 11.3.1 @electron-forge electron/universal

What happened?

We are using ffmpeg-static in a build process which creates a universal Mac build, and it passes arch values for both Intel and M1: x64 and arm64. In the finished app build we noticed there was only ever one arch of the ffmpeg binary created. Digging deeper we found that if a binary already exists at ffmpeg-static/ffmpeg, it will not be rebuilt:

npm rebuild --arch=x64 -f ffmpeg-static
file node_modules/ffmpeg-static/ffmpeg

displays correctly "Mach-O 64-bit executable x86_64" rebuilding for another arch:

npm rebuild --arch=arm64 -f ffmpeg-static
file node_modules/ffmpeg-static/ffmpeg

still shows "Mach-O 64-bit executable x86_64" but removing the binary and rebuilding

rm node_modules/ffmpeg-static/ffmpeg
npm rebuild --arch=arm64 -f ffmpeg-static
file node_modules/ffmpeg-static/ffmpeg

shows correctly "Mach-O 64-bit executable arm64"