mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-17 15:24:19 +00:00
feat(core): lighter preview copies of heavy videos below full quality (#6365)
* feat(core): tell which video files deserve a lighter preview copy, and at which size * feat(studio-server): serve lighter copies of heavy playable files, a keyframe every second * feat(core): the preview plays lighter copies of heavy videos below full quality * style: shorten two comments * style: shorten a comment * style: shorten a comment * fix(core): format the preview quality files and split the copy sizing for the complexity gate * style: format the studio-server preview files * fix(core): type the copy job's level as a preview quality * chore(producer): raise the package size budget for the preview runtime growth
This commit is contained in:
@@ -35,7 +35,7 @@ import { mkdirWithinProject, realpath, realProjectRoot } from "./safePath.js";
|
||||
* dropped from the queue or its ffmpeg is killed.
|
||||
*/
|
||||
|
||||
export const PROXY_PARAMS_VERSION = "v6";
|
||||
export const PROXY_PARAMS_VERSION = "v7";
|
||||
|
||||
export const CACHE_DIR_NAME = ".transcode-cache";
|
||||
|
||||
@@ -595,6 +595,7 @@ async function encodeInChunks(
|
||||
for (const piece of pieces) if (existsSync(piece)) unlinkSync(piece);
|
||||
}
|
||||
|
||||
const KEYFRAME_EVERY_SECOND_ARGS = ["-force_key_frames", "expr:gte(t,n_forced*1)"];
|
||||
// Fixed recipe; changing either array means bumping PROXY_PARAMS_VERSION.
|
||||
const H264_ARGS = [
|
||||
"-c:v",
|
||||
@@ -717,6 +718,7 @@ async function runFfmpeg(
|
||||
...(range ? ["-t", String(range.lengthSeconds)] : []),
|
||||
"-vf",
|
||||
videoFilter,
|
||||
...KEYFRAME_EVERY_SECOND_ARGS,
|
||||
...(keepsAlpha ? [...VP8_ARGS, ...vp8Threads(range ? gate.size : 1)] : H264_ARGS),
|
||||
target,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user