mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 10:53:50 +02:00
Improve docs
This commit is contained in:
@@ -18,6 +18,7 @@ Here's a long list of stuff this library does:
|
|||||||
- Input and output streaming, arbitrary file size support
|
- Input and output streaming, arbitrary file size support
|
||||||
- File location independence (memory, disk, network, ...)
|
- File location independence (memory, disk, network, ...)
|
||||||
- Utilities for compression, resizing, rotation, cropping, resampling, trimming
|
- Utilities for compression, resizing, rotation, cropping, resampling, trimming
|
||||||
|
- Metadata tag reading & writing (title, artist, cover art, custom tags, attached files, etc.)
|
||||||
- Transmuxing and transcoding
|
- Transmuxing and transcoding
|
||||||
- Microsecond-accurate reading and writing precision
|
- Microsecond-accurate reading and writing precision
|
||||||
- Efficient seeking through time
|
- Efficient seeking through time
|
||||||
|
|||||||
@@ -33,6 +33,14 @@ if (audioTrack) {
|
|||||||
audioTrack.numberOfChannels;
|
audioTrack.numberOfChannels;
|
||||||
audioTrack.sampleRate; // in Hz
|
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
|
::: info
|
||||||
@@ -242,6 +250,12 @@ const audioSource = new AudioBufferSource({
|
|||||||
});
|
});
|
||||||
output.addAudioTrack(audioSource);
|
output.addAudioTrack(audioSource);
|
||||||
|
|
||||||
|
// Set some metadata tags
|
||||||
|
output.setMetadataTags({
|
||||||
|
title: 'My Movie',
|
||||||
|
artist: 'Me',
|
||||||
|
});
|
||||||
|
|
||||||
await output.start();
|
await output.start();
|
||||||
|
|
||||||
// Add some video frames
|
// Add some video frames
|
||||||
@@ -512,6 +526,7 @@ const conversion = await Conversion.init({
|
|||||||
start: 0,
|
start: 0,
|
||||||
end: 60,
|
end: 60,
|
||||||
},
|
},
|
||||||
|
tags: {}, // Remove any metadata tags
|
||||||
});
|
});
|
||||||
|
|
||||||
await conversion.execute();
|
await conversion.execute();
|
||||||
|
|||||||
@@ -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.
|
* 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
|
* @group Input sources
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user