Skip to content

MP4

An input type that allows the smelter to read static MP4 files.

mp4InputExample.tsx
import Smelter from "@swmansion/smelter-node";
async function run() {
const smelter = new Smelter();
await smelter.init();
await smelter.registerInput("example", {
type: "mp4",
serverPath: "./input.mp4"
});
}
void run();

RegisterMp4Input

import { RegisterMp4Input } from "@swmansion/smelter"

Parameters for an input stream from MP4 file. You need to specify either a url or a serverPath.

Type definitions

type RegisterMp4Input = {
url?: string;
serverPath?: string;
loop?: bool;
required?: bool;
offsetMs?: f64;
}

Properties

url

URL of the MP4 file.

  • Type: string

serverPath

Path to the MP4 file, specifying its location on the server where the Smelter is deployed.

  • Type: string

loop

Specifies whether the input should be played in a loop.

  • Type: boolean
  • Default value: false

required

Determines if the input stream is essential for output frame production. If set to true and the stream is delayed, Smelter will postpone output frames until the stream is received.

  • Type: boolean
  • Default value: false

offsetMs

Offset in milliseconds relative to the pipeline start (start request). If unspecified, the stream synchronizes based on the delivery time of the initial frames.

  • Type: number