Loading...
Loading...
Compare original and translation side by side
undefinedundefinedundefinedundefinedundefinedundefined
**Supported Formats:**
| Format | Video Codec | Audio Codec | Notes |
|--------|-------------|-------------|-------|
| MP4 | libx264 | AAC | Best compatibility |
| MOV | libx264 | AAC | Apple formats |
| WebM | libvpx-vp9 | Opus | Web optimized |
| MKV | libx264 | AAC | Matroska container |
| AVI | libx264 | AAC | Older format support |
| MP3 | - | libmp3lame | Audio only |
| AAC | - | AAC | Apple audio |
| OGG | - | libvorbis | Open format |
| FLAC | - | FLAC | Lossless audio |
| WAV | - | pcm_s16le | Uncompressed |
**Quality Levels:**
| Level | CRF | Preset | Bitrate | Best For |
|-------|-----|--------|---------|----------|
| `low` | 28 | ultrafast | 800k | Archival/quick encode |
| `medium` | 23 | fast | 2M | Default/general use |
| `high` | 18 | slow | 5M | Quality preservation |
| `lossless` | 0 | veryslow | unlimited | Maximum quality |
**支持的格式:**
| 格式 | 视频编码 | 音频编码 | 说明 |
|--------|-------------|-------------|-------|
| MP4 | libx264 | AAC | 最佳兼容性 |
| MOV | libx264 | AAC | Apple格式 |
| WebM | libvpx-vp9 | Opus | 网页优化格式 |
| MKV | libx264 | AAC | Matroska容器格式 |
| AVI | libx264 | AAC | 支持旧格式 |
| MP3 | - | libmp3lame | 仅音频 |
| AAC | - | AAC | Apple音频格式 |
| OGG | - | libvorbis | 开源格式 |
| FLAC | - | FLAC | 无损音频 |
| WAV | - | pcm_s16le | 无压缩格式 |
**质量等级:**
| 等级 | CRF | 预设 | 比特率 | 适用场景 |
|-------|-----|--------|---------|----------|
| `low` | 28 | ultrafast | 800k | 归档/快速编码 |
| `medium` | 23 | fast | 2M | 默认/通用场景 |
| `high` | 18 | slow | 5M | 画质保留 |
| `lossless` | 0 | veryslow | unlimited | 最高画质 |undefinedundefined
**尺寸计算逻辑:**
工具会自动为目标大小计算最优比特率:
- 考虑音频轨道(128kbps AAC)
- 预留8%的空间用于容器开销
- 验证最低比特率的可行性
- 如果目标大小不可行,自动 fallback 到基于CRF的压缩方式
**Size Calculation:**
The tool automatically calculates optimal bit rates for target sizes:
- Accounts for audio track (128kbps AAC)
- Leaves 8% headroom for container overhead
- Validates minimum bit rate feasibility
- Falls back to CRF-based compression if size target is infeasibleundefinedundefined
**支持的时间格式:**
- 秒:`30`, `90.5`
- 分:秒:`1:30`, `2:45.5`
- 时:分:秒:`01:30:00`, `00:02:15`
**Time Formats Supported:**
- Seconds: `30`, `90.5`
- Minutes:Seconds: `1:30`, `2:45.5`
- Hours:Minutes:Seconds: `01:30:00`, `00:02:15`undefinedundefinedundefinedundefinedundefinedundefined
**要求:**
- 所有输入文件必须使用相同的编码和分辨率
- 音频流必须兼容
- 文件将按提供的顺序拼接
**Requirements:**
- All inputs must have same codec and resolution
- Audio streams must be compatible
- Files will be concatenated in order providedundefinedundefined
**缩放选项:**
- `--width <像素>`:按宽度缩放,高度自动计算
- `--height <像素>`:按高度缩放,宽度自动计算
- `--scale <比例>`:按比例缩放(0.5表示缩小一半)
**Scaling Options:**
- `--width <pixels>`: Scale to width, height calculated automatically
- `--height <pixels>`: Scale to height, width calculated automatically
- `--scale <factor>`: Scale both dimensions (0.5 = half size)undefinedundefined
**示例输出:**undefined
**Sample Output:**undefined⏳ 转换进度:45.2% | 当前帧1247@23.5fps | 已耗时:00:00:53 | 预计剩余时间:00:01:04⏳ Converting: 45.2% | Frame 1247@23.5fps | Elapsed: 00:00:53 | ETA: 00:01:04| 代码 | 名称 | 描述 |
|---|---|---|
| 0 | SUCCESS | 操作成功完成 |
| 1 | INVALID_INPUT | 参数缺失或无效 |
| 2 | FILE_NOT_FOUND | 输入文件不存在 |
| 3 | PERMISSION_DENIED | 无法读取/写入文件 |
| 4 | DISK_FULL | 磁盘空间不足 |
| 5 | INVALID_FORMAT | 指定了不支持的格式 |
| 6 | FFMPEG_ERROR | FFmpeg执行失败 |
| 7 | TIMEOUT | 操作超出时长限制 |
| 8 | INTERRUPTED | 被用户信号中断 |
| 9 | VALIDATION_FAILED | 操作前验证检查失败 |
| 99 | UNKNOWN | 发生未知错误 |
| Code | Name | Description |
|---|---|---|
| 0 | SUCCESS | Operation completed successfully |
| 1 | INVALID_INPUT | Missing or invalid parameters |
| 2 | FILE_NOT_FOUND | Input file does not exist |
| 3 | PERMISSION_DENIED | Cannot read/write files |
| 4 | DISK_FULL | Insufficient disk space |
| 5 | INVALID_FORMAT | Unsupported format specified |
| 6 | FFMPEG_ERROR | FFmpeg execution failed |
| 7 | TIMEOUT | Operation exceeded time limit |
| 8 | INTERRUPTED | Interrupted by user signal |
| 9 | VALIDATION_FAILED | Pre-operation validation check failed |
| 99 | UNKNOWN | Unexpected error occurred |
infoinfo| 格式 | 编码 | 说明 |
|---|---|---|
| MP3 | LAME | -q:a 2 参数对应320kbps可变比特率 |
| AAC | Apple/AAC | 极佳的兼容性 |
| Opus | libopus | 最佳压缩质量 |
| Vorbis | libvorbis | 开源格式替代方案 |
| FLAC | FLAC | 无损归档格式 |
| Format | Codec | Notes |
|---|---|---|
| MP3 | LAME | -q:a 2 for 320kbps VBR |
| AAC | Apple/AAC | Excellent compatibility |
| Opus | libopus | Best compression quality |
| Vorbis | libvorbis | Open format alternative |
| FLAC | FLAC | Lossless archival |
{baseDir}/ffmpeg.js convert video.mov --output out.mp4 --quality low{baseDir}/ffmpeg.js convert video.mov --output out.mp4 --quality lowfor f in *.mov; do
{baseDir}/ffmpeg.js convert "$f" --output "${f%.mov}.mp4" --quality medium
donefor f in *.mov; do
{baseDir}/ffmpeg.js convert "$f" --output "${f%.mov}.mp4" --quality medium
doneundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined#!/bin/bash
for video in *.mov *.avi; do
[ -f "$video" ] || continue
base="${video%.*}"
echo "正在转换: $video"
{baseDir}/ffmpeg.js convert "$video" --output "${base}.webm" --quality low
done#!/bin/bash
for video in *.mov *.avi; do
[ -f "$video" ] || continue
base="${video%.*}"
echo "Converting: $video"
{baseDir}/ffmpeg.js convert "$video" --output "${base}.webm" --quality low
done