m s

T E C H N I C A L   W H I T E   P A P E R

MSEngine
& MSPlayer

Pure Rust media processing. Zero FFmpeg. Zero C dependencies.
Single binary. Browser-native playback with server-side transcoding.

v0.6.0 August 2026 Resemble Media
01

Abstract

MSEngine (ms) is a standalone media processing binary written entirely in Rust. It replaces FFmpeg, ImageMagick, and dozens of fragmented CLI tools with a single, dependency-free executable. MSPlayer is a browser-native media player that communicates with MSEngine via a REST API, automatically transcoding any format that the browser cannot play natively.

Core Principles
  • Zero FFmpeg — No C libraries, no system dependencies, no GPL contamination
  • Single Binary — One ms executable, ~20MB, runs on macOS/Linux/Windows
  • Zero Crash — FallbackChain → CircuitBreaker → Retry → Timeout → safe return
  • Format Agnostic — Any input format the engine can parse, MSPlayer can play

The system targets media engineers, broadcasters, streaming platforms, and developers who need reliable, auditable media processing without the operational complexity of FFmpeg's 1000+ options and version-dependent behavior.

02

System Architecture

Two-Layer Design

MSEngine (Backend)

Single Rust binary exposing 34+ CLI subcommands and a JSON-over-stdin/stdout API. Handles all media processing: probe, encode, decode, filter, watermark, encrypt, validate, sanitize, stream, mux, demux, and pipeline orchestration.

Rustrav1erav1dmstream_h264mp4 crate

MSPlayer (Frontend)

Self-contained JavaScript player class. Renders probe metadata, audio visualizer, seek controls. Detects non-browser-native formats (MKV, WebM, TS) and auto-transcodes via the /api/transcode endpoint before playback.

Vanilla JSWeb Audio APIFetch APINo framework

Communication Flow

MSPlayer (Browser)                     Serve.py (Python)                    MSEngine (Rust)
┌──────────────┐                      ┌──────────────┐                     ┌──────────────┐
│  loadURL()   │──── GET /api/probe ──▶│  _ms_json()  │──── ms probe ─────▶│  probe.rs    │
│              │◀─── JSON result ─────│              │◀─── JSON result ───│  MKV parser  │
│              │                      │              │                     │  EBML walker │
│  auto-detect │──── POST /api/      │              │                     │              │
│  unsupported │     transcode ──────▶│  _handle_    │──── ms encode ────▶│  decode +    │
│  format      │◀─── {url, method} ──│  transcode() │◀─── MP4 output ───│  re-encode   │
│              │                      │              │                     │              │
│  video.src   │──── GET /api/       │              │                     │              │
│  = mp4 url   │     uploads/... ───▶│  file serve  │                     │              │
└──────────────┘                      └──────────────┘                     └──────────────┘

Dependency Graph

Decode Layer
  • mstream_av1d — AV1 (rav1d fork)
  • mstream_h264 — H.264/AVC
  • hound — WAV
  • opus — Opus
  • claxon — FLAC
  • lewton — Vorbis
  • symphonia — Fallback
Encode Layer
  • rav1e — AV1 encoding
  • opus — Opus encoding
  • image — Image processing
  • imageproc — Advanced filters
  • resvg — SVG rendering
Container Layer
  • mp4 — MP4/MOV read/write
  • Custom EBML — MKV/WebM probe
  • Custom MPEG-TS — PAT/PMT/PES
  • Custom HLS — M3U8 segmentation
03

Codec Support

Video Codecs

CodecDecodeEncodeLibraryNotes
AV1rav1d / rav1ePrimary codec. Full encode/decode pipeline.
H.264/AVCmstream_h264Decode-only. SPS/PPS parsing, NAL unit extraction.
H.265/HEVCMP4 onlymp4 crateProbe + container parse only. No pure-Rust decoder yet.
VP8MKV onlyCustomContainer detection only.
VP9MKV onlyCustomContainer detection only.

Audio Codecs

CodecDecodeEncodeLibraryNotes
Opusopus crateFull pipeline. Auto-resample to 48kHz.
FLACclaxonDecode + probe with duration.
VorbislewtonDecode + probe.
MP3symphoniaXing/Info header parsing. Duration from bitrate.
AACsymphonia + fdk-aac-rustDecode via fdk-aac-rust multichannel decoder (3-7.1ch). Downmix to stereo for Opus encode. Probe via mp4 crate.
WAV/PCMhoundFull read/write. Sample format conversion.

Image Codecs

FormatReadWriteLibraryNotes
JPEGimage crateEXIF orientation, quality control.
PNGimage crateAPNG frame extraction via acTL/fcTL.
WebPimage crateVP8/VP8L/VP8X detection.
BMPimage crate
YUV4MPEGCustomHeader parsing, frame extraction.
Raw YUVCustomExtension-based detection. Width/height required.
04

Container Format Support

MP4 / MOV / M4V

Full recursive box parser. Handles ftyp brand detection, stts/stss/stsz/stco sample table traversal, avcC/hvcC decoder config extraction, stts frame duration calculation, Opus/FLAC/Vorbis audio tracks. Probe extracts: duration, resolution, bitrate, codec, frame count, FPS.

Read ✓Write ✓Full sample access

MKV / WebM

EBML header parser. Segment/Tracks/Cluster traversal. CodecID → codec mapping (V_MPEG4/ISO/AVC, V_MPEGH/ISO/HEVC, V_AV1, A_OPUS, A_FLAC, A_VORBIS, A_AAC, A_MP3). Block timestamp + keyframe extraction. CodecPrivate parsing for SPS/PPS/VPS.

Probe ✓Decode ✓ (H.264 via Annex B)AV1 via rav1d

MPEG-TS

PAT/PMT PID parsing. PES packet assembly. PTS/DTS timestamp extraction. H.264/H.265 stream type detection. Duration from PCR discontinuity analysis. Sync byte (0x47) validation.

Probe ✓Parse ✓PAT/PMT/PES

HLS (M3U8 + TS)

Segmentation engine: input video → M3U8 playlist + TS segments. Configurable segment duration. TS packet wrapping with PAT/PMT/PES/CRC32. #EXT-X-TARGETDURATION, #EXTINF tags. Segment byte ranges.

Write ✓Segment generationTS muxing

OGG

OggS capture pattern. Vorbis/Opus/Speex stream detection. Duration from last page serial number. Segment table parsing.

Probe ✓Decode (via lewton/opus)

FLAC

fLaC magic. STREAMINFO metadata block parsing (min/max block size, sample rate, channels, bits per sample, total samples). Duration calculation from total_samples / sample_rate.

Probe ✓Decode ✓Duration ✓

Magic Bytes Detection Table

MSEngine identifies 48+ formats via magic byte signatures, plus 3 headerless formats (YUV, RAW, PCM) via extension fallback.

FORMAT   OFFSET  HEADER BYTES                          DESCRIPTION
───────  ──────  ──────────────────────────────────────  ─────────────────────────────────
mp4      4       [66747970]                             ISO Base Media (MP4/MOV/M4V/3GP)
mkv      0       [1a45dfa3]                             Matroska (MKV/WebM)
wav      0+8     [52494646] + [57415645]                WAV (RIFF WAVE)
flac     0       [664c6143]                             FLAC lossless audio
ogg      0       [4f676753]                             OGG container (Vorbis/Opus)
mp3      0       [494433] or [ff e0] (sync word)        MP3 (ID3v2 or MPEG sync)
jpeg     0       [ffd8ff]                               JPEG (SOI marker)
png      0       [89504e47 0d0a1a0a]                    PNG (8-byte signature)
y4m      0       [595556344d504547]                     YUV4MPEG2 raw frames
ts       0       [47]                                   MPEG-TS (sync byte)
yuv      ext     (no header)                            Raw YUV video (extension only)
05

Processing Pipeline

Pipeline Architecture

The pipeline system provides linear chaining, side-chains, forks, fan-out/fan-in, conditional nodes, and mux/demux operations. Each node receives a PipelineContext with typed stream references.

// Pipeline API — Rust
let result = Pipeline::new("transcode")
    .add("probe", |ctx| { /* read metadata */ })
    .add("scale", |ctx| { /* resize frames */ })
    .add("encode", |ctx| { /* AV1 encode */ })
    .execute(input)?;

// Pipeline API — CLI
ms pipeline input.mp4 output.mp4 \
  --step "probe" \
  --step "video_scale:640:480" \
  --step "encode_av1"

Pipeline Operations

OperationTypeDescription
probeRead-onlyExtract metadata without modification
resizeImageNearest-neighbor image resize
cropImage/VideoRegion extraction with bounds check
rotateImage/Video90°/180°/270° rotation
thumbnailImageExtract first frame as JPEG
watermarkImage/VideoText overlay with alpha blending
blurImageBox blur with configurable radius
video_cropVideoYUV420p frame crop
video_scaleVideoBilinear YUV420p scaling
video_rotateVideoYUV420p rotation (90/180/270)
video_trimVideoTime-based frame selection
video_speedVideoFrame dropping/duplication
video_overlayVideoAlpha-blended frame overlay
video_concatVideoFrame sequence concatenation
encode_av1Encoderav1e AV1 encoding to MP4

Chunked Processing

For large files, MSEngine processes video in configurable batches (default 60 frames). This bounds memory usage while maintaining encode quality through persistent rav1e context across chunks.

Memory Model

Chunked processing decouples decode from encode. All frames are decoded first ( unavoidable with current decoders ), then encoded in batches. Memory usage = decode_buffer + chunk_size × frame_size. For 1080p YUV420p at chunk_size=60: ~110MB decode buffer + ~55MB encode batch = ~165MB peak.

Security Pipeline

Every media operation can include pre-flight validation via the security scanner. The scanner detects:

Binary Signatures
  • Shell script payloads
  • ELF/Mach-O/PE executables
  • JavaScript/VBA macros
  • Base64-encoded exploits
  • ZIP/RAR/GZ archives
Metadata Exploits
  • MP4 atom overflow/recursion
  • ID3 tag bombs
  • EXIF/XMP injection
  • MKV EBML recursion
  • JPEG COM exploit
Entropy Analysis
  • Shannon entropy scoring
  • Encrypted payload detection
  • Packed/compressed detection
  • Resolution bomb detection
  • Dangerous extension matching
06

MSPlayer — Browser-Native Media Playback

MSPlayer v1.1.61

Design Philosophy

MSPlayer is a zero-dependency JavaScript class that provides media playback for any format. When the browser cannot play a format natively (MKV, WebM, TS, YUV), MSPlayer automatically transcodes it server-side via the MSEngine API and caches the result.

Format Detection

// MSPlayer detects browser compatibility
const BROWSER_VIDEO = new Set([
  '.mp4', '.webm', '.ogg', '.ogv', '.mov'
]);
const BROWSER_AUDIO = new Set([
  '.mp3', '.wav', '.ogg', '.oga',
  '.opus', '.m4a', '.aac'
]);

// Non-browser formats → auto-transcode
if (!BROWSER_VIDEO.has(ext)) {
  const { url, method } = await fetch(
    '/api/transcode',
    { body: { source: fileName } }
  );
  video.src = url; // Serve transcoded MP4
}

Transcode Pipeline

// Server-side transcode endpoint
POST /api/transcode
{
  "source": "test-h264.mkv"
}

// Response:
{
  "url": "/api/uploads/test-h264.mp4",
  "method": "encode",  // or "cached"
  "cached": false,
  "size": 8240966
}

// Supported conversions:
// MKV  → MP4 (H.264 re-encode to AV1)
// WebM → MP4
// TS   → MP4
// YUV  → MP4 (AV1 encode)

