> For AI agents: the complete documentation index is available at https://www.tteam.icu/llms.txt, the full documentation bundle is available at https://www.tteam.icu/llms-full.txt.

# ffmpeg

## Docker 一键运行

```bash
docker run --rm -it -v ./:/tmp linuxserver/ffmpeg \
-i /tmp/1.flv -ss 00:05:00 -c:v copy -c:a copy /tmp/3.flv
```

## TS 转 FLV

```bash
docker run --rm -it -v ./:/tmp linuxserver/ffmpeg \
-i /tmp/1.ts -c:v copy -c:a copy /tmp/19.flv
```

## 切割

从 50 分钟开始截取 5 分钟:

```bash
docker run --rm -it -v ./:/tmp linuxserver/ffmpeg \
-ss 00:50:00 -i /tmp/1.mp4 -t 00:05:00 -c copy '/tmp/2.mp4'
```

## 转换音频为 FLAC

```bash
docker run --rm -it -v ./:/tmp linuxserver/ffmpeg \
-i /tmp/1.mp4 \
-vn -acodec flac \
/tmp/audio.flac
```

## 合成多个视频

先新建一个 txt 文件:

```
file '1.flv'
file '2.flv'
file '3.flv'
```

```bash
docker run --rm -it -v ./:/tmp linuxserver/ffmpeg \
-f concat -i 1.txt -c copy output.mkv
```

```bash
# 旋转 180 度
ffmpeg -i 1.mp4 -c copy -metadata:s:v:0 rotate=180 2.mp4
# 压缩
ffmpeg  -i 1.mp4  -s 1920x1080  2.mp4
```

```bash
# 剪辑视频
ffmpeg.exe -i 1.flv -ss 00:00:00 -to 00:45:08 -c:v copy -c:a copy 2.flv
```
