MCPcopy
hub / github.com/huggingface/transformers.js / constructor

Method constructor

packages/transformers/src/utils/video.js:20–27  ·  view source on GitHub ↗

* @param {RawVideoFrame[]|RawImage[]} frames * @param {number} duration

(frames, duration)

Source from the content-addressed store, hash-verified

18 * @param {number} duration
19 */
20 constructor(frames, duration) {
21 if (frames.length > 0 && frames[0] instanceof RawImage) {
22 // Assume uniform timestamps
23 frames = frames.map((image, i) => new RawVideoFrame(image, ((i + 1) / (frames.length + 1)) * duration));
24 }
25 this.frames = /** @type {RawVideoFrame[]} */ (frames);
26 this.duration = duration;
27 }
28
29 get width() {
30 return this.frames[0].image.width;

Callers

nothing calls this directly

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected