Skip to content

Commit

Permalink
fix media stats on apple silicon mac
Browse files Browse the repository at this point in the history
  • Loading branch information
hatton committed Dec 16, 2024
1 parent 0125eab commit db820dc
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 48 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"@types/camelcase": "^4.1.0",
"@types/commonmark": "^0.27.0",
"@types/filesize": "^5.0.0",
"@types/fluent-ffmpeg": "^2.1.8",
"@types/fluent-ffmpeg": "^2.1.27",
"@types/fs-extra": "^9.0.13",
"@types/image-size": "^0.0.29",
"@types/json5": "^2.2.0",
Expand Down Expand Up @@ -174,10 +174,10 @@
"eslint-plugin-react": "^7.33.2",
"excel-date-to-js": "^1.1.5",
"exifreader": "^3.11.2",
"ffprobe-static": "^3.1.0",
"ffmpeg-ffprobe-static": "^6.1.2-rc.1",
"filesize": "^6.1.0",
"flatted": "^3.1.0",
"fluent-ffmpeg": "^2.1.2",
"fluent-ffmpeg": "^2.1.3",
"fold-to-ascii": "^5.0.0",
"font-awesome": "^4.7.0",
"fs-extra": "^11.1.0",
Expand Down
7 changes: 0 additions & 7 deletions patches/fluent-ffmpeg+2.1.2.patch

This file was deleted.

4 changes: 0 additions & 4 deletions patches/readme.md

This file was deleted.

19 changes: 10 additions & 9 deletions src/components/MediaStats.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { css } from "@emotion/react";
/* removed emotion jsx declaration */

import { default as React, useState, useEffect } from "react";
import ReactTable from "react-table-6";
import { File } from "../model/file/File";
Expand All @@ -27,18 +25,21 @@ type Stats = object;
// );

// ffmpeg.setFfmpegPath(ffmpegPath);
const x = require("ffprobe-static").path;
console.log(`ffprobe-static.path=${x}`);
//const x = require("ffprobe-static").path;
//console.log(`ffprobe-static.path=${x}`);

const ffprobePath = require("ffmpeg-ffprobe-static").ffprobePath;
console.log(ffprobePath);

// during a dev run, this is just going to point to node_modules, fine.
// during release (installed) run, on window and mac this is resources/app.asar/node_modules/ffprobe-static/bin/<platformstuff>/ffprobe.exe
// we want /resources/app.asar.unpacked/node_modules/ffprobe-static/bin/<platformstuff>/ffprobe.exe

const ffprobePath = require("ffprobe-static")
.path // during run from release (win-unpacked or installed)
.replace("app.asar", "app.asar.unpacked"); // on windows, both installed and not installed, win-unpacked/resources/node_modules/ffprobe-static exists
//console.log(`adjusted ffprobe-static.path=${ffprobePath}`);
// const ffprobePath = require("ffprobe-static")
// .path // during run from release (win-unpacked or installed)
// .replace("app.asar", "app.asar.unpacked"); // on windows, both installed and not installed, win-unpacked/resources/node_modules/ffprobe-static exists
console.log(`setting ffmpeg.setFfprobPath(${ffprobePath})`);
ffmpeg.setFfprobePath(ffprobePath);
console.log(`changed to ffprobe-static.path=${x}`);

export const MediaStats: React.FunctionComponent<{ file: File }> = (props) => {
const [message, setMessage] = useState<string>("Processing...");
Expand Down
92 changes: 67 additions & 25 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1438,6 +1438,16 @@
enabled "2.0.x"
kuler "^2.0.0"

"@derhuerst/http-basic@8.2.4":
version "8.2.4"
resolved "https://registry.npmjs.org/@derhuerst/http-basic/-/http-basic-8.2.4.tgz#d021ebb8f65d54bea681ae6f4a8733ce89e7f59b"
integrity sha512-F9rL9k9Xjf5blCz8HsJRO4diy111cayL2vkY2XE4r4t3n0yPXVYy3KD3nJ1qbrSn9743UWSXH4IwuCa/HWlGFw==
dependencies:
caseless "^0.12.0"
concat-stream "^2.0.0"
http-response-object "^3.0.1"
parse-cache-control "^1.0.1"

"@develar/schema-utils@~2.6.5":
version "2.6.5"
resolved "https://registry.npmjs.org/@develar/schema-utils/-/schema-utils-2.6.5.tgz#3ece22c5838402419a6e0425f85742b961d9b6c6"
Expand Down Expand Up @@ -3788,10 +3798,10 @@
dependencies:
filesize "*"

"@types/fluent-ffmpeg@^2.1.8":
version "2.1.24"
resolved "https://registry.npmjs.org/@types/fluent-ffmpeg/-/fluent-ffmpeg-2.1.24.tgz#f53c57700bc4360ac638554545c8da2c465434c1"
integrity sha512-g5oQO8Jgi2kFS3tTub7wLvfLztr1s8tdXmRd8PiL/hLMLzTIAyMR2sANkTggM/rdEDAg3d63nYRRVepwBiCw5A==
"@types/fluent-ffmpeg@^2.1.27":
version "2.1.27"
resolved "https://registry.npmjs.org/@types/fluent-ffmpeg/-/fluent-ffmpeg-2.1.27.tgz#c4eac6fbda30bb6316d2220c8faf54f48db0812d"
integrity sha512-QiDWjihpUhriISNoBi2hJBRUUmoj/BMTYcfz+F+ZM9hHWBYABFAE6hjP/TbCZC0GWwlpa3FzvHH9RzFeRusZ7A==
dependencies:
"@types/node" "*"

Expand Down Expand Up @@ -3944,6 +3954,11 @@
resolved "https://registry.npmjs.org/@types/node/-/node-16.11.22.tgz#e704150225bfc4195f8ce68a7ac8da02b753549a"
integrity sha512-DYNtJWauMQ9RNpesl4aVothr97/tIJM8HbyOXJ0AYT1Z2bEjLHyfjOBPAQQVMLf8h3kSShYfNk8Wnto8B2zHUA==

"@types/node@^10.0.3":
version "10.17.60"
resolved "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz#35f3d6213daed95da7f0f73e75bcc6980e90597b"
integrity sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==

"@types/node@^14.0.10 || ^16.0.0", "@types/node@^16.11.26":
version "16.18.79"
resolved "https://registry.npmjs.org/@types/node/-/node-16.18.79.tgz#153e25561b271cf87dc1b28d38f98cebd514d788"
Expand Down Expand Up @@ -5343,10 +5358,10 @@ async-exit-hook@^2.0.1:
resolved "https://registry.npmjs.org/async-exit-hook/-/async-exit-hook-2.0.1.tgz#8bd8b024b0ec9b1c01cccb9af9db29bd717dfaf3"
integrity sha512-NW2cX8m1Q7KPA7a5M2ULQeZ2wR5qI5PAbw5L0UOMxdioVk9PMZ0h1TmyZEkPYrCvYjDlFICusOu1dlEKAAeXBw==

async@>=0.2.9, async@^3.2.3:
version "3.2.5"
resolved "https://registry.npmjs.org/async/-/async-3.2.5.tgz#ebd52a8fdaf7a2289a24df399f8d8485c8a46b66"
integrity sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==
async@^0.2.9:
version "0.2.10"
resolved "https://registry.npmjs.org/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1"
integrity sha512-eAkdoKxU6/LkKDBzLpT+t6Ff5EtfSF4wx1WfJiPEEV7WNLnDaRXk0oVysiEPm262roaachGexwUv94WhSgN5TQ==

async@^2.0.0:
version "2.6.4"
Expand All @@ -5355,6 +5370,11 @@ async@^2.0.0:
dependencies:
lodash "^4.17.14"

async@^3.2.3:
version "3.2.5"
resolved "https://registry.npmjs.org/async/-/async-3.2.5.tgz#ebd52a8fdaf7a2289a24df399f8d8485c8a46b66"
integrity sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==

asynciterator.prototype@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/asynciterator.prototype/-/asynciterator.prototype-1.0.0.tgz#8c5df0514936cdd133604dfcc9d3fb93f09b2b62"
Expand Down Expand Up @@ -6628,7 +6648,7 @@ case-sensitive-paths-webpack-plugin@^2.3.0:
resolved "https://registry.npmjs.org/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz#db64066c6422eed2e08cc14b986ca43796dbc6d4"
integrity sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw==

caseless@~0.12.0:
caseless@^0.12.0, caseless@~0.12.0:
version "0.12.0"
resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==
Expand Down Expand Up @@ -7223,6 +7243,16 @@ concat-stream@^1.5.0:
readable-stream "^2.2.2"
typedarray "^0.0.6"

concat-stream@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz#414cf5af790a48c60ab9be4527d56d5e41133cb1"
integrity sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==
dependencies:
buffer-from "^1.0.0"
inherits "^2.0.3"
readable-stream "^3.0.2"
typedarray "^0.0.6"

concurrently@^3.1.0:
version "3.6.1"
resolved "https://registry.npmjs.org/concurrently/-/concurrently-3.6.1.tgz#2f95baec5c4051294dfbb55b57a3b98a3e2b45ec"
Expand Down Expand Up @@ -9319,10 +9349,15 @@ fflate@^0.8.2:
resolved "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz#fc8631f5347812ad6028bbe4a2308b2792aa1dea"
integrity sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==

ffprobe-static@^3.1.0:
version "3.1.0"
resolved "https://registry.npmjs.org/ffprobe-static/-/ffprobe-static-3.1.0.tgz#982cfa1de111a4d6043f6fc208f64a82b53034c9"
integrity sha512-Dvpa9uhVMOYivhHKWLGDoa512J751qN1WZAIO+Xw4L/mrUSPxS4DApzSUDbCFE/LUq2+xYnznEahTd63AqBSpA==
ffmpeg-ffprobe-static@^6.1.2-rc.1:
version "6.1.2-rc.1"
resolved "https://registry.npmjs.org/ffmpeg-ffprobe-static/-/ffmpeg-ffprobe-static-6.1.2-rc.1.tgz#d5c03c7fffa6be6a0b3accdd158ad64e36d6c86b"
integrity sha512-zHHGmR76ebnto/TU4qGTnQPqBBKVLTalJG6JdzsZujd9CWybojK4lNzW51154bItUEf12WHiHzSBmvkEr+VIXg==
dependencies:
"@derhuerst/http-basic" "8.2.4"
env-paths "^2.2.0"
https-proxy-agent "^5.0.0"
progress "^2.0.3"

figgy-pudding@^3.5.1:
version "3.5.2"
Expand Down Expand Up @@ -9500,17 +9535,12 @@ flatted@^3.1.0, flatted@^3.2.9:
resolved "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf"
integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==

flatted@^3.3.1:
version "3.3.2"
resolved "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz#adba1448a9841bec72b42c532ea23dbbedef1a27"
integrity sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==

fluent-ffmpeg@^2.1.2:
version "2.1.2"
resolved "https://registry.npmjs.org/fluent-ffmpeg/-/fluent-ffmpeg-2.1.2.tgz#c952de2240f812ebda0aa8006d7776ee2acf7d74"
integrity sha512-IZTB4kq5GK0DPp7sGQ0q/BWurGHffRtQQwVkiqDgeO6wYJLLV5ZhgNOQ65loZxxuPMKZKZcICCUnaGtlxBiR0Q==
fluent-ffmpeg@^2.1.3:
version "2.1.3"
resolved "https://registry.npmjs.org/fluent-ffmpeg/-/fluent-ffmpeg-2.1.3.tgz#d6846be257777844249a4adeb320f25326d239f3"
integrity sha512-Be3narBNt2s6bsaqP6Jzq91heDgOEaDCJAXcE3qcma/EJBSy5FB4cvO31XBInuAuKBx8Kptf8dkhjK0IOru39Q==
dependencies:
async ">=0.2.9"
async "^0.2.9"
which "^1.1.1"

flush-write-stream@^1.0.0:
Expand Down Expand Up @@ -10602,6 +10632,13 @@ http-proxy-agent@^5.0.0:
agent-base "6"
debug "4"

http-response-object@^3.0.1:
version "3.0.2"
resolved "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.2.tgz#7f435bb210454e4360d074ef1f989d5ea8aa9810"
integrity sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==
dependencies:
"@types/node" "^10.0.3"

http-signature@~1.2.0:
version "1.2.0"
resolved "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
Expand All @@ -10616,7 +10653,7 @@ https-browserify@^1.0.0:
resolved "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"
integrity sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==

https-proxy-agent@^5.0.1:
https-proxy-agent@^5.0.0, https-proxy-agent@^5.0.1:
version "5.0.1"
resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6"
integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==
Expand Down Expand Up @@ -13600,6 +13637,11 @@ parse-asn1@^5.0.0, parse-asn1@^5.1.6:
pbkdf2 "^3.0.3"
safe-buffer "^5.1.1"

parse-cache-control@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz#8eeab3e54fa56920fe16ba38f77fa21aacc2d74e"
integrity sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg==

parse-entities@^1.1.2:
version "1.2.2"
resolved "https://registry.npmjs.org/parse-entities/-/parse-entities-1.2.2.tgz#c31bf0f653b6661354f8973559cb86dd1d5edf50"
Expand Down Expand Up @@ -14780,7 +14822,7 @@ readable-stream@^1.1.8:
isarray "0.0.1"
string_decoder "~0.10.x"

readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0, readable-stream@^3.6.2:
readable-stream@^3.0.2, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0, readable-stream@^3.6.2:
version "3.6.2"
resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967"
integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==
Expand Down

0 comments on commit db820dc

Please sign in to comment.