knowledge_map/linux/ffmpeg 常用指令.md
2024-11-16 14:33:59 +08:00

24 lines
671 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### 低延迟拉流播放
```bash
ffplay -fflags nobuffer -flags low_delay -i "rtmp://120.26.0.57:1935/live/osdk_"
```
### 拉流保存
```bash
ffmpeg -i "rtmp://120.26.0.57:1935/live/osdk_" -c copy lynxi_ai.mp4
```
### 视频截取
``` bash
# 00:00:30 开始时间20 截取长度
ffmpeg -ss 00:00:30 -i example.mp4 -t 20 -c copy output.mp4
```
### 视频抽帧
```sh
# i input_video.mp4指定输入视频文件。
# -vf "fps=1":使用视频过滤器 (vf),以 1 帧每秒的速率抽取帧。
# output_%04d.png输出文件名格式`%04d` 会生成四位数字的序号,例如 output_0001.png
ffmpeg -i input_video.mp4 -vf "fps=1" output_%04d.png
```