effect-motion
API ReferenceexportNamespacesFfmpegFunctions

encode

function encode(

Function: encode()

function encode(
   pngStream,
   outPath,
options): Effect<void, EncodeError, ChildProcessSpawner>;

Defined in: packages/export/src/Ffmpeg.ts:236

Encode a stream of PNG frames into a video file at outPath.

Pipes the PNG bytes into ffmpeg's stdin via the image2pipe demuxer; when the stream ends, stdin closes and ffmpeg finalizes the file. A nonzero exit or an unspawnable binary fails with a tagged EncodeError.

Parameters

ParameterType
pngStreamStream<Uint8Array<ArrayBufferLike>>
outPathstring
optionsEncodeOptions

Returns

Effect<void, EncodeError, ChildProcessSpawner>

On this page