All Projects → alfg → mp4-rust

alfg / mp4-rust

Licence: MIT license
🎥 MP4 reader and writer library in Rust! 🦀

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to mp4-rust

Xml
XML without worries
Stars: ✭ 35 (-76.51%)
Mutual labels:  writer, reader
Iostreams
IOStreams is an incredibly powerful streaming library that makes changes to file formats, compression, encryption, or storage mechanism transparent to the application.
Stars: ✭ 84 (-43.62%)
Mutual labels:  writer, reader
Ini
Ini file reader/writer for C# / .NET written in pure .NET in a single source file
Stars: ✭ 43 (-71.14%)
Mutual labels:  writer, reader
Asmresolver
A library for editing PE files with full .NET metadata support
Stars: ✭ 267 (+79.19%)
Mutual labels:  writer, reader
Acr122u Reader Writer
A simple tool to read/write Mifare RFID tags with an ACR122U device
Stars: ✭ 169 (+13.42%)
Mutual labels:  writer, reader
Spout
Read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way
Stars: ✭ 3,861 (+2491.28%)
Mutual labels:  writer, reader
Cistern
Ruby API client framework
Stars: ✭ 81 (-45.64%)
Mutual labels:  writer, reader
Xopen
open files for buffered reading and writing in #golang
Stars: ✭ 55 (-63.09%)
Mutual labels:  writer, reader
Qtcsv
Library for reading and writing csv-files in Qt.
Stars: ✭ 156 (+4.7%)
Mutual labels:  writer, reader
Bitio
Optimized bit-level Reader and Writer for Go.
Stars: ✭ 145 (-2.68%)
Mutual labels:  writer, reader
iobit
Package iobit provides primitives for reading & writing bits
Stars: ✭ 16 (-89.26%)
Mutual labels:  writer, reader
isobmff
Official repository of the ISO Base Media File Format Reference Software
Stars: ✭ 75 (-49.66%)
Mutual labels:  mp4, isobmff
java-class-tools
Read and write java class files in Node.js or in the browser.
Stars: ✭ 27 (-81.88%)
Mutual labels:  writer, reader
Choetl
ETL Framework for .NET / c# (Parser / Writer for CSV, Flat, Xml, JSON, Key-Value, Parquet, Yaml, Avro formatted files)
Stars: ✭ 372 (+149.66%)
Mutual labels:  writer, reader
maildir
A Go package for reading & writing messages in maildir format
Stars: ✭ 13 (-91.28%)
Mutual labels:  writer, reader
Parquet4s
Read and write Parquet in Scala. Use Scala classes as schema. No need to start a cluster.
Stars: ✭ 125 (-16.11%)
Mutual labels:  writer, reader
DumpTS
Extract elementary stream from all kinds of media files, show inside media meta information and reconstruct Transport-Stream, ISOBMFF, Matroska and MMT media files
Stars: ✭ 25 (-83.22%)
Mutual labels:  mp4, isobmff
Atldotnet
Fully managed, portable and easy-to-use C# library to read and edit audio data and metadata (tags) from various audio formats, playlists and CUE sheets
Stars: ✭ 180 (+20.81%)
Mutual labels:  mp4, reader
gdcl.co.uk-mpeg4
DirectShow MPEG-4 Part 14 (.MP4) Multiplexer and Demultiplexer Filters
Stars: ✭ 27 (-81.88%)
Mutual labels:  mp4
WebAppReader
基于 html5 、 Vue.js 、 Koa、Node.js 以及 EJS 的手机小说阅读器。使用 node.js 模拟后台数据,无实际后台,完全的前后端分离开发。
Stars: ✭ 15 (-89.93%)
Mutual labels:  reader

mp4

MP4 Reader and Writer in Rust 🦀

mp4 is a Rust library to read and write ISO-MP4 files. This package contains MPEG-4 specifications defined in parts:

https://crates.io/crates/mp4

Crates.io Crates.io Docs Rust

Example

use std::fs::File;
use std::io::{BufReader};
use mp4::{Result};

fn main() -> Result<()> {
    let f = File::open("tests/samples/minimal.mp4").unwrap();
    let size = f.metadata()?.len();
    let reader = BufReader::new(f);

    let mp4 = mp4::Mp4Reader::read_header(reader, size)?;

    // Print boxes.
    println!("major brand: {}", mp4.ftyp.major_brand);
    println!("timescale: {}", mp4.moov.mvhd.timescale);

    // Use available methods.
    println!("size: {}", mp4.size());

    let mut compatible_brands = String::new();
    for brand in mp4.compatible_brands().iter() {
        compatible_brands.push_str(&brand.to_string());
        compatible_brands.push_str(",");
    }
    println!("compatible brands: {}", compatible_brands);
    println!("duration: {:?}", mp4.duration());

    // Track info.
    for track in mp4.tracks().values() {
        println!(
            "track: #{}({}) {} : {}",
            track.track_id(),
            track.language(),
            track.track_type()?,
            track.box_type()?,
        );
    }
    Ok(())
}

See examples/ for more examples.

Install

Add to your Cargo.toml:

mp4 = "0.12.0"

Documentation

Development

Requirements

Build

cargo build

Lint and Format

cargo clippy --fix
cargo fmt --all

Run Examples

  • mp4info
cargo run --example mp4info <movie.mp4>
  • mp4dump
cargo run --example mp4dump <movie.mp4>

Run Tests

cargo test

With print statement output.

cargo test -- --nocapture

Run Cargo fmt

Run fmt to catch formatting errors.

rustup component add rustfmt
cargo fmt --all -- --check

Run Clippy

Run Clippy tests to catch common lints and mistakes.

rustup component add clippy
cargo clippy --no-deps -- -D warnings

Run Benchmark Tests

cargo bench

View HTML report at target/criterion/report/index.html

Generate Docs

cargo docs

View at target/doc/mp4/index.html

Web Assembly

See the mp4-inspector project as a reference for using this library in Javascript via Web Assembly.

Related Projects

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].