frameflow
Version:
Audio/Video stream processing library for JavaScript world
46 lines (45 loc) • 1.28 kB
TypeScript
import { StreamRef } from "./types/graph";
export declare type FilterArgs<T extends Filter['type']> = Extract<Filter, {
type: T;
args: any;
}>['args'];
export declare type Filter = {
type: 'tracks';
args: 'video' | 'audio';
} | {
type: 'trim';
args: {
start: number;
duration: number;
};
} | {
type: 'setpts';
} | {
type: 'fifo';
} | {
type: 'volume';
args: number;
} | {
type: 'merge';
} | // implicit args: {number of inputs}
{
type: 'concat';
} | {
type: 'format';
args: {
pixelFormat?: string;
sampleFormat?: string;
sampleRate?: number;
channelLayout?: string;
};
};
/**
* valid `args` based on previous streams, then create FilterNodes (update streams metadata)
* @returns array of streamRef, ref to created FilterNodes' outStreams, or unchanged streamRefs.
*/
export declare function applySingleFilter(streamRefs: StreamRef[], filter: Filter): StreamRef[];
/**
* valid `args` based on previous streams, then create FilterNodes (update streams metadata)
* @returns array of streamRef, ref to created FilterNodes' outStreams, or unchanged streamRefs.
*/
export declare function applyMulitpleFilter(streamRefsArr: StreamRef[][], filter: Filter): StreamRef[];