mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
* refactor: extract media understanding common package * test: move media understanding format test
12 lines
429 B
JavaScript
12 lines
429 B
JavaScript
import { DEFAULT_VIDEO_MAX_BASE64_BYTES } from "./defaults.mjs";
|
|
//#region packages/media-understanding-common/src/video.ts
|
|
function estimateBase64Size(bytes) {
|
|
return Math.ceil(bytes / 3) * 4;
|
|
}
|
|
function resolveVideoMaxBase64Bytes(maxBytes) {
|
|
const expanded = Math.floor(maxBytes * (4 / 3));
|
|
return Math.min(expanded, DEFAULT_VIDEO_MAX_BASE64_BYTES);
|
|
}
|
|
//#endregion
|
|
export { estimateBase64Size, resolveVideoMaxBase64Bytes };
|