Changeset 9ed940e in Klonkt


Ignore:
Timestamp:
07/30/2026 08:00:25 AM (6 weeks ago)
Author:
Robin <roboburr@…>
Branches:
main
Children:
79f00c5
Parents:
7d01696
Message:

FFMPEG_PATH: een static build mag het werk doen

Robins vraag of apt-ffmpeg efficienter is dan een static build: in snelheid
niet, en een static build in ~/bin vraagt geen sudo en raakt het systeem
niet. De poster-spawn leest daarom FFMPEG_PATH; onges et betekent PATH, en
afwezig blijft geen fout.

Changed files:
src/routes/activitypub.js

execFile(process.env.FFMPEG_PATH
'ffmpeg', ...)

-robo
Co-Authored-By: Claude Opus 5 <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/routes/activitypub.js

    r7d01696 r9ed940e  
    319319      import('child_process').then(({ execFile }) => {
    320320        const poster = req.file.path + '.poster.jpg';
    321         execFile('ffmpeg', ['-y', '-ss', '1', '-i', req.file.path, '-frames:v', '1', '-vf', "scale='min(640,iw)':-2", poster],
     321        // FFMPEG_PATH lets a static build in ~/bin do the work without a
     322        // system install; unset means "whatever is on PATH", and neither is
     323        // an error when absent.
     324        execFile(process.env.FFMPEG_PATH || 'ffmpeg', ['-y', '-ss', '1', '-i', req.file.path, '-frames:v', '1', '-vf', "scale='min(640,iw)':-2", poster],
    322325          { timeout: 30000 }, (e) => { if (e && e.code !== 'ENOENT') console.warn('[media] poster failed:', e.message); });
    323326      }).catch(() => { /* never blocks the upload */ });
Note: See TracChangeset for help on using the changeset viewer.