Fix tests and elaborate on point in docs

This commit is contained in:
Vanilagy
2026-01-19 14:11:02 +01:00
parent dbaaea255c
commit 277290abe3
3 changed files with 8 additions and 3 deletions
+2
View File
@@ -365,6 +365,8 @@ In this case, the output will be 15 seconds long.
If only `start` is set, the clip will run until the end of the input file. If only `end` is set, the clip will start at the beginning of the input file.
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.
## 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:
+5 -2
View File
@@ -239,7 +239,6 @@ test('MPEG-TS muxing with HEVC and MP3', async () => {
let isFirstVideo = true;
let videoPacketCountWritten = 0;
for await (const packet of hevcSink.packets()) {
console.log(packet.timestamp);
if (packet.timestamp >= duration) break;
await videoSource.add(packet, {
@@ -620,7 +619,11 @@ test('MPEG-TS transmux (Annex B and ADTS passthrough)', async () => {
target: new BufferTarget(),
});
const conversion = await Conversion.init({ input, output });
const conversion = await Conversion.init({
input,
output,
trim: { start: 0 }, // So we maintain the timestamps
});
expect(conversion.isValid).toBe(true);
await conversion.execute();
+1 -1
View File
@@ -482,7 +482,7 @@ test('MPEG-TS with unknown file size (ReadableStreamSource)', async () => {
.toBeGreaterThanOrEqual(10);
});
test('MPEG-TS transmuxed by FFmpeg', async () => {
test('MPEG-TS transmuxed by FFmpeg', { timeout: 30_000 }, async () => {
using input = new Input({
source: new UrlSource('https://pub-cf9fcfcb5c0a44e9b1bb5ff890e041ae.r2.dev/trim-buck-bunny-ffmpeg.ts'),
formats: ALL_FORMATS,