Allow negative trim ranges for conversion, add OutputFormat.supportsTimestampedMediaData

This commit is contained in:
Vanilagy
2026-02-11 15:56:51 +01:00
parent 417c85d8ed
commit 4fae45ec40
4 changed files with 66 additions and 10 deletions
+13
View File
@@ -367,6 +367,19 @@ If only `start` is set, the clip will run until the end of the input file. If on
Note that when using the trimming defaults, the resulting media file will always begin at timestamp 0. If your input file has a start time offset (like is common with MPEG-TS files) and you want to retain that, use `trim: { start: 0 }` to ensure timestamps don't get shifted.
---
You can even use negative trimming values to offset the start of the media:
```ts
const conversion = await Conversion.init({
// ...
trim: {
start: -2, // Two seconds of no media data (freeze frame / silence) at the start
},
// ...
});
```
## Metadata tags
By default, any [descriptive metadata tags](../api/MetadataTags.md) of the input will be copied to the output. If you want to further control the metadata tags written to the output, you can use the `tags` options: