{"id":40390278,"url":"https://github.com/shiguredo/mp4-rs","last_synced_at":"2026-04-03T05:01:58.991Z","repository":{"id":257798066,"uuid":"851362743","full_name":"shiguredo/mp4-rs","owner":"shiguredo","description":"MP4 library","archived":false,"fork":false,"pushed_at":"2026-03-13T05:14:17.000Z","size":1388,"stargazers_count":151,"open_issues_count":0,"forks_count":3,"subscribers_count":10,"default_branch":"develop","last_synced_at":"2026-03-13T13:58:36.440Z","etag":null,"topics":["mp4","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shiguredo.png","metadata":{"files":{"readme":"README.en.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2024-09-03T00:43:48.000Z","updated_at":"2026-03-13T05:14:40.000Z","dependencies_parsed_at":"2026-03-13T07:24:30.137Z","dependency_job_id":null,"html_url":"https://github.com/shiguredo/mp4-rs","commit_stats":null,"previous_names":["shiguredo/mp4-rust","shiguredo/mp4-rs"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/shiguredo/mp4-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiguredo%2Fmp4-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiguredo%2Fmp4-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiguredo%2Fmp4-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiguredo%2Fmp4-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shiguredo","download_url":"https://codeload.github.com/shiguredo/mp4-rs/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiguredo%2Fmp4-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31296500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T04:33:12.332Z","status":"ssl_error","status_checked_at":"2026-04-02T04:31:13.162Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mp4","rust"],"created_at":"2026-01-20T12:35:54.324Z","updated_at":"2026-04-03T05:01:58.952Z","avatar_url":"https://github.com/shiguredo.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# mp4-rs\n\n[![shiguredo_mp4](https://img.shields.io/crates/v/shiguredo_mp4.svg)](https://crates.io/crates/shiguredo_mp4)\n[![Documentation](https://docs.rs/shiguredo_mp4/badge.svg)](https://docs.rs/shiguredo_mp4)\n[![GitHub Actions](https://github.com/shiguredo/mp4-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/shiguredo/mp4-rs/actions/workflows/ci.yml)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n## About Shiguredo's Open Source Software\n\nWe will not respond to PRs or issues that have not been discussed on Discord. Also, Discord is only available in Japanese.\n\nPlease read \u003chttps://github.com/shiguredo/oss\u003e before use.\n\n## Overview\n\nA zero-dependency, Sans I/O MP4 file mux/demux library implemented in Rust. It can also be used in `no_std` environments.\n\n## Features\n\n- Sans I/O\n  - \u003chttps://sans-io.readthedocs.io/index.html\u003e\n- Zero dependencies\n- `no_std` compatible\n  - \u003chttps://docs.rust-embedded.org/book/intro/no-std.html\u003e\n- MP4 file mux/demux\n- Fragmented MP4 (fMP4) mux/demux\n- Provides high-level APIs\n- Provides C APIs\n- Provides WebAssembly APIs\n- Supports Windows / macOS / Linux\n\n## Supported Codecs\n\n- Audio\n  - AAC (`mp4a`)\n  - Opus (`Opus`)\n  - FLAC (`fLaC`)\n- Video\n  - VP8 (`vp08`)\n  - VP9 (`vp09`)\n  - AV1 (`av01`)\n  - H.264 / AVC (`avc1`)\n  - H.265 / HEVC (`hev1`, `hvc1`)\n\n## Usage\n\n### Demultiplexing an MP4 File\n\nUse `Mp4FileDemuxer` to retrieve track information and samples from an MP4 file.\n\n```rust\nuse shiguredo_mp4::demux::{Input, Mp4FileDemuxer};\n\n// Create a demuxer\nlet mut demuxer = Mp4FileDemuxer::new();\n\n// Supply data incrementally (Sans I/O)\nwhile let Some(required) = demuxer.required_input() {\n    // Read data based on required.position and required.size\n    let data: \u0026[u8] = read_data(required.position, required.size);\n    demuxer.handle_input(Input {\n        position: required.position,\n        data,\n    });\n}\n\n// Retrieve track information\nlet tracks = demuxer.tracks()?;\n\n// Retrieve samples in chronological order\nwhile let Ok(Some(sample)) = demuxer.next_sample() {\n    // sample.track, sample.timestamp, sample.data_offset, sample.data_size\n}\n```\n\n### Creating and Reading Back fMP4 Segments\n\nUse `Fmp4SegmentMuxer` to create media segments and `Fmp4SegmentDemuxer` to read them back.\n\n```rust\nuse shiguredo_mp4::mux::{Fmp4SegmentMuxer, SegmentSample};\nuse shiguredo_mp4::demux::Fmp4SegmentDemuxer;\n\n// Create a media segment with the muxer\nlet mut muxer = Fmp4SegmentMuxer::new()?;\nlet segment = muxer.create_media_segment(\u0026samples)?;\nlet init_segment = muxer.init_segment_bytes()?;\n\n// Read it back with the demuxer\nlet mut demuxer = Fmp4SegmentDemuxer::new();\ndemuxer.handle_init_segment(\u0026init_segment)?;\nlet demuxed = demuxer.handle_media_segment(\u0026segment)?;\n```\n\n## Examples\n\n### demux\n\nDisplays track information and sample information from an MP4 file.\n\n```bash\ncargo run --example demux -- \u003cmp4_file\u003e\n```\n\n### fmp4\n\nAn example that performs fMP4 mux/demux. Can be run without arguments.\n\n```bash\ncargo run --example fmp4\n```\n\n### WebAssembly Examples\n\nSample implementations using WebAssembly are available on GitHub Pages.\n\n- [MP4 Dump](https://shiguredo.github.io/mp4-rs/examples/dump/)\n- [MP4 Transcode](https://shiguredo.github.io/mp4-rs/examples/transcode/)\n\n## Specifications\n\n- ISO/IEC 14496-1\n- ISO/IEC 14496-12\n- ISO/IEC 14496-14\n- ISO/IEC 14496-15\n- [VP Codec ISO Media File Format Binding](https://www.webmproject.org/vp9/mp4/)\n- [AV1 Codec ISO Media File Format Binding](https://aomediacodec.github.io/av1-isobmff/)\n- [Encapsulation of Opus in ISO Base Media File Format](https://gitlab.xiph.org/xiph/opus/-/blob/main/doc/opus_in_isobmff.html)\n- [Encapsulation of FLAC in ISO Base Media File Format](https://github.com/xiph/flac/blob/master/doc/isoflac.txt)\n\n## Roadmap\n\n- Support for AV2\n- Support for H.266 (VVC)\n\n## License\n\nApache License 2.0\n\n```text\nCopyright 2024-2026, Takeru Ohta (Original Author)\nCopyright 2024-2026, Shiguredo Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiguredo%2Fmp4-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshiguredo%2Fmp4-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiguredo%2Fmp4-rs/lists"}