Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 07fb0a2

Browse files
committedApr 14, 2025·
add Chinese translation
1 parent 66a61f5 commit 07fb0a2

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
 

‎pages.zh/common/ffmpeg.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# ffmpeg
2+
3+
> 视频转换工具。
4+
> 更多信息:<https://ffmpeg.org>
5+
6+
- 从视频中提取音频并保存为 MP3 格式:
7+
8+
`ffmpeg -i {{path/to/video.mp4}} -vn {{path/to/sound.mp3}}`
9+
10+
- 将 FLAC 文件转码为红皮书 CD 格式(44100kHz,16位):
11+
12+
`ffmpeg -i {{path/to/input_audio.flac}} -ar 44100 -sample_fmt s16 {{path/to/output_audio.wav}}`
13+
14+
- 将视频保存为 GIF,设置高度为 1000 像素,帧率为 15:
15+
16+
`ffmpeg -i {{path/to/video.mp4}} {{[-vf|-filter:v]}} 'scale=-1:{{1000}}' -r {{15}} {{path/to/output.gif}}`
17+
18+
- 将编号图像(如 `frame_1.jpg``frame_2.jpg` 等)合成为视频或 GIF:
19+
20+
`ffmpeg -i {{path/to/frame_%d.jpg}} -f image2 {{video.mpg|video.gif}}`
21+
22+
- 从给定的开始时间 mm:ss 到结束时间 mm2:ss2 裁剪视频(省略 `-to` 参数表示裁剪至末尾):
23+
24+
`ffmpeg -i {{path/to/input_video.mp4}} -ss {{mm:ss}} -to {{mm2:ss2}} {{[-c|-codec]}} copy {{path/to/output_video.mp4}}`
25+
26+
- 将 AVI 视频转换为 MP4,AAC 音频码率为 128kbit,h264 视频使用 CRF 编码:
27+
28+
`ffmpeg -i {{path/to/input_video}}.avi {{[-c|-codec]}}:a aac -b:a 128k {{[-c|-codec]}}:v libx264 -crf 23 {{path/to/output_video}}.mp4`
29+
30+
- 将 MKV 视频重新转换为 MP4,无需重新编码音频或视频流:
31+
32+
`ffmpeg -i {{path/to/input_video}}.mkv {{[-c|-codec]}} copy {{path/to/output_video}}.mp4`
33+
34+
- 将 MP4 视频转换为 VP9 编解码器。为获得最佳质量,请使用 CRF 值(建议范围为 15-35),并且 -b:v 必须为 0:
35+
36+
`ffmpeg -i {{path/to/input_video}}.mp4 {{[-c|-codec]}}:v libvpx-vp9 -crf {{30}} -b:v 0 {{[-c|-codec]}}:a libopus -vbr on -threads {{number_of_threads}} {{path/to/output_video}}.webm`

0 commit comments

Comments
 (0)
Please sign in to comment.