core icon indicating copy to clipboard operation
core copied to clipboard

Timestamps must be monotonically increasing on Firefox

Open fax1ty opened this issue 1 year ago • 0 comments

Error:

Uncaught Error: Timestamps must be monotonically increasing (DTS went from 440000 to 400000).

Code:

import * as core from "@diffusionstudio/core";
import { DotFilter } from "pixi-filters";
import videoFile from "/1.mp4?url";

const d1 = Date.now();
const source = await core.VideoSource.from(videoFile);

const video = new core.VideoClip(source, { filters: [new DotFilter()] })
  .subclip(0, 160);

const text = new core.TextClip({
  text: "Very own text",
  position: "center",
  stop: 80,
  stroke: { color: "#000000" },
});

const composition = new core.Composition({ backend: "webgl" });

await composition.add(video);
await composition.add(text);

const encoder = new core.Encoder(composition, { fps: 25 });
encoder.on("render", ({ detail }) =>
  console.log(
    `[RENDERING:progress] Processed frame #${detail.progress} out of ${detail.total}`
  )
);
encoder.on("error", ({ detail }) => console.error(detail));
await encoder.render();
const d2 = Date.now();
console.log(`[RENDERING:done] Served video in ${d2 - d1}ms`);

Environment: Ubuntu 22.04, Playwright, Firefox 132.0

    firefoxUserPrefs: {
      "gfx.webgpu.force-enabled": true,
      "gfx.webrender.all": true,
      "media.ffmpeg.vaapi.enabled": true,
      "webgl.force-enabled": true,
    }

Related: https://github.com/Vanilagy/mp4-muxer/issues/25

Corrupted output:

https://github.com/user-attachments/assets/32367853-d7f7-4be2-8e02-0ab026ccade4

fax1ty avatar Nov 30 '24 10:11 fax1ty