Player Features

FeatureImplementationNotes
Auto-transcode/api/transcode POSTNon-blocking. Caches result in uploads/.
Probe metadata/api/probe GETReal-time format/codec/resolution display.
Audio visualizerWeb Audio API + AnalyserNode48-bar FFT visualization, gradient coloring.
Drag & dropFile API + createObjectURLLocal file playback without server.
File sidebar/api/files GETGrouped by video/audio/image.
Seek controlsHTML5 video + range inputSmooth seeking with time display.
FullscreenFullscreen APIVideo mode only.

MSPlayer API

// Initialize
const player = new MSPlayer(document.getElementById('root'), {
  type: 'video',       // 'video' | 'audio'
  apiBase: ''          // API base URL
});

// Load from server
await player.loadURL('/api/media/test.mp4', 'test.mp4');

// Load local file (drag & drop or file picker)
// Handled automatically by the player

// Probe file
const info = await player.probe('test.mp4');
// Returns: { duration, size, format, width, height, video, audio }

// Security scan
const result = await player.validate('test.mp4');
// Returns: { threats, score, details }

// Generate HLS
const hls = await player.generateHLS('test.mp4', 4);
// Returns: { playlist, segments, stderr, exit }
07

Encryption & DRM

AES-256-GCM Stream Encryption

MSEngine provides AES-256-GCM authenticated encryption for media streams. Each chunk is encrypted with a unique IV, and HMAC-signed tokens control access.

# Encrypt
ms encrypt input.mp4 encrypted.mp4 --key <hex-256bit>

# Decrypt
ms decrypt encrypted.mp4 output.mp4 --key <hex-256bit>

# PPV Token System
ms ppv-create --duration 3600 --secret <key>   # Generate 1-hour token
ms ppv-play --token <token> --secret <key>     # Validate + play
ms ppv-burn --token <token> --secret <key>     # Invalidate token

PPV (Pay-Per-View) Lifecycle

1. Create

Generate HMAC-signed token with expiry, content ID, and viewer restrictions. Token is cryptographically bound to the content.

2. Validate

On playback request, verify HMAC signature, check expiry, confirm content ID match. Reject if expired or tampered.

3. Burn

Immediately invalidate token. Used for account suspension, refund processing, or abuse prevention.

Audit Trail

All encryption, decryption, and PPV operations are logged with hash-linked chain entries for tamper evidence. Each log entry contains: timestamp, operation, input hash, output hash, token status, and previous entry hash.

08

Streaming & Broadcasting

HLS Segmentation

MSEngine generates HTTP Live Streaming packages from any supported video input.

# Generate HLS with 4-second segments
ms streaming hls input.mp4 output_dir/ --segment-duration 4

# Output:
# output_dir/
#   ├── index.m3u8          # Master playlist
#   ├── segment_000.ts      # TS segment (PAT/PMT/PES)
#   ├── segment_001.ts
#   └── ...

TS Packet Structure

Each MPEG-TS segment contains 188-byte packets with:

PAT

Program Association Table. PID 0. Maps program numbers to PMT PIDs.

PMT

Program Map Table. Lists video/audio PIDs and codec types.

PES

Packetized Elementary Stream. Carries video/audio data with PTS/DTS timestamps.

CRC32

Error detection for PAT/PMT tables. Ensures playlist integrity.

Queue System

Background job processing via Unix socket IPC. Jobs are executed sequentially with bounded channel backpressure.

# Start queue daemon
ms queue start --socket ~/.mediastream/engine.sock

# Submit job
ms queue submit --input video.mp4 --operation encode --output out.mp4

# Check status
ms queue status

# Stop daemon
ms queue stop
09

Hardware Acceleration

Auto-Detection

MSEngine automatically detects available hardware encoders/decoders at startup and selects the optimal path.

