初始文档

This commit is contained in:
2026-01-14 11:27:47 +08:00
parent 84a58e8daf
commit 564285cf07
62 changed files with 8729 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
## 视频压缩
```sh
# 以h264编码
ffmpeg -i "input.mp4" -c:v libx264 -tag:v avc1 -movflags faststart -crf 30 -preset superfast "output.mp4"
# 以h265编码
ffmpeg -i input.mp4 -c:v hevc_nvenc -cq 23 -preset slow -c:a copy output.mp4
```
## 视频转码
```sh
ffmpeg -hwaccel nvdec -i test.mp4 -c:v h264_nvenc -preset slow -crf 23 -c:a aac test2.mp4
# -hwaccel nvdec使用硬件解码器nvdec(gpu解码)
# -i test.mp4 输入文件
# -c:v h264_nvenc 使用硬件编码器h264_nvenc或hevc_nvenc
# -preset slow`设置编码速度与压缩率的平衡(可选值:`slow`, `medium`, `fast`等)。
# -crf 23 控制视频质量范围0-51值越小质量越高
# -c:a aac 使用AAC音频编码器
# test2.mp4输出文件
```