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

# coreav sanitize

> Rewrite an MP4 or MOV file without its metadata, keeping only allowlisted boxes.

`coreav sanitize INPUT OUTPUT` rewrites an MP4 or MOV file as MP4 by stream copy, keeping only the boxes on an allowlist. That drops location, device, dates and other metadata. `--keep` chooses what survives: by default the rotation, the languages, the gapless playback data and the track roles. The summary is [`coreav.remux/1`](https://github.com/coreav-dev/coreav/blob/main/docs/schema/remux-v1.md), with the dropped boxes listed.

## Examples

```sh theme={null}
coreav sanitize upload.mp4 clean.mp4
coreav sanitize --keep none upload.mp4 clean.mp4
```

## Options

```text theme={null}
Rewrite an MP4/MOV file as MP4 without its metadata (location, device, dates), keeping only allowlisted boxes, without re-encoding

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

Arguments:
  <INPUT>   The file to rewrite
  <OUTPUT>  Where to write the MP4 file: a new file, or `-` for standard output

Options:
      --streams <STREAM>     Stream indexes to keep, comma separated (default: every stream MP4 can carry)
      --fail-on-unsupported  Fail instead of dropping a stream that MP4 cannot carry
      --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 OUTPUT if it exists (a symbolic link is replaced, not written through; the new file keeps the old one's permissions)
      --keep <FIELD>         What to keep, comma separated: `rotation`, `language`, `dates` (creation times), `gapless` (encoder delay and padding), `kinds` (track roles), or `none` [default: rotation,language,gapless,kinds]
  -h, --help                 Print help
```


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