-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
5 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,11 +159,16 @@ ffmpeg -i input.mp4 -c copy -vn output.aac | |
|
||
## 添加文字 | ||
|
||
[`drawtext`](https://ffmpeg.org/ffmpeg-filters.html#drawtext-1) filter | ||
|
||
```shell | ||
style_str="fontfile=noto-sans.ttf:fontsize=36:fontcolor=white:shadowx=2:shadowy=2:shadowcolor=black" | ||
ffmpeg -i input.mp4 -vf "drawtext=text='hello world':x=60:y=60:$style_str" -crf 16 output.mp4 | ||
``` | ||
|
||
- `text` 参数里还可以使用变量,比如 `text=%{n}` 表示帧号,起始为 0(由另一个参数 `start_number` 控制) | ||
- `box` 参数可以给文字加背景框,`box=1:[email protected]:boxborderw=5` | ||
|
||
## GPU | ||
|
||
[Using FFmpeg with NVIDIA GPU Hardware Acceleration – NVIDIA Docs](https://docs.nvidia.com/video-technologies/video-codec-sdk/12.0/ffmpeg-with-nvidia-gpu/index.html#quality-testing) | ||
|