Class: FilterGraph
Defined in: src/lib/filter-graph.ts:64
Filter graph for audio/video processing pipelines.
Manages a collection of interconnected filters forming a processing pipeline. Filters are connected through their input/output pads to create complex audio/video transformations. Supports both simple linear chains and complex graphs with multiple inputs/outputs. Essential for effects, format conversions, scaling, and other media processing operations.
Direct mapping to FFmpeg's AVFilterGraph.
Example
import { FilterGraph, Filter, FilterInOut, FFmpegError } from 'node-av';
// Create and configure filter graph
const graph = new FilterGraph();
graph.alloc();
// Create filters
const bufferSrc = graph.createFilter(
Filter.getByName('buffer')!,
'src',
'video_size=1920x1080:pix_fmt=yuv420p'
);
const scale = graph.createFilter(
Filter.getByName('scale')!,
'scale',
'640:480'
);
const bufferSink = graph.createFilter(
Filter.getByName('buffersink')!,
'sink'
);
// Link filters
bufferSrc.link(0, scale, 0);
scale.link(0, bufferSink, 0);
// Configure graph
const ret = await graph.config();
FFmpegError.throwIfError(ret, 'config');
// Parse filter string
const ret2 = graph.parse2('[in]scale=640:480[out]');
FFmpegError.throwIfError(ret2, 'parse2');
See
- AVFilterGraph - FFmpeg Doxygen
- FilterContext For filter instances
- Filter For filter descriptors
Extends
Implements
Disposable
NativeWrapper
<NativeFilterGraph
>
Constructors
Constructor
new FilterGraph():
FilterGraph
Defined in: src/lib/filter-graph.ts:65
Returns
FilterGraph
Overrides
OptionMember<NativeFilterGraph>.constructor
Properties
native
protected
native:NativeFilterGraph
Defined in: src/lib/option.ts:999
Inherited from
Accessors
filters
Get Signature
get filters():
null
|FilterContext
[]
Defined in: src/lib/filter-graph.ts:87
Array of filters in the graph.
All filter contexts currently in the graph.
Direct mapping to AVFilterGraph->filters.
Returns
null
| FilterContext
[]
nbFilters
Get Signature
get nbFilters():
number
Defined in: src/lib/filter-graph.ts:76
Number of filters in the graph.
Total count of filter contexts in this graph.
Direct mapping to AVFilterGraph->nb_filters.
Returns
number
nbThreads
Get Signature
get nbThreads():
number
Defined in: src/lib/filter-graph.ts:117
Number of threads for parallel processing.
Number of threads used for filter execution. 0 means automatic detection.
Direct mapping to AVFilterGraph->nb_threads.
Returns
number
Set Signature
set nbThreads(
value
):void
Defined in: src/lib/filter-graph.ts:121
Parameters
value
number
Returns
void
scaleSwsOpts
Get Signature
get scaleSwsOpts():
null
|string
Defined in: src/lib/filter-graph.ts:132
Swscale options for scale filter.
Options string passed to swscale for scaling operations.
Direct mapping to AVFilterGraph->scale_sws_opts.
Returns
null
| string
Set Signature
set scaleSwsOpts(
value
):void
Defined in: src/lib/filter-graph.ts:136
Parameters
value
null
| string
Returns
void
threadType
Get Signature
get threadType():
AVFilterConstants
Defined in: src/lib/filter-graph.ts:101
Threading type for graph execution.
Controls how filters are executed in parallel. Use AVFILTER_THREAD_SLICE for slice-based threading.
Direct mapping to AVFilterGraph->thread_type.
Returns
Set Signature
set threadType(
value
):void
Defined in: src/lib/filter-graph.ts:105
Parameters
value
Returns
void
Methods
[dispose]()
[dispose]():
void
Defined in: src/lib/filter-graph.ts:678
Dispose of the filter graph.
Implements the Disposable interface for automatic cleanup. Equivalent to calling free().
Returns
void
Example
{
using graph = new FilterGraph();
graph.alloc();
// Build and use graph...
} // Automatically freed when leaving scope
Implementation of
Disposable.[dispose]
alloc()
alloc():
void
Defined in: src/lib/filter-graph.ts:160
Allocate a filter graph.
Allocates memory for the filter graph structure. Must be called before using the graph.
Direct mapping to avfilter_graph_alloc().
Returns
void
Throws
If allocation fails (ENOMEM)
Example
const graph = new FilterGraph();
graph.alloc();
// Graph is now ready for filter creation
See
allocFilter()
allocFilter(
filter
,name
):null
|FilterContext
Defined in: src/lib/filter-graph.ts:257
Allocate a filter in the graph.
Creates a new filter context and adds it to the graph, but does not initialize it. Call init() on the context afterwards.
Direct mapping to avfilter_graph_alloc_filter().
Parameters
filter
Filter descriptor to instantiate
name
string
Name for this filter instance
Returns
null
| FilterContext
Allocated filter context, or null on failure
Example
import { FFmpegError } from 'node-av';
const filter = graph.allocFilter(
Filter.getByName('scale')!,
'scaler'
);
if (filter) {
// Initialize separately
const ret = filter.initStr('640:480');
FFmpegError.throwIfError(ret, 'initStr');
}
See
createFilter To allocate and initialize
config()
config():
Promise
<number
>
Defined in: src/lib/filter-graph.ts:316
Configure the filter graph.
Validates and finalizes the graph configuration. Must be called after all filters are created and linked.
Direct mapping to avfilter_graph_config().
Returns
Promise
<number
>
0 on success, negative AVERROR on error:
- AVERROR_EINVAL: Invalid graph configuration
- AVERROR_ENOMEM: Memory allocation failure
Example
import { FFmpegError } from 'node-av';
// Build graph...
// Link filters...
// Configure the complete graph
const ret = await graph.config();
FFmpegError.throwIfError(ret, 'config');
// Graph is now ready for processing
See
validate To check configuration
configSync()
configSync():
number
Defined in: src/lib/filter-graph.ts:345
Configure the filter graph synchronously. Synchronous version of config.
Validates and finalizes the graph structure after all filters have been added and connected. Must be called before processing.
Direct mapping to avfilter_graph_config().
Returns
number
0 on success, negative AVERROR on error:
- AVERROR_EINVAL: Invalid graph structure
- AVERROR_ENOMEM: Memory allocation failure
Example
import { FFmpegError } from 'node-av';
// Configure graph after building
const ret = graph.configSync();
FFmpegError.throwIfError(ret, 'configSync');
// Graph is now ready for processing
See
config For async version
createFilter()
createFilter(
filter
,name
,args
):null
|FilterContext
Defined in: src/lib/filter-graph.ts:221
Create and initialize a filter in the graph.
Creates a new filter context, adds it to the graph, and initializes it with the provided arguments.
Direct mapping to avfilter_graph_create_filter().
Parameters
filter
Filter descriptor to instantiate
name
string
Name for this filter instance
args
Initialization arguments (filter-specific)
null
| string
Returns
null
| FilterContext
Created filter context, or null on failure
Example
// Create a scale filter
const scale = graph.createFilter(
Filter.getByName('scale')!,
'scaler',
'640:480' // width:height
);
// Create a buffer source
const src = graph.createFilter(
Filter.getByName('buffer')!,
'source',
'video_size=1920x1080:pix_fmt=yuv420p:time_base=1/25'
);
See
- allocFilter To allocate without initializing
- getFilter To retrieve by name
dump()
dump():
null
|string
Defined in: src/lib/filter-graph.ts:566
Dump the filter graph to a string.
Returns a textual representation of the graph structure. Useful for debugging and visualization.
Direct mapping to avfilter_graph_dump().
Returns
null
| string
Graph description string, or null on failure
Example
const graphStr = graph.dump();
if (graphStr) {
console.log('Graph structure:');
console.log(graphStr);
}
free()
free():
void
Defined in: src/lib/filter-graph.ts:181
Free the filter graph.
Releases all resources associated with the graph, including all contained filters.
Direct mapping to avfilter_graph_free().
Returns
void
Example
graph.free();
// Graph is now invalid
See
- alloc To allocate
- Symbol.dispose For automatic cleanup
getFilter()
getFilter(
name
):null
|FilterContext
Defined in: src/lib/filter-graph.ts:284
Get a filter by name from the graph.
Retrieves an existing filter context by its instance name.
Direct mapping to avfilter_graph_get_filter().
Parameters
name
string
Name of the filter instance
Returns
null
| FilterContext
Filter context if found, null otherwise
Example
// Find a previously created filter
const scaler = graph.getFilter('scaler');
if (scaler) {
console.log('Found scaler filter');
}
See
createFilter To create new filters
getNative()
getNative():
NativeFilterGraph
Defined in: src/lib/filter-graph.ts:659
Internal
Get the underlying native FilterGraph object.
Returns
The native FilterGraph binding object
Implementation of
getOption()
Get an option value from this object.
Uses the AVOption API to retrieve options.
Direct mapping to av_opt_get* functions.
Param
Option name
Param
Option type (defaults to AV_OPT_TYPE_STRING)
Param
Search flags (default: AV_OPT_SEARCH_CHILDREN)
Example
import { AV_OPT_TYPE_STRING, AV_OPT_TYPE_RATIONAL, AV_OPT_TYPE_PIXEL_FMT, AV_OPT_TYPE_INT64 } from 'node-av/constants';
// String options (default)
const preset = obj.getOption('preset');
const codec = obj.getOption('codec', AV_OPT_TYPE_STRING);
// Typed options
const framerate = obj.getOption('framerate', AV_OPT_TYPE_RATIONAL); // Returns {num, den}
const pixFmt = obj.getOption('pix_fmt', AV_OPT_TYPE_PIXEL_FMT); // Returns AVPixelFormat
const bitrate = obj.getOption('bitrate', AV_OPT_TYPE_INT64); // Returns bigint
Call Signature
getOption(
name
,type?
,searchFlags?
):null
|string
Defined in: src/lib/option.ts:1217
Parameters
name
string
type?
searchFlags?
Returns
null
| string
Inherited from
Call Signature
getOption(
name
,type
,searchFlags?
):null
|string
Defined in: src/lib/option.ts:1218
Parameters
name
string
type
searchFlags?
Returns
null
| string
Inherited from
Call Signature
getOption(
name
,type
,searchFlags?
):null
|number
Defined in: src/lib/option.ts:1221
Parameters
name
string
type
searchFlags?
Returns
null
| number
Inherited from
Call Signature
getOption(
name
,type
,searchFlags?
):null
|bigint
Defined in: src/lib/option.ts:1222
Parameters
name
string
type
searchFlags?
Returns
null
| bigint
Inherited from
Call Signature
getOption(
name
,type
,searchFlags?
):null
|number
Defined in: src/lib/option.ts:1223
Parameters
name
string
type
searchFlags?
Returns
null
| number
Inherited from
Call Signature
getOption(
name
,type
,searchFlags?
):null
|bigint
Defined in: src/lib/option.ts:1224
Parameters
name
string
type
searchFlags?
Returns
null
| bigint
Inherited from
Call Signature
getOption(
name
,type
,searchFlags?
):null
|number
Defined in: src/lib/option.ts:1225
Parameters
name
string
type
searchFlags?
Returns
null
| number
Inherited from
Call Signature
getOption(
name
,type
,searchFlags?
):null
|boolean
Defined in: src/lib/option.ts:1226
Parameters
name
string
type
searchFlags?
Returns
null
| boolean
Inherited from
Call Signature
getOption(
name
,type
,searchFlags?
):null
|number
Defined in: src/lib/option.ts:1227
Parameters
name
string
type
searchFlags?
Returns
null
| number
Inherited from
Call Signature
getOption(
name
,type
,searchFlags?
):null
|number
Defined in: src/lib/option.ts:1228
Parameters
name
string
type
searchFlags?
Returns
null
| number
Inherited from
Call Signature
getOption(
name
,type
,searchFlags?
):null
|number
Defined in: src/lib/option.ts:1231
Parameters
name
string
type
searchFlags?
Returns
null
| number
Inherited from
Call Signature
getOption(
name
,type
,searchFlags?
):null
|number
Defined in: src/lib/option.ts:1232
Parameters
name
string
type
searchFlags?
Returns
null
| number
Inherited from
Call Signature
getOption(
name
,type
,searchFlags?
):null
|IRational
Defined in: src/lib/option.ts:1235
Parameters
name
string
type
searchFlags?
Returns
null
| IRational
Inherited from
Call Signature
getOption(
name
,type
,searchFlags?
):null
|IRational
Defined in: src/lib/option.ts:1236
Parameters
name
string
type
searchFlags?
Returns
null
| IRational
Inherited from
Call Signature
getOption(
name
,type
,searchFlags?
):null
|AVPixelFormat
Defined in: src/lib/option.ts:1237
Parameters
name
string
type
searchFlags?
Returns
null
| AVPixelFormat
Inherited from
Call Signature
getOption(
name
,type
,searchFlags?
):null
|AVSampleFormat
Defined in: src/lib/option.ts:1238
Parameters
name
string
type
searchFlags?
Returns
null
| AVSampleFormat
Inherited from
Call Signature
getOption(
name
,type
,searchFlags?
):null
| {height
:number
;width
:number
; }
Defined in: src/lib/option.ts:1239
Parameters
name
string
type
searchFlags?
Returns
null
| { height
: number
; width
: number
; }
Inherited from
Call Signature
getOption(
name
,type
,searchFlags?
):null
|ChannelLayout
Defined in: src/lib/option.ts:1240
Parameters
name
string
type
searchFlags?
Returns
null
| ChannelLayout
Inherited from
Call Signature
getOption(
name
,type
,searchFlags?
):null
|Dictionary
Defined in: src/lib/option.ts:1241
Parameters
name
string
type
searchFlags?
Returns
null
| Dictionary
Inherited from
Call Signature
getOption(
name
,type
,searchFlags?
):null
|string
Defined in: src/lib/option.ts:1242
Parameters
name
string
type
searchFlags?
Returns
null
| string
Inherited from
listOptions()
listOptions():
OptionInfo
[]
Defined in: src/lib/option.ts:1358
List all available options for this object.
Uses the AVOption API to enumerate all options. Useful for discovering available settings and their types.
Direct mapping to av_opt_next() iteration.
Returns
Array of option information objects
Example
const options = obj.listOptions();
for (const opt of options) {
console.log(`${opt.name}: ${opt.help}`);
console.log(` Type: ${opt.type}, Default: ${opt.defaultValue}`);
console.log(` Range: ${opt.min} - ${opt.max}`);
}
See
OptionInfo For option metadata structure
Inherited from
parse()
parse(
filters
,inputs
,outputs
):number
Defined in: src/lib/filter-graph.ts:389
Parse a filter graph description.
Parses a textual representation of a filter graph and adds filters to this graph. Handles labeled inputs and outputs.
Direct mapping to avfilter_graph_parse().
Parameters
filters
string
Filter graph description string
inputs
Linked list of graph inputs
null
| FilterInOut
outputs
Linked list of graph outputs
null
| FilterInOut
Returns
number
0 on success, negative AVERROR on error:
- AVERROR_EINVAL: Parse error
- AVERROR_ENOMEM: Memory allocation failure
Example
import { FFmpegError, FilterInOut } from 'node-av';
const inputs = FilterInOut.createList([
{ name: 'in', filterCtx: bufferSrc, padIdx: 0 }
]);
const outputs = FilterInOut.createList([
{ name: 'out', filterCtx: bufferSink, padIdx: 0 }
]);
const ret = graph.parse(
'[in]scale=640:480,format=yuv420p[out]',
inputs,
outputs
);
FFmpegError.throwIfError(ret, 'parse');
See
parse2()
parse2(
filters
):number
Defined in: src/lib/filter-graph.ts:420
Parse a filter graph description (simplified).
Parses a textual filter description with automatic input/output handling. Simpler than parse() but less flexible.
Direct mapping to avfilter_graph_parse2().
Parameters
filters
string
Filter graph description string
Returns
number
0 on success, negative AVERROR on error:
- AVERROR_EINVAL: Parse error
- AVERROR_ENOMEM: Memory allocation failure
Example
import { FFmpegError } from 'node-av';
// Parse a simple filter chain
const ret = graph.parse2(
'scale=640:480,format=yuv420p'
);
FFmpegError.throwIfError(ret, 'parse2');
See
parse For labeled inputs/outputs
parsePtr()
parsePtr(
filters
,inputs?
,outputs?
):number
Defined in: src/lib/filter-graph.ts:454
Parse a filter graph description with pointer.
Alternative parsing method with different parameter handling.
Direct mapping to avfilter_graph_parse_ptr().
Parameters
filters
string
Filter graph description string
inputs?
Optional linked list of inputs
null
| FilterInOut
outputs?
Optional linked list of outputs
null
| FilterInOut
Returns
number
0 on success, negative AVERROR on error:
- AVERROR_EINVAL: Parse error
- AVERROR_ENOMEM: Memory allocation failure
Example
import { FFmpegError } from 'node-av';
const ret = graph.parsePtr(
'[in]scale=w=640:h=480[out]'
);
FFmpegError.throwIfError(ret, 'parsePtr');
See
queueCommand()
queueCommand(
target
,cmd
,arg
,ts
,flags?
):number
Defined in: src/lib/filter-graph.ts:648
Queue a command for delayed execution.
Schedules a command to be executed at a specific timestamp. The command is executed when the filter processes a frame with that timestamp.
Direct mapping to avfilter_graph_queue_command().
Parameters
target
string
Filter name or "all"
cmd
string
Command to queue
arg
string
Command argument
ts
number
Timestamp for execution
flags?
Command flags
Returns
number
0 on success, negative AVERROR on error
Example
import { FFmpegError } from 'node-av';
// Queue volume change at 5 seconds
const ret = graph.queueCommand(
'volume',
'volume',
'0.2',
5000000, // microseconds
0
);
FFmpegError.throwIfError(ret, 'queueCommand');
See
sendCommand For immediate execution
requestOldest()
requestOldest():
Promise
<number
>
Defined in: src/lib/filter-graph.ts:508
Request a frame from the oldest sink.
Requests that a frame be output from the oldest sink in the graph. Used to drive the filter graph processing.
Direct mapping to avfilter_graph_request_oldest().
Returns
Promise
<number
>
0 on success, negative AVERROR on error:
- AVERROR_EOF: End of stream reached
- AVERROR_EAGAIN: Need more input
Example
import { FFmpegError } from 'node-av';
import { AVERROR_EOF, AVERROR_EAGAIN } from 'node-av/constants';
const ret = await graph.requestOldest();
if (ret === AVERROR_EOF) {
// No more frames
} else if (ret === AVERROR_EAGAIN) {
// Need to provide more input
} else {
FFmpegError.throwIfError(ret, 'requestOldest');
}
requestOldestSync()
requestOldestSync():
number
Defined in: src/lib/filter-graph.ts:543
Request the oldest queued frame from filters synchronously. Synchronous version of requestOldest.
Requests a frame from the oldest sink in the graph. Used for pulling frames through the filter pipeline.
Direct mapping to avfilter_graph_request_oldest().
Returns
number
0 on success, negative AVERROR on error:
- AVERROR_EOF: No more frames
- AVERROR_EAGAIN: Need more input
Example
import { FFmpegError } from 'node-av';
import { AVERROR_EOF, AVERROR_EAGAIN } from 'node-av/constants';
// Pull frames through the graph
const ret = graph.requestOldestSync();
if (ret === AVERROR_EOF) {
// All frames processed
} else if (ret === AVERROR_EAGAIN) {
// Need more input frames
} else {
FFmpegError.throwIfError(ret, 'requestOldestSync');
}
See
requestOldest For async version
sendCommand()
sendCommand(
target
,cmd
,arg
,flags?
):number
| {response
:null
|string
; }
Defined in: src/lib/filter-graph.ts:607
Send a command to filters in the graph.
Sends a command to one or more filters for immediate execution. Target can be a specific filter name or "all" for all filters.
Direct mapping to avfilter_graph_send_command().
Parameters
target
string
Filter name or "all"
cmd
string
Command to send
arg
string
Command argument
flags?
Command flags
Returns
number
| { response
: null
| string
; }
Error code or response object
Example
// Send command to specific filter
const result = graph.sendCommand(
'volume',
'volume',
'0.5'
);
// Send to all filters
const result2 = graph.sendCommand(
'all',
'enable',
'timeline'
);
See
queueCommand For delayed execution
setOption()
Set an option on this object.
Uses the AVOption API to set options. Available options depend on the specific object type.
Direct mapping to av_opt_set* functions.
Param
Option name
Param
Option value
Param
Option type (defaults to AV_OPT_TYPE_STRING)
Param
Search flags (default: AV_OPT_SEARCH_CHILDREN)
Example
import { FFmpegError } from 'node-av';
import { AV_OPT_TYPE_STRING, AV_OPT_TYPE_INT64, AV_OPT_TYPE_RATIONAL, AV_OPT_TYPE_PIXEL_FMT } from 'node-av/constants';
// String options (default)
let ret = obj.setOption('preset', 'fast');
FFmpegError.throwIfError(ret, 'set preset');
ret = obj.setOption('codec', 'h264', AV_OPT_TYPE_STRING);
FFmpegError.throwIfError(ret, 'set codec');
// Integer options
ret = obj.setOption('bitrate', 2000000, AV_OPT_TYPE_INT64);
FFmpegError.throwIfError(ret, 'set bitrate');
ret = obj.setOption('threads', 4, AV_OPT_TYPE_INT);
FFmpegError.throwIfError(ret, 'set threads');
// Complex types with proper types
ret = obj.setOption('framerate', {num: 30, den: 1}, AV_OPT_TYPE_RATIONAL);
FFmpegError.throwIfError(ret, 'set framerate');
ret = obj.setOption('pix_fmt', AV_PIX_FMT_YUV420P, AV_OPT_TYPE_PIXEL_FMT);
FFmpegError.throwIfError(ret, 'set pixel format');
Call Signature
setOption(
name
,value
,type?
,searchFlags?
):number
Defined in: src/lib/option.ts:1006
Parameters
name
string
value
string
type?
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1007
Parameters
name
string
value
string
type
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1010
Parameters
name
string
value
number
type
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1011
Parameters
name
string
value
bigint
type
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1012
Parameters
name
string
value
number
type
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1013
Parameters
name
string
value
bigint
type
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1014
Parameters
name
string
value
number
type
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1015
Parameters
name
string
value
boolean
type
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1016
Parameters
name
string
value
number
type
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1017
Parameters
name
string
value
number
type
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1020
Parameters
name
string
value
number
type
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1021
Parameters
name
string
value
number
type
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1024
Parameters
name
string
value
type
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1025
Parameters
name
string
value
type
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1026
Parameters
name
string
value
type
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1027
Parameters
name
string
value
type
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1028
Parameters
name
string
value
height
number
width
number
type
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1029
Parameters
name
string
value
number
| bigint
type
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1030
Parameters
name
string
value
Buffer
type
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1031
Parameters
name
string
value
number
[]
type
searchFlags?
Returns
number
Inherited from
Call Signature
setOption(
name
,value
,type
,searchFlags?
):number
Defined in: src/lib/option.ts:1032
Parameters
name
string
value
type
searchFlags?
Returns
number
Inherited from
validate()
validate():
number
Defined in: src/lib/filter-graph.ts:477
Validate the filter graph configuration.
Checks if the graph is valid and properly configured. Does not finalize the graph like config() does.
Returns
number
0 on success, negative AVERROR on error:
- AVERROR_EINVAL: Invalid configuration
Example
import { FFmpegError } from 'node-av';
const ret = graph.validate();
FFmpegError.throwIfError(ret, 'validate');
See
config To configure and finalize