From 63145c9cedd4a6ea1b1ee8779d921cb632ba8d5f Mon Sep 17 00:00:00 2001 From: Vanilagy <1696106+Vanilagy@users.noreply.github.com> Date: Sun, 21 Sep 2025 23:41:10 +0200 Subject: [PATCH] Improve docs --- docs/guide/introduction.md | 1 + docs/guide/quick-start.md | 15 +++++++++++++++ src/source.ts | 3 +++ 3 files changed, 19 insertions(+) diff --git a/docs/guide/introduction.md b/docs/guide/introduction.md index f687db8..da8aa3e 100644 --- a/docs/guide/introduction.md +++ b/docs/guide/introduction.md @@ -18,6 +18,7 @@ Here's a long list of stuff this library does: - Input and output streaming, arbitrary file size support - File location independence (memory, disk, network, ...) - Utilities for compression, resizing, rotation, cropping, resampling, trimming +- Metadata tag reading & writing (title, artist, cover art, custom tags, attached files, etc.) - Transmuxing and transcoding - Microsecond-accurate reading and writing precision - Efficient seeking through time diff --git a/docs/guide/quick-start.md b/docs/guide/quick-start.md index a11933f..94094f1 100644 --- a/docs/guide/quick-start.md +++ b/docs/guide/quick-start.md @@ -33,6 +33,14 @@ if (audioTrack) { audioTrack.numberOfChannels; audioTrack.sampleRate; // in Hz } + +// Extract metadata tags +const tags = await input.getMetadataTags(); +tags.title; // Title +tags.date; // Release date +tags.images[0]; // Cover art +tags.raw['TBPM']; // Custom tags +// ... ``` ::: info @@ -242,6 +250,12 @@ const audioSource = new AudioBufferSource({ }); output.addAudioTrack(audioSource); +// Set some metadata tags +output.setMetadataTags({ + title: 'My Movie', + artist: 'Me', +}); + await output.start(); // Add some video frames @@ -512,6 +526,7 @@ const conversion = await Conversion.init({ start: 0, end: 60, }, + tags: {}, // Remove any metadata tags }); await conversion.execute(); diff --git a/src/source.ts b/src/source.ts index 28876ce..aff7275 100644 --- a/src/source.ts +++ b/src/source.ts @@ -531,6 +531,9 @@ export type FilePathSourceOptions = { /** * A source backed by a path to a file. Intended for server-side usage in Node, Bun, or Deno. + * + * Make sure to call `.dispose()` on the corresponding {@link Input} when done to explicitly free the internal file + * handle acquired by this source. * @group Input sources * @public */