mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 15:13:07 +00:00
Seleção do C166 ganha "Cortar vídeo": título/descrição por IA (editáveis, com fallback determinístico), job assíncrono com ffmpeg por re-encode exato e polling dos quatro passos, e página pública unlisted /corte/<id> (noindex, OG, crédito CC BY) servindo o mesmo MP4. Collection speechCut com access canReadSpeechCut (advisor/leader negados) e kill switch por status; ffmpeg entra só no runner da imagem com FFMPEG_PATH para teste.
31 lines
937 B
JavaScript
Executable file
31 lines
937 B
JavaScript
Executable file
#!/usr/bin/env node
|
|
/**
|
|
* C167 test double for ffmpeg: copies the `-i` input to the output path so the
|
|
* cut pipeline can run without a real encoder (the developer machine has none).
|
|
* `FAKE_FFMPEG_FAIL=1` makes it exit 1; `FAKE_FFMPEG_LOG=<path>` records argv.
|
|
* The real binary is exercised by the `skipIf(!hasFfmpeg())` block (CI).
|
|
*/
|
|
import { copyFileSync, writeFileSync } from 'node:fs'
|
|
import { argv, env, exit } from 'node:process'
|
|
|
|
const args = argv.slice(2)
|
|
|
|
if (env.FAKE_FFMPEG_LOG) {
|
|
writeFileSync(env.FAKE_FFMPEG_LOG, JSON.stringify(args))
|
|
}
|
|
|
|
if (env.FAKE_FFMPEG_FAIL === '1') {
|
|
process.stderr.write('fake-ffmpeg: forced failure\n')
|
|
exit(1)
|
|
}
|
|
|
|
const inputIndex = args.indexOf('-i')
|
|
const input = inputIndex >= 0 ? args[inputIndex + 1] : undefined
|
|
const output = args.at(-1)
|
|
|
|
if (!input || !output) {
|
|
process.stderr.write('fake-ffmpeg: missing -i input or output path\n')
|
|
exit(2)
|
|
}
|
|
|
|
copyFileSync(input, output)
|