PlatformDecoderEncoderAPI
Apple M1–M4VideoToolbox (H.264/HEVC)VideoToolbox (H.264/HEVC)VTCompressionSession
NVIDIANVDEC (H.264/HEVC/AV1)NVENC (H.264/HEVC/AV1)CUDA/NVENC SDK
Intel Arc/QSVoneVPL (H.264/HEVC/AV1)oneVPL (H.264/HEVC/AV1)oneVPL API
AMD VCNVCN (H.264/HEVC)VCN (H.264/HEVC)AMF SDK
ARM SoCsVPU (H.264)VPU (H.264)NEON intrinsics
GPU + CPU Parallel Architecture

When hardware acceleration is available, MSEngine runs decode and encode on parallel threads:

  • Thread A (GPU): VideoToolbox/NVDEC decode → filter → rav1e encode
  • Thread B (CPU): Audio decode (Symphonia) → process → Opus encode
  • Mux: When both threads complete, audio+video are muxed into final MP4

Multi-Backend System

MSEngine supports pluggable processing backends, selectable at runtime:

MStream (Default)

Pure Rust. rav1e + rav1d + mstream_h264. Zero system dependencies. Slowest but most portable.

OxideAV

Modular AV framework. ~55 crates. Feature-gated. Protocol-oriented design for extensibility.

rff (Remade FFmpeg)

Rust FFmpeg reimplementation. Modular codec/container crates. Drop-in compatibility layer.

# Select backend at runtime
ms --use mstream encode input.mp4 output.mp4    # Default: pure Rust
ms --use oxideav encode input.mp4 output.mp4    # OxideAV backend
ms --use rff encode input.mp4 output.mp4        # Remade FFmpeg

# List available backends
ms backends
10

Roadmap & Known Limitations

Current Limitations

LimitationStatusPlanned Fix
No H.264 encoder (AV1 only)PartialOxideAV/libx264 integration planned
No H.265 decoderMissingHEVC NAL parser + decoder crate in development
MKV decode relies on MP4 cratePartialDedicated EBML demuxer with Block/SimpleBlock extraction
rav1e encoding speed (10–15 fps @1080p)SlowGPU encode path, faster preset options
No VP9/AV1 container demuxMissingWebM/ISOBMFF demuxer planned
TS duration inaccuratePartialPCR-based duration calculation

Planned Features

Phase 1 — Core (v0.6)

  • Full MKV demuxer (EBML → raw streams)
  • H.264 Annex B output from MKV
  • H.265/HEVC decoder crate
  • VP9 decode via libvpx bindings
  • Proper MP4 mux for ms mux

Phase 2 — Performance (v0.7)

  • GPU encode path (VideoToolbox/NVENC)
  • Parallel decode + encode threads
  • Memory-mapped file I/O for large files
  • Streaming encode (no full decode buffer)
  • OxideAV backend stabilization

Phase 3 — Broadcasting (v0.8)

  • WHIP/WHEP WebRTC signaling
  • RTMP push output
  • SRT input/output
  • NMOS IS-04 discovery
  • SMPTE 2110 output

Phase 4 — Web3 (v1.0)

  • MoQ/QUIC transport
  • AV2 codec support
  • VVC/H.266 decode
  • Blockchain-based content auth
  • Decentralized streaming

MKV Deep Dive — Current State

MKV support is the most requested and most complex gap. Here is the technical detail of what works and what doesn't:

MKV OperationStatusImplementation
EBML header detection✓ WorksMagic bytes 1A 45 DF A3 in magic.rs
Probe (duration, codec, resolution)✓ WorksEBML walker in probe.rs: Segment→Tracks→TrackEntry→Video/Audio
CodecID → codec mapping✓ WorksV_MPEG4/ISO/AVC→h264, V_MPEGH/ISO/HEVC→h265, V_AV1→av1, A_OPUS→opus, etc.
CodecPrivate parsing✓ WorksAVCDecoderConfigurationRecord / HEVCDecoderConfigurationRecord extraction
Block/SimpleBlock extractionPartialCluster traversal exists but feeds to MP4 crate which rejects MKV
Frame decode (H.264)Brokendecode_h264_from_mp4 uses mp4::Mp4Reader which fails on EBML
Frame decode (AV1)Brokendecode_av1_from_mp4 uses mp4::Mp4Reader which fails on EBML
Encode (MKV → MP4)BrokenDecode step fails, encode never runs
Security scan (MKV)✓ WorksEBML recursion/exploit detection in security.rs
MSPlayer playback (MKV)PartialAuto-transcode via /api/transcode → ms encode (which fails on MKV decode)
Fix Required

The MKV→MP4 encode path fails because decode_video_from_container() (video.rs:646) tries mp4::Mp4Reader::read_header() on the MKV file, which returns an EBML parse error. The fix requires a dedicated MKV demuxer that reads EBML Cluster→SimpleBlock→Block elements, extracts raw NAL units (length-prefixed in MKV), converts them to Annex B format (prepend 00 00 00 01 start codes), and feeds them to the existing H.264/AV1 decoders.

MKV Demux — Required Algorithm

// Required: MKV EBML Demuxer for H.264/H.265
//
// 1. Parse EBML Header (magic: 1A 45 DF A3)
//    └── EBMLRead (element size encoding: VINT)
//
// 2. Parse Segment
//    ├── Tracks
//    │   └── TrackEntry
//    │       ├── TrackType = 1 (video)
//    │       ├── CodecID = "V_MPEG4/ISO/AVC"
//    │       └── CodecPrivate = AVCDecoderConfigurationRecord
//    │           ├── lengthSizeMinusOne = 3 (4-byte NALU lengths)
//    │           ├── SPS[] (extract, prepend 00 00 00 01)
//    │           └── PPS[] (extract, prepend 00 00 00 01)
//    │
//    └── Cluster
//        ├── Timestamp (relative to segment start)
//        └── SimpleBlock
//            ├── TrackNumber (varint)
//            ├── Timestamp (signed 16-bit, relative to Cluster)
//            ├── Flags (keyframe = bit 7)
//            └── Data (length-prefixed NALUs)
//                ├── 4-byte length + NALU (SPS/PPS/IDR/P-frame)
//                ├── 4-byte length + NALU
//                └── ...
//
// 3. Convert to Annex B
//    For each SimpleBlock on video track:
//    ├── If keyframe: emit SPS + PPS (from CodecPrivate) with start codes
//    └── For each NALU in block data:
//        ├── Read 4-byte length N
//        ├── Write 00 00 00 01
//        └── Write N bytes of NALU data
//
// 4. Feed Annex B stream to existing decoders:
//    ├── H.264: mstream_h264::decoder::Decoder::decode_nal()
//    └── AV1: rav1d decoder (via OBU extraction)
12

Licenses

MSEngine is built on open-source Rust crates. Below is a full list of dependencies and their licenses.

Core Engine

CrateVersionLicenseDescription
rav1e0.7BSD-2-ClauseAV1 encoder (pure Rust)
rusty_av1d1.2MITAV1 decoder (pure Rust)
rust_h2640.4MITH.264/AVC decoder (pure Rust)
rusty_vp90.1MITVP9 decoder (pure Rust)
rust_h2650.1MITH.265/HEVC decoder (pure Rust)
mp40.14MITMP4 container reader
fdk-aac-rust0.2.3Apache-2.0AAC decoder (FDK port, pure Rust)

Audio

CrateVersionLicenseDescription
symphonia0.6MPL-2.0Multi-format audio decoder
opus0.3MITOpus encoder/decoder
hound3.5MITWAV I/O
claxon0.4MITFLAC decoder
lewton0.10MITVorbis decoder

Image Processing

CrateVersionLicenseDescription
image0.25MIT / Apache-2.0Image codec library
imageproc0.25MIT / Apache-2.0Image processing routines
ab_glyph0.2MIT / Apache-2.0Font rasterization
resvg0.44MITSVG renderer
fontdue0.9MITFont rendering
resize0.8MIT / Apache-2.0Image resizing

Networking & Streaming

CrateVersionLicenseDescription
quinn0.11MIT / Apache-2.0QUIC transport
rustls0.23Apache-2.0 / ISC / MITTLS implementation
rcgen0.13MIT / Apache-2.0 / ISCTLS certificate generation
wtransport0.7MITWebTransport over HTTP/3
tokio1.0MITAsync runtime
reqwest0.12MIT / Apache-2.0HTTP client

Cryptography

CrateVersionLicenseDescription
aes0.8MIT / Apache-2.0AES block cipher
ctr0.9MIT / Apache-2.0CTR mode
sha20.10MIT / Apache-2.0SHA-2 hash
hmac0.12MIT / Apache-2.0HMAC authentication
hkdf0.12MIT / Apache-2.0HKDF key derivation

Core Utilities

CrateVersionLicenseDescription
serde1.0MIT / Apache-2.0Serialization framework
clap4.5MIT / Apache-2.0CLI argument parser
anyhow1.0MIT / Apache-2.0Error handling
thiserror2.0MIT / Apache-2.0Derive Error trait
rayon1.10MIT / Apache-2.0Data parallelism
tracing0.1MITDiagnostics/logging
chrono0.4MIT / Apache-2.0Date/time library
uuid1.10MIT / Apache-2.0UUID generation

MSEngine License

MSEngine itself is released under the MIT License.

MIT License

Copyright © 2026 Resemble Media (Resemble.Media). Developer: Martin Rogers.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

13

Frequently Asked Questions

Why pure Rust instead of FFmpeg?

FFmpeg is C code with a 30+ year history of buffer overflows and CVEs. MSEngine gives you the same functionality in a memory-safe, single-binary executable with zero system dependencies. No GPL contamination, no dynamic linking, no "it works on my machine."

Does ms replace FFmpeg completely?

For most workflows, yes. ms handles encode, transcode, decode, filter, watermark, DRM, HLS segmentation, and streaming protocols. FFmpeg may still be needed for very niche formats or hardware-specific features not yet ported.

What codecs are supported?

Video: AV1 (rav1e encode, rusty_av1d decode), H.264 (rust_h264 decode), H.265/HEVC (rust_h265 decode), VP9 (rusty_vp9 decode). Audio: AAC (fdk-aac-rust decode), Opus, FLAC, Vorbis, MP3, WAV, PCM, ADPCM. Container: MP4, MKV, WebM, OGG.

How does GPU acceleration work?

ms auto-detects available GPU hardware at runtime: Apple VideoToolbox (M1-M4), NVIDIA NVENC/NVDEC, Intel Quick Sync Video, AMD VCN. The ms hw command shows what's available on your system.

Can I use MSPlayer in production?

Yes. MSPlayer is a zero-dependency JavaScript class that works in all modern browsers. It auto-detects browser codec support and falls back to server-side transcoding via the ms API for unsupported formats.

What streaming protocols are supported?

HLS (TS and fMP4/CMAF), DASH (fMP4), WHEP (WebRTC egress), WHIP (WebRTC ingest), MoQ over QUIC, SRT, RTMP, NMOS IS-04/IS-05, SMPTE ST 2110, and IPMX.

How does the security scanner work?

ms validate runs 47 detection rules against media files: PHP disguises, polyglot files, embedded scripts, ID3 bombs, EXIF injection, MP4 atom overflow, MKV EBML recursion. ms sanitize strips all metadata and hidden exploits.

Is there a Docker image?

Yes. Run docker compose up -d from the demo-site directory. The container includes the ms binary, the demo web UI, and a self-signed TLS certificate. Access at https://localhost:8443.

What is the pipeline system?

The ms pipeline command chains multiple operations via JSON configuration. Each step can scale, crop, encode, or filter, with automatic context passing between steps. Supports fork/join for parallel processing.

How do I report bugs or contribute?

Visit github.com/mediastream-framework/mediastream-framework to open issues or submit pull requests.