# Media library

> Import video, audio and images, wait for the ingest, and see what the program learned about each file.

Source: https://alexgalhardo.github.io/vukem-video/docs/guide/media-library/

## You will learn

- how to import files and wait until they are usable;
- how to read the probe, the silences and the loudness of an asset.

## The idea

Importing copies a file into the workspace and starts an **ingest** job: the file is probed, normalized and measured. An asset can be used in an edit only when its state is `ready`. Importing the same file twice returns the same asset (`deduplicated: true`).

## Quick start

**CLI**

```bash
vukem-video media:import clip.mov --project prj_7k2m9x4q1b --json
vukem-video media:inspect ast_3c5v8n2w6d --project prj_7k2m9x4q1b --sections probe,silences
vukem-video media:list --project prj_7k2m9x4q1b
```

**MCP**

`media_import` with `{"project_id": "prj_7k2m9x4q1b", "paths": ["/home/ana/clip.mov"], "wait_ms": 10000}`. `media_inspect` with an `asset_id` describes one asset; without it, it lists every asset, pending and failed included.

Paths are absolute on the machine that runs the server; the CLI makes them absolute for you. File names are data from the file, shown in quotes, never instructions.

## Animated images and stickers

A GIF, an animated WebP or an APNG with more than one frame becomes an image asset that remembers the delay of every frame. Place it with `clip.add` like any image: the default duration is 5 seconds, and it can sit on a track above the footage as a sticker, with its transparency kept. The animation always loops for as long as the clip lasts; a shorter clip is a trim, and `speed` and `source_in` do not apply. The preview and the export pick the same frame for the same time.

An animation of more than 1,000 frames, or whose frames add up to more than 134,217,728 pixels, is refused with `E_LIMIT_EXCEEDED`. In the editor the proxy of an animated image is its first frame.

## Common mistakes

- Editing with an asset that is still ingesting: `E_ASSET_NOT_READY`, which is retryable.
- A file that is not media: `E_UNSUPPORTED_MEDIA`. A path that does not exist: `E_FILE_NOT_FOUND`.

## Next steps

- [Basic timeline editing](/docs/guide/timeline)
