Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.
TypeScript 3dagent-skillsai-agentsai-videobevyclaude-codegame-enginegpulinuxmacosmotion-designmotion-graphicsreactrusttypescriptvideo-editingvideo-renderingwgpuwindows
Changelog
0.2.5 (May 20, 2026) - MP4 Spec Compliance, Codec Box Correctness, Audio/Video Interop
π Critical Bug Fixes
build_vpcc_fmp4emitted a malformed vpcC box (fragmented.rs): missing FullBox header (version + flags), wrong bit-packing for thebit_depth/chroma_subsampling/full_range_flagbyte, and missingcodecInitializationDataSizefield. All three issues fixed.build_hvcc_fmp4emitted all-zero profile/level fields (fragmented.rs): now extractsgeneral_profile_idc,general_tier_flag,general_profile_space, andgeneral_level_idcfrom the HEVC SPS viaHevcConfig, matching the logic inbuild_hvcc_box.build_av1c_fmp4emitted all-zero codec config fields (fragmented.rs): now parsesseq_profile,seq_level_idx,seq_tier,high_bitdepth, monochrome, and chroma subsampling from the AV1 Sequence Header OBU viaextract_av1_config, matchingbuild_av1c_box.build_audio_specific_configalways wroteAudioObjectType = 2(AAC-LC) (muxer/mp4.rs): regardless of theAacProfilepassed by the caller. Now correctly sets AOT 1 (Main), 2 (LC), 3 (SSR), 4 (LTP), 5 (HE), or 29 (HE-v2) based on the profile.build_mdhd_boxsilently truncated durations > 13.6 hours (muxer/mp4.rs): theu64 β u32cast wrapped silently. Now uses a version-1 (64-bit) mdhd box whenduration_ms > u32::MAX.is_hevc_keyframepanicked on empty input (codec/h265.rs):assert_invariant!(INV-503)panicked instead of returningfalse. Replaced with a graceful early return.
π§ MP4 Spec Compliance
build_tkhd_boxemittedflags = 0(muxer/mp4.rs): ISO 14496-12 Β§8.3.2 requires bit 0 (track_enabled) and bit 1 (track_in_movie) set. Fixed to0x0000_0003.build_tkhd_boxtrack duration was always 0 (muxer/mp4.rs): ISO 14496-12 Β§8.3.2 requires thedurationfield to carry the track duration in movie timescale. Both video and audiotkhdboxes now receive the actual computed duration instead of 0. (Reported via PR #4 and PR #6.)build_vmhd_boxemittedflags = 0(muxer/mp4.rs): ISO 14496-12 Β§12.1.2 requiresflags = 1. Fixed.build_mvhd_payloadhardcodednext_track_ID = 2(muxer/mp4.rs): even when both video and audio tracks were present. Now passes the correct value (2 for video-only, 3 for video+audio).
ποΈ Dead Invariants Removed
- INV-201 (
codec/av1.rs):obu_type & 0x0f β€ 15β always true due to the 4-bit mask. - INV-203 (
codec/av1.rs):!payload.is_empty()after a prior early-return guard. - INV-302 (
codec/h264.rs): non-empty SPS/PPS check after the iterator already filtered empties. - INV-401 (
codec/vp9.rs):frame_marker == 2after a prior early-return guard.
β¨ API / Code Quality
Muxer<W>lacked aDebugimpl: added manual impl exposing track counts and status without printing the writer.MuxerBuilder<W>lacked aDebugimpl: added manual impl showing video/audio config and SPS/PPS/VPS presence.MuxerError::FirstVideoFrameMissingSpsPpsDisplay was H.264-only: updated to mention H.265 NAL types 32/33/34 as well.write_videodoc only mentioned H.264: updated to cover all supported codecs.encode_language_codewas duplicated betweenmp4.rsandfragmented.rs: madepub(crate)inmp4.rs, removed the copy infragmented.rs.FragmentedErrorwas missing#[non_exhaustive]: attribute added.Vp9Configwas missingEqderive: added.AudioValidationConfig.channelsandvalidate_audio_configparameter: promoted fromu8tou16to match the API (AudioTrackConfig.channels: u16).invariant_pptmodule marked#[doc(hidden)](internal testing infrastructure).
π Documentation
default_avc_config()doc claimed "1080p @ High Profile, Level 4.0": corrected to "640Γ480 @ Baseline Profile, Level 3.0" (the actual config values).- BLA NAL type doc strings were all identical (
codec/h265.rs):BLA_W_LP,BLA_W_RADL, andBLA_N_LPnow have distinct descriptions. - ROADMAP.md: version updated from v0.2.3 to v0.2.5; test count corrected from "200+" to "123".
0.2.5 (May 19, 2026) - Safety Fixes: Empty-NAL Panics, HEVC BLA Keyframes, Non-Exhaustive Error
π Bug Fixes
encode_videocould panic on H.264/H.265 streams with consecutive Annex B start codes:AnnexBNalItercan yield empty&[u8]slices when two start codes appear back-to-back (which some encoders emit). The H.264 branch ofis_keyframe()accessednal[0]unconditionally, and the H.265 branch did the same. Both now guard with!nal.is_empty()before indexing. Added regression tests for both codecs.encode_videofailed to detect HEVC BLA frames as keyframes: The H.265 branch ofis_keyframe()only checked NAL types 19β21 (IDR + CRA), missing BLA types 16β18 (BLA_W_LP,BLA_W_RADL,BLA_N_LP). All three are IRAP frames and must be treated as keyframes. Range corrected to16..=21. Added regression test.is_hevc_keyframe()panicked on data with no Annex B start codes: Anassert_invariant!at the function's exit path (INV-505) fired whenever the data contained no NAL units, which can happen when validation code is given malformed or non-Annex-B input. Replaced with a gracefulfalsereturn. Added unit test.- Redundant
as u8cast in VP9 parser (vp9.rs:229):read_bit()already returnsu8; the cast was flagged byclippy::cast_lossless. Removed.
π API Correctness
MuxerErrorwas not#[non_exhaustive]: Adding error variants in a minor release would have been a breaking change for downstream code using exhaustivematcharms. Attribute added along with a doc note advising callers to use a wildcard arm.
π Discoverability
Cargo.tomlkeywords: Replaced the generic"multimedia"keyword with"hevc"β a primary codec supported by the crate and a far more targeted search term on crates.io.
0.2.4 (May 19, 2026) - Test Rename, Benchmark Repair, Doc Consistency
π Bug Fixes
- Windows test failure resolved: Renamed
tests/video_setup.rstotests/video_track_structure.rs. Windows installer-compatibility heuristics were triggering a UAC elevation prompt on any executable containing "setup" in its name, causing that integration test binary to fail on Windows with OS error 740.
π§ Benchmark Fix
benches/muxing.rsused invalid dummy frames: Both benchmark functions wrote 10 KB zero-byte buffers which fail H.264 validation. Replaced with real fixture data (frame0_key.264,frame1_p.264,frame0.aac.adts) so benchmarks measure a valid mux path end-to-end.
β¨ Documentation
docs/contract.md: Keyframe invariant now lists per-codec header requirements (SPS/PPS for H.264, VPS/SPS/PPS for H.265, Sequence Header OBU for AV1, frame header params for VP9). Pseudo-code example updated toAac(AacProfile::Lc).README.md: Removed fabricated benchmark table with specific Β΅s/throughput numbers that were measured on development hardware; replaced with a pointer tocargo bench. Fixed a stray</details>tag.ROADMAP.md: Removed "audit pass" language from Recent Achievements; entries now describe changes, not process.release-notes/v0.2.1.md,release-notes/v0.2.2.md: Added missing release-note files.
0.2.3 (May 21, 2026) - Documentation, DRY, and Residual Bugs
π Bug Fixes
encode_video()would panic on empty input instead of returning an error:encode_video()calledis_keyframe(data)beforewrite_video()'s empty-data guard. Ifdatawas empty, theassert_invariant!(!data.is_empty())insideis_keyframe()would panic rather than returnMuxerError::EmptyVideoFrame. Fixed by adding an early empty-data guard at the top ofencode_video()sois_keyframe()is never called with empty data.MuxStats.duration_mswas always 0 in CLI JSON output: Theduration_msfield was initialized to 0 and never populated. Fixed by switching frommuxer.finish()tomuxer.finish_with_stats()and deriving the value from the returnedMuxerStats.
π§Ή Removed Vapor / Dead Code
- Dead
let _ = sample_count;inSampleTables::from_samples:sample_countwas already used forVec::with_capacity; the suppression binding at the end of the function was pure dead weight. - Removed unused
use crate::assert_invariant;fromapi.rstop-level imports (the macro is now referenced inline withuseinsideis_keyframe()).
β¨ Documentation
MuxerBuilderstruct doc was stale: Said "B-frame support, fragmented MP4 will be added in future slices" β both are implemented. Replaced with an accurate summary of all supported codecs and output modes.build()comment was stale: Said "In v0, we perform minimal validation... Future releases may relax this." Removed development-phase language.finish_in_place()doc leaked an internal test reference: Removed the stale implementation-specific wording and replaced it with an accurate description.finish()andfinish_with_stats()had no doc comments. Both now documented.finish_in_place_with_stats()doc improved: Now cross-referencesfinish_in_place().write_audio()doc only mentioned AAC: Now explicitly covers Opus packets too.encode_video()andencode_audio()docs were terse single-liners: Expanded to explain the auto-timestamp behaviour, when to use these vs. the explicit-PTS methods, and the meaning of thesamplesparameter.MuxerConfigfields undocumented: All six fields (width,height,framerate,audio,metadata,fast_start) now have field-level doc comments.MuxerStatsfields undocumented: All four fields now have field-level doc comments.Metadata::new(),with_title(),with_creation_time()had no doc comments. Added.MuxerConfig::new(),with_audio(),with_metadata(),with_fast_start()had no doc comments. Added.
π Code Organisation
simple_api_workstest was inthread_safety_testsmodule: Moved to thetestsmodule where it belongs. Themake_h264_keyframe()helper moved with it.test_poisoned_lock_paths_are_handledrenamed ininvariant_ppt.rs: The test was renamed from a prior RwLock-poisoning test. Now namedtest_invariant_log_records_and_clearswhich accurately describes what it does. Stale comment removed.
β»οΈ Refactor
- Magic
3000infragmented.rsreplaced with a named constantFALLBACK_FRAME_DURATION_TICKS(90 000 Hz timescale ticks for one frame at 30 fps). Both uses inflush_segmentandbuild_trunnow reference the constant. - Duplicate DTS span calculation extracted in
FragmentedMuxer:ready_to_flush()andcurrent_fragment_duration_ms()both computed the same span. The shared logic is now in a privatebuffered_duration_ms()helper. Both public methods delegate to it.
0.2.2 (May 20, 2026) - Codebase Audit: Correctness & Idiomatic Rust
π Bug Fixes
- AV1 keyframe detection:
is_keyframe()for AV1 previously returnedtrueonly for the first frame (a "first frame = keyframe" heuristic). It now delegates tocodec::av1::is_av1_keyframe(), which parses actual OBU headers and checks theframe_typebits for correctness. write_video()missing finished guard:write_video()did not checkself.finished, so calling it afterfinish()would silently write into a finalized muxer. It now returnsMuxerError::AlreadyFinishedconsistently withwrite_video_with_dts().fragmented.rsmoov box order:build_moov_fmp4()was emittingmvhd β mvex β trak. ISO 14496-12 Β§8.3 requirestrakto precedemvex. Fixed tomvhd β trak β mvex.info_commandcodec detection always returned "Unknown": The CLI scanned only top-level MP4 box types for FourCCs likeavc1,hvc1,vp09,mp4a. These are deeply nested (insidemoov/trak/mdia/minf/stbl/stsd) and were never found. Fixed by scanning the full buffer withbuffer.windows(4). AV1 (av01) detection also added.creation_timeCLI arg was a stub:--creation-timepreviously printed "Warning: creation_time not yet implemented" and did nothing. Changed toOption<u64>(Unix timestamp, no chrono dep), now properly builds and appliesMetadata::with_creation_time().encode_audio()anti-pattern:is_none()check followed immediately by.unwrap()replaced withlet Some(...) elsebinding.- Misleading invariant in
convert_mp4_error():curr_pts: 0.0hardcoded in theNonIncreasingTimestamperror arm. Now usesself.last_video_pts.unwrap_or(0.0)with a comment clarifying the arm is unreachable (PTS is validated before the inner call).
π§Ή Removed Vapor / Dead Code
- Deleted
src/config.rs: File was never declared inlib.rs, was completely invisible to the compiler, and duplicated structs already defined inapi.rs. Pure dead weight. - Removed duplicate
MuxerBuildermethods:set_create_time(),set_language(),set_video_track(),set_audio_track()were exact duplicates ofwith_metadata(),video(), andaudio(). Callers (CLI) migrated to the canonical methods. - Removed
Muxer::flush(): Exact alias forfinish()with no semantic difference. Removed to eliminate the confusion between "flush" (partial write) and "finish" (finalize). TheFragmentedMuxer::flush_segment()method is unrelated and unaffected. - Removed bogus
assert_invariant!calls fromapi.rs: The AV1 invariantis_key || video_frame_count > 0was a tautology (always true). The VP9 invariantis_key || data.len() >= 3was misleading and wrong as a correctness check. - Removed
assert_invariant!calls from CLI (src/bin/muxide.rs): Ten assertions inmux_commandpanicked instead of returning errors, including always-true enum checks and post-fact checks on already-set state. Replaced meaningful range checks withanyhow::ensure!before builder calls; removed the rest entirely.
β¨ Improvements
MuxerConfig::into_builder(): New method converts aMuxerConfiginto a pre-configuredMuxerBuilder, transferring audio, metadata, and fast_start automatically. Previously callers had to pull out individual fields.src/api.rsmodule doc fixed: Doc comment was placed betweenusestatements as a///item doc. Corrected to//!at the top of the file.read_hex_bytes()returnsResult<Vec<u8>>: Previously usedassert!and.expect()(panics). Now returnsanyhow::Resultwith descriptive errors. All callers updated to propagate with?.&PathBufβ&Pathin CLI functions:process_video_frames(),process_audio_frames(),validate_hex_file()now accept&std::path::Pathper Rust API guidelines.validate_hex_file()simplified: Redundant manual hex-character validation loop removed. Now delegates toread_hex_bytes()which already performs full validation.- Metadata building unified in CLI: Title, creation_time, and language are now built into a single
Metadatastruct instead of being set through disparate methods.
0.2.1 (May 19, 2026) - Bug Fix & CLI Fragmented MP4
π Critical Bug Fix
tkhdduration overflow: The non-fragmented muxer was writing thedurationfield in version-0 Track Header boxes asu64(8 bytes) instead ofu32(4 bytes) per ISO 14496-12 Β§8.3.2. This inserted 4 extra bytes into everytkhdbox, shifting the matrix, width, and height fields to wrong offsets. Players would infer an incorrect Sample Aspect Ratio (e.g.24:5instead of1:1), causing stretched or squished video playback. The fragmented path was already correct; this aligns the non-fragmented path to match. Reported by @peteralm80, confirmed by @zkvsky (issue #5).
β¨ CLI Fragmented MP4 (H.264 + VP9)
- The
--fragmentedflag in themuxsubcommand now works for H.264 and VP9 inputs. The CLI extracts SPS/PPS automatically from the Annex B bitstream for H.264 and VP9 config from the first keyframe for VP9, then writes a spec-correctftyp + moov + moof + mdatfragmented MP4. H.265 and AV1 fragmented output require additional parameter-set arguments not yet exposed in the CLI; those will continue to use the library API directly.
πΊοΈ Roadmap Cleanup
- Removed duplicate sections and speculative placeholder items ("Quantum-Safe Metadata", "Holographic Video Support", "Blockchain-Integrated Provenance", "Neural Codec Interfaces") that had no grounding in the project's mission.
0.2.0 - Fragmented MP4 Multi-Codec & Safety
π¬ Fragmented MP4 (fMP4) Multi-Codec Support
- Multi-Codec fMP4: Fragmented MP4 init+media segment support for H.264, H.265/HEVC, AV1, and VP9
- HEVC
hvcCCorrectness: Config box structure aligns with emitted parameter set arrays; signals 4-byte NAL length prefixes - Explicit Sample Contract: Fragmented video samples are MP4 length-prefixed (4-byte NAL length prefixes), not Annex B start codes
π§± Safety & Contract Enforcement
- Monotonic DTS Enforcement: Fragmented muxer rejects decreasing DTS instead of underflowing
- Timestamp Validation: Rejects non-finite timestamps (NaN/Inf) for video PTS/DTS and audio PTS with specific error variants
- MP4 Size Overflow Hardening: Prevents
mdatsize/offset overflow with deterministic errors
π Interop / Conformance Scope
- Interop Note: H.264 outputs were spot-checked with FFmpeg/ffprobe (non-fragmented MP4 and concatenated fMP4 init+segment); broader player/device conformance validation is ongoing.
0.1.5 (December 30, 2025) - Quality & Completeness
π― VP9 Production Readiness
- Full-Range Support: Implemented proper parsing of VP9 color configuration full-range flags, ensuring accurate vpcC boxes for all VP9 streams
- Metadata Accuracy: Fixed VP9 muxing to generate correct color space metadata instead of hardcoded defaults
π οΈ API Modernization
- Breaking Change: Removed deprecated
Muxer::new()andMuxer::simple()constructors - Unified API: Standardized all muxer construction through
MuxerBuilderfor consistency and maintainability - Migration Path: Updated all examples and documentation to use the modern API
π Enhanced CLI Diagnostics
- Smart Codec Detection:
muxide infocommand now identifies video codecs (H.264, H.265, VP9) and detects audio presence - Better MP4 Analysis: Improved file validation with detailed codec information for troubleshooting
π Documentation & Testing
- Accuracy First: Corrected VP9 feature claims in README to match actual implementation capabilities
- Test Quality: Replaced placeholder CLI tests with functional validation, ensuring command reliability
- Roadmap Alignment: Updated development roadmap to reflect completed VP9 feature parity work
π§ Under the Hood
- Code Quality: Eliminated deprecated APIs and improved internal consistency
- Validation API: Refactored validation functions to use structured config objects for better maintainability
- Build Cleanliness: Resolved all compilation warnings for pristine release builds
- Test Coverage: Maintained 100% test pass rate across 123+ unit tests and property-based validations
0.1.4
No functional changes relative to v0.1.3. Version bump only.
Full Changelog: https://github.com/Michael-A-Kuykendall/muxide/compare/v0.1.3...v0.1.4
0.1.3
No functional changes relative to v0.1.2. Version bump only.
Full Changelog: https://github.com/Michael-A-Kuykendall/muxide/compare/v0.1.2...v0.1.3
0.1.2
- CLI Tool: Complete command-line interface with progress bars, JSON output, and comprehensive muxing options
- Code Quality: Artifact cleanup, improved error handling patterns, and clippy compliance
- Documentation: Enhanced README with complete feature documentation
- Release Polish: Final production-ready codebase with all warnings addressed and comprehensive tests
0.1.1
- AAC Profile Support: Complete implementation of all 6 AAC profiles (LC, Main, SSR, LTP, HE, HEv2)
- ADTS Error Handling: Comprehensive ADTS validation with detailed diagnostics, hex dumps, and recovery suggestions
- MP4E-Compatible APIs: Added
new_with_fragment(),flush(),set_create_time(),set_language()methods - Metadata Support: Title, creation time, and language metadata in MP4 files
- HEVC/H.265 Support: Annex B format with VPS/SPS/PPS configuration
- AV1 Support: OBU stream format with Sequence Header OBU configuration
- Opus Support: Raw Opus packets with 48kHz sample rate
- CLI Tool: Command-line interface with progress bars, JSON output, and comprehensive options
- Invariant PPT Framework: Property-based testing with contract verification
- Documentation: Complete README, governance files (CODE_OF_CONDUCT, CONTRIBUTING, etc.), and roadmap
0.1.0
- MP4 writer with a single H.264 video track (Annex B input).
- Optional AAC audio track (ADTS input).
- 90 kHz media timebase for track timing.
- Dynamic
avcCconfiguration derived from SPS/PPS in the first keyframe. - Deterministic finalisation with explicit errors on double-finish and post-finish writes.
- Specific
MuxerErrorvariants for common failure modes. - Convenience API:
Muxer::new(writer, MuxerConfig). - Finish statistics:
finish_with_stats/finish_in_place_with_stats.