mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-15 15:25:16 +03:00
fix(web-test): correct video color range for H.264 players
JPEG full range (0-255) was tagged as pc/full in H.264 output, but most players (VLC, etc.) expect limited range (16-235). Convert JPEG→limited with scale filter and tag as tv. Also switch preset ultrafast→fast for 5-6x smaller files on static screen content. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2455,9 +2455,11 @@ export async function startRecording(outputPath, opts = {}) {
|
|||||||
'-framerate', String(fps), // input framerate
|
'-framerate', String(fps), // input framerate
|
||||||
'-i', '-', // read from stdin
|
'-i', '-', // read from stdin
|
||||||
'-c:v', 'libx264', // H.264 codec
|
'-c:v', 'libx264', // H.264 codec
|
||||||
'-preset', 'ultrafast', // fast encoding
|
'-preset', 'fast', // good quality/speed balance
|
||||||
|
'-crf', '23', // default quality (good for screen content)
|
||||||
|
'-vf', 'scale=in_range=full:out_range=limited', // JPEG full→H.264 limited range
|
||||||
'-pix_fmt', 'yuv420p', // broad compatibility
|
'-pix_fmt', 'yuv420p', // broad compatibility
|
||||||
'-color_range', 'pc', // full range (0-255) — match JPEG input
|
'-color_range', 'tv', // limited range (16-235) — standard for H.264 players
|
||||||
'-movflags', '+faststart', // web-friendly MP4
|
'-movflags', '+faststart', // web-friendly MP4
|
||||||
resolvedPath
|
resolvedPath
|
||||||
], { stdio: ['pipe', 'ignore', 'pipe'] });
|
], { stdio: ['pipe', 'ignore', 'pipe'] });
|
||||||
|
|||||||
Reference in New Issue
Block a user