import type { M3u8ContainerType } from '../types/m3u8.js'; /** * 依据 url 后缀推断分片容器类型。 * 无法识别时返回 `unknown`(调用方一般按 MPEG-TS 处理以保持向后兼容) */ export declare function detectContainerType(uri?: string): M3u8ContainerType; /** * 依据文件头魔数判断容器类型: * - ISO-BMFF(box size + box type)→ `fmp4` * - 0x47 同步字节(188/192/204 字节包长)→ `ts` */ export declare function detectContainerByHeader(buffer: Buffer | Uint8Array): M3u8ContainerType; /** * 读取本地文件头部判断容器类型。 * 只读取文件头部若干字节,避免将整个大分片文件读入内存 */ export declare function detectContainerByFile(filepath: string, size?: number): M3u8ContainerType; /** 分片缓存文件的扩展名 */ export declare function getSegmentExt(container?: M3u8ContainerType): ".m4s" | ".ts"; /** * 最终输出文件的扩展名。 * fMP4 即使没有 ffmpeg 也可以直接二进制拼接为可播放的 mp4; * MPEG-TS 在没有 ffmpeg 时只能拼接为 ts */ export declare function getOutputExt(container?: M3u8ContainerType, ffmpegSupport?: boolean): ".mp4" | ".ts";