halfsize

v0.2.0
io.github.YKLovePython/halfsize Checked 9 hours ago Published 12 days ago

Compress a video to an exact byte size locally with FFmpeg, then measure VMAF and SSIM.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

compress_video Compress a video to an exact size

Compress a local video file to a target size (for example 20mb for Discord or WeChat, 16mb for WhatsApp, 18mb for email) and return the measured quality loss (VMAF/SSIM). Runs entirely on this machine: nothing is uploaded. Use it when a video will not fit through an upload limit.

ParameterTypeDescription
input *stringPath to the local video file.
target *stringTarget size, e.g. 20mb, 16mb, 800k, 1.5gb. No unit means MB.
codecstringh264 (default) or h265 (smaller).
dryRunbooleanOnly return the plan (bitrate, resolution, warnings) without encoding.
outputstringOutput path. Defaults to <input>.<target>.mp4 next to the input.
verifybooleanMeasure VMAF/SSIM after encoding. Defaults to true; false is faster.