> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# coreav split

> Split an MP4 or MOV file at keyframes into MP4 segments, without re-encoding.

`coreav split INPUT OUTPUT` splits an MP4 or MOV file into MP4 segments by stream copy. Each cut is at the latest keyframe at or before a time you give: every `--every` seconds, or at each time of `--at`. Together the segments hold every packet of the kept streams exactly once.

`OUTPUT` is a file name with `%d` (or `%03d` for three digits), which becomes the segment number from 0. The summary is [`coreav.split/1`](https://github.com/coreav-dev/coreav/blob/main/docs/schema/split-v1.md).

## Examples

```sh theme={null}
coreav split --every 10 input.mp4 'seg-%03d.mp4'
coreav split --at 10,25.5 input.mp4 'part-%d.mp4'
```

## Options

```text theme={null}
Split an MP4/MOV file at keyframes into MP4 segments, without re-encoding. Together the segments hold every packet of the kept streams exactly once

Usage: coreav split [OPTIONS] <INPUT> <OUTPUT>

Arguments:
  <INPUT>   The file to split
  <OUTPUT>  Where to write the segments: a name with `%d`, or `%03d` for three digits, replaced by the segment number from 0 (for example `seg-%03d.mp4`)

Options:
      --every <SECONDS>      Cut at the latest keyframe at or before every multiple of this many seconds (for example `10`)
      --at <TIMES>           Cut at the latest keyframe at or before each of these times, in increasing seconds, comma separated (for example `10,25.5`)
      --video <STREAM>       The video stream index (default: the first video stream)
      --audio <STREAM|none>  The audio stream index, or `none` (default: the first audio stream)
      --allow <CODEC>        Codecs to accept, comma separated, as for `coreav probe`
      --strict               Reject the whole file when a stream's codec is not allowed
      --force                Overwrite segment files that exist (a symbolic link is replaced, not written through; a new file keeps the old one's permissions)
  -h, --help                 Print help
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.