Bye Bye FFmpeg
NatCorder can be used in conjunction with our open-source NatReader API to build video transcoding applications. NatReader is a lightweight video decoding library for Unity Engine. It currently supports decoding
*.mp4videos, and has the exact same cross-platform support and minimum requirements as NatCorder.
NatReader acts as the decoder while NatCorder acts as the encoder, together forming a transcoding pair.
// Create a reader
var reader = new MP4FrameReader(videoPath);
// Create a recorder
var recorder = new MP4Recorder(reader.frameSize.width, reader.frameSize.height, reader.frameRate);
foreach (var (pixelBuffer, timestamp) in reader.Read())
var path = await recorder.FinishWriting();
The above example illustrates the general usage pattern. From here, more complex transcoders can be built.