# FFmpeg

{% embed url="<https://www.ffmpeg.org/>" %}

下載: <https://www.ffmpeg.org/download.html>

## 剪輯影片

> 有其影片如果只剪輯前三秒會有誤差

```
 ffmpeg -ss 00:01:00 -i input.mp4 -to 00:02:00 -c copy output.mp4
```

{% embed url="<https://stackoverflow.com/questions/18444194/cutting-the-videos-based-on-start-and-end-time-using-ffmpeg>" %}

## 合併影片

先新增一個 vidlist.txt 裡面要放合併的影片列表

```
file 'output0.mkv'
file 'output.mkv'
```

```
ffmpeg -f concat -i vidlist.txt -c copy out.mp4
```

<https://stackoverflow.com/a/49373401/4622645>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://easonwang.gitbook.io/web_advance/ffmpeg.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
