Show small stitch-frame thumbs when a video collection is expanded.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -89,6 +89,24 @@ export async function extractLastFrame(inputPath: string, outputPath: string) {
|
||||
throw new Error('Could not extract the last frame. The video looks incomplete — interrupting Comfy mid-encode usually causes this. Earlier saved parts are still in the library.')
|
||||
}
|
||||
|
||||
export async function extractFirstFrame(inputPath: string, outputPath: string) {
|
||||
if (!existsSync(inputPath)) {
|
||||
throw new Error('Source video is missing')
|
||||
}
|
||||
await runFfmpeg([
|
||||
'-y',
|
||||
'-i', inputPath,
|
||||
'-frames:v', '1',
|
||||
'-update', '1',
|
||||
'-an',
|
||||
'-q:v', '4',
|
||||
outputPath
|
||||
], 20000)
|
||||
if (!existsSync(outputPath)) {
|
||||
throw new Error('Could not extract the first frame')
|
||||
}
|
||||
}
|
||||
|
||||
export async function probeHasAudio(filePath: string) {
|
||||
try {
|
||||
const out = await runFfprobe([
|
||||
|
||||
Reference in New Issue
Block a user