From 7d175f56e288fbf1b977ba8e8629bee22a7d1be8 Mon Sep 17 00:00:00 2001 From: jared Date: Sun, 8 Feb 2026 19:13:22 -0500 Subject: [PATCH] works on mac and ubu --- .claude/settings.local.json | 3 ++- server/convert-webm.js | 5 ++++- server/index.js | 7 +++++-- server/signsync.db | Bin 16384 -> 16384 bytes 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index a86b1c6..a329582 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -6,7 +6,8 @@ "Bash(npm run build:*)", "Bash(nginx -t:*)", "Bash(sudo nginx:*)", - "Bash(ln -s:*)" + "Bash(ln -s:*)", + "Bash(curl:*)" ] } } diff --git a/server/convert-webm.js b/server/convert-webm.js index 33cc2df..7facbaa 100644 --- a/server/convert-webm.js +++ b/server/convert-webm.js @@ -5,6 +5,9 @@ import sqlite3 from 'sqlite3'; import { open } from 'sqlite'; import { spawn } from 'child_process'; +// Find ffmpeg binary +const FFMPEG = ['/opt/homebrew/bin/ffmpeg', '/usr/bin/ffmpeg'].find(p => fs.existsSync(p)) || 'ffmpeg'; + const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const mediaDir = path.join(__dirname, '..', 'public', 'media'); @@ -24,7 +27,7 @@ const transcodeToMp4 = (inputPath, outputPath) => new Promise((resolve, reject) outputPath ]; - const ffmpeg = spawn('ffmpeg', args, { stdio: 'ignore' }); + const ffmpeg = spawn(FFMPEG, args, { stdio: 'ignore' }); ffmpeg.on('error', reject); ffmpeg.on('close', (code) => { if (code === 0) { diff --git a/server/index.js b/server/index.js index 5c9c5ee..380caa9 100644 --- a/server/index.js +++ b/server/index.js @@ -9,6 +9,9 @@ import { fileURLToPath } from 'url'; import fs from 'fs'; import { spawn } from 'child_process'; +// Find ffmpeg binary +const FFMPEG = ['/opt/homebrew/bin/ffmpeg', '/usr/bin/ffmpeg'].find(p => fs.existsSync(p)) || 'ffmpeg'; + // Generate a unique link ID const generateUniqueId = () => { return crypto.randomBytes(8).toString('hex'); @@ -25,7 +28,7 @@ app.use(cors()); app.use(express.json()); // Ensure media directory exists -const mediaDir = path.join(__dirname, '..', 'public', 'media'); +const mediaDir = '/opt/homebrew/var/www/signsync/media'; if (!fs.existsSync(mediaDir)) { fs.mkdirSync(mediaDir, { recursive: true }); } @@ -81,7 +84,7 @@ const transcodeToMp4 = (inputPath, outputPath) => new Promise((resolve, reject) outputPath ]; - const ffmpeg = spawn('ffmpeg', args, { stdio: 'ignore' }); + const ffmpeg = spawn(FFMPEG, args, { stdio: 'ignore' }); ffmpeg.on('error', reject); ffmpeg.on('close', (code) => { if (code === 0) { diff --git a/server/signsync.db b/server/signsync.db index f8bcf43b7fb0946e95b1112bb40f1fc3bfc144d8..71181efb78749b1ae2f21ba380c0a7b1cb1116c5 100644 GIT binary patch delta 273 zcmZo@U~Fh$oFFa8%D}+D0>m)DI8nz~n3X}VXb~^}4+du50tVhg{D*l9HY+OpZfazqms?&dkmx4Uir@NkkG&xb2Ura46JLSUJ(v z7;gr$2jk6n_Cojzj8`vSjPYc`5o0)dF>$tlmPI%FcJsb@`MjU)w%Ts1d!yNkqA0!6 z&Y#}>S)8jVrRG~bGp+P!M~Zd?KImT#!pBI(H=nRY_tMK zqEDHe{Fl_JsG;9agP-c_IP`hY723Ly((+e8E%PHYt=F!-(Y|W=gYZ|n5Qfz;T`3Nh zm%QBM67KI8K7khXkmop%B4$P_HUXCx%F=UyXL0qagOau`vLR5s-gu!f+ z*o1}E(F;I~EkTjXC~;hY;W>~>3V~-pN)X2MA3$uIR#+Xm07Q&o*Mf#YJ=gcCII9pD zoI(}@D-0ovLBcNsF|`Q~7lyUJE&I$gOh;hCWiP_8PH_fh5b-mdK{+E3UB)416BI5C zb>V8JX9|P3oEQ#7*y-RXH=t>89#^+39So^uBylvJA2hd9l9rpC@#JCPn(I3?Bp74R zWELT=SeNg-w34?`FV}^?=9FVE5N>_7)oN_o<#G@NrJaqf)|M+eQGwI)R_C@WcY>Y8 zs=MecJ%M-sERIbeWXFA2;Xq#}^OQGmdj@+PBV;gI^IT3H?*1>cZ0Xj6Q*sCFtou8$ z&BvdvB0FyP#hfO_HYAXwWv?kvSHLUq6dZ$hpbp-H&xhHGhhR6~Q&f{jITnk_!y1jn z