oximedia-graph
Filter graph pipeline for OxiMedia, providing a directed acyclic graph (DAG) implementation for processing media through composable filter pipelines.
Part of the oximedia workspace — a comprehensive pure-Rust media processing framework.
Overview
oximedia-graph provides a DAG-based media processing pipeline:
- Nodes: Processing units that transform media data
- Ports: Connection points for data flow
- Frames: Data units passed through the graph
- Context: Runtime state and statistics
Architecture
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Source │────▶│ Filter │────▶│ Sink │
│ (Decode)│ │ (Scale) │ │(Encode) │
└─────────┘ └─────────┘ └─────────┘
Features
- Video Filters — Scale, Crop, Pad, ColorConvert, FPS, Deinterlace, Overlay, Delogo, Denoise, Grading, IVTC, LUT, Timecode, Tonemap
- Audio Filters — Resample, ChannelMix, Volume, Normalize, Equalizer, Compressor, Limiter, Delay
- Graph Optimization — Merge compatible nodes, dead node elimination
- Topological Sort — Automatic execution order via topological sort
- Cycle Detection — Detect and report cycles in the graph
- Graph Merging — Merge sub-graphs into a unified pipeline
- Graph Partitioning — Partition graphs for distributed execution
- Visualization — Graph structure visualization
- Serialization — Graph save/load
- Metrics — Per-node processing statistics
- Profiling — Pipeline execution profiling
- Subgraph — Named subgraph support
- Node Cache — Cached node results for repeated frames
- Validation — Graph structural validation
Usage
Add to your Cargo.toml:
[]
= "0.1.4"
use GraphBuilder;
use ;
use NodeId;
use PortId;
// Create a simple graph: source -> sink
let source = new_source;
let sink = new;
let = new.add_node;
let = builder.add_node;
let graph = builder
.connect
.unwrap
.build
.unwrap;
assert_eq!;
use GraphContext;
let mut context = new;
graph.process?;
let stats = context.stats;
println!;
API Overview
Core types:
FilterGraph/GraphBuilder— Graph construction and executionNode— Processing node traitNodeId,PortId— Node and port identifiersFilterFrame,FrameRef— Frame dataGraphContext,ProcessingStats— Runtime context and statisticsGraphError— Error type
Modules:
graph— FilterGraph and GraphBuildernode,node_registry,node_cache— Node managementport— Port types and connectionsframe— Frame types and poolcontext— Runtime contexterror— Error typesdata_flow— Data flow trackingedge_weight— Edge weight/priorityscheduler— Node execution schedulingoptimization— Graph optimization passestopological— Topological sortcycle_detect— Cycle detectiongraph_merge— Graph merginggraph_validation— Graph structural validationgraph_stats— Graph statisticspipeline_graph— Pipeline-specific graphprocessing_graph— Processing graph abstractionsubgraph— Named sub-graphdependency_graph— Dependency graphgraph_partition— Graph partitioninglayout— Graph layout for visualizationvisualization— Visual graph renderingserialize— Graph serializationmetrics_graph— Metrics collectionprofiling— Execution profilingfilters— Filter implementations (video and audio)
Video filters (filters::video):
scale,crop,pad— Geometrycolor— Color conversionfps,deinterlace— Temporaloverlay— Compositingdelogo— Logo removaldenoise— Denoisinggrading— Color gradingivtc— Inverse telecinelut— LUT applicationtimecode— Timecode overlaytonemap— HDR tone mapping
Audio filters (filters::audio):
resample,channel_mix,volume,normalize,equalizer,compressor,limiter,delay
License
Apache-2.0 — Copyright 2024-2026 COOLJAPAN OU (Team Kitasan)