KEMBAR78
Ffmpeg | PDF | Computers
0% found this document useful (0 votes)
47 views2 pages

Ffmpeg

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views2 pages

Ffmpeg

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

To cut a video using `ffmpeg`, you can use the `-ss`, `-t`, and `-c` options to specify the

start time,
duration, and codec. Here's a basic example:

1. **Cut a video from a start time to an end time**:

```sh

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

```

- `-i input.mp4`: Input file.

- `-ss 00:01:00`: Start time (in this example, 1 minute).

- `-to 00:02:00`: End time (in this example, 2 minutes).

- `-c copy`: Copy the stream without re-encoding (faster and keeps original quality).

2. **Cut a video with a specific duration**:

```sh

ffmpeg -i input.mp4 -ss 00:01:00 -t 00:01:00 -c copy output.mp4

```

- `-t 00:01:00`: Duration of 1 minute starting from the `-ss` time.

3. **Re-encode the cut video** (if you need to re-encode):

```sh

ffmpeg -i input.mp4 -ss 00:01:00 -to 00:02:00 -c:v libx264 -c:a aac output.mp4
```

- `-c:v libx264`: Encode the video stream with H.264 codec.

- `-c:a aac`: Encode the audio stream with AAC codec.

These commands give you flexibility depending on whether you want to keep the original quality or re-
encode the video. Adjust the times and file names as needed for your specific use case.

You might also like