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
|
||||
- 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
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user