Skip to content

Commit 2f98f7a

Browse files
BackBack
authored andcommitted
Fix Apple Silicon ffprobe packaging
1 parent b0b4f5a commit 2f98f7a

7 files changed

Lines changed: 161 additions & 8 deletions

File tree

.github/workflows/release-installers.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
tag:
1010
description: "Release tag to upload installers to"
1111
required: true
12-
default: "v1.0.2"
12+
default: "v1.0.3"
1313

1414
permissions:
1515
contents: write
@@ -52,6 +52,11 @@ jobs:
5252
- run: npm ci
5353
- run: npm run build
5454
- run: npx electron-builder --mac dmg pkg --arm64 --config.directories.output=release-upload
55+
- name: Verify macOS bundled binaries
56+
run: |
57+
file "release-upload/mac-arm64/DL Studio.app/Contents/Resources/bin/ffmpeg"
58+
file "release-upload/mac-arm64/DL Studio.app/Contents/Resources/bin/ffprobe-arm64" | tee /tmp/ffprobe-file.txt
59+
grep -q "Mach-O 64-bit executable arm64" /tmp/ffprobe-file.txt
5560
- name: Upload macOS assets
5661
env:
5762
GH_TOKEN: ${{ github.token }}

Mac/package-lock.json

Lines changed: 134 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Mac/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dl-studio-mac",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"private": true,
55
"description": "Desktop batch video downsampler for macOS.",
66
"main": "src/main/main.js",
@@ -24,6 +24,7 @@
2424
"electron": "^34.1.1",
2525
"electron-builder": "^25.1.8",
2626
"ffmpeg-static": "^5.2.0",
27+
"@ffprobe-installer/ffprobe": "^2.1.2",
2728
"ffprobe-static": "^3.1.0",
2829
"lucide-react": "^0.475.0",
2930
"react": "^19.0.0",
@@ -52,7 +53,7 @@
5253
"to": "bin/ffmpeg"
5354
},
5455
{
55-
"from": "node_modules/ffprobe-static/bin/darwin/arm64/ffprobe",
56+
"from": "node_modules/@ffprobe-installer/darwin-arm64/ffprobe",
5657
"to": "bin/ffprobe-arm64"
5758
},
5859
{
@@ -90,5 +91,8 @@
9091
"artifactName": "DL-Studio-Mac-${version}-${arch}.${ext}",
9192
"installLocation": "/Applications"
9293
}
94+
},
95+
"dependencies": {
96+
"@ffprobe-installer/ffprobe": "^2.1.2"
9397
}
9498
}

Mac/scripts/app-shell.test.cjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ assert.equal(packageJson.author, "DL Studio");
1818
assert.equal(packageJson.build.productName, "DL Studio");
1919
assert.equal(packageLock.name, "dl-studio-mac");
2020
assert.equal(packageLock.packages[""].name, "dl-studio-mac");
21+
assert.match(packageJson.devDependencies["@ffprobe-installer/ffprobe"], /^\^2\.1\.2/);
22+
assert.ok(
23+
packageJson.build.extraResources.some(
24+
(entry) => entry.from === "node_modules/@ffprobe-installer/darwin-arm64/ffprobe" && entry.to === "bin/ffprobe-arm64"
25+
),
26+
"macOS arm64 builds must bundle the real Apple Silicon ffprobe binary"
27+
);
2128
assert.match(indexHtml, /<title>DL Studio<\/title>/);
2229

2330
assert.match(main, /const APP_NAME = "DL Studio"/);
@@ -42,6 +49,7 @@ assert.match(main, /function uploadInferaVideo/);
4249
assert.match(main, /const activeUploadRequests = new Map/);
4350
assert.match(main, /function normalizeUploadTimestamp/);
4451
assert.match(main, /function normalizeUploadDuration/);
52+
assert.match(main, /require\("@ffprobe-installer\/ffprobe"\)\.path/);
4553
assert.match(main, /Math\.round\(timestamp\)/);
4654
assert.match(main, /function emitUploadProgress/);
4755
assert.match(main, /infera:upload-progress/);

Mac/src/main/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,10 @@ function getBundledBinary(name) {
601601
return require("ffmpeg-static");
602602
}
603603

604+
if (process.arch === "arm64") {
605+
return require("@ffprobe-installer/ffprobe").path;
606+
}
607+
604608
return require("ffprobe-static").path;
605609
}
606610

Windows/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Windows/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dl-studio-windows",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"private": true,
55
"description": "Desktop batch video downsampler for Windows.",
66
"main": "src/main/main.js",

0 commit comments

Comments
 (0)