mpls 0.2.0

A movie playlist file (MPLS) parser.
Documentation
  • Coverage
  • 10.9%
    17 out of 156 items documented4 out of 42 items with examples
  • Size
  • Source code size: 119.6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 12.15 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 21s Average build duration of successful builds.
  • all releases: 21s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • domyd/mpls
    5 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • domyd

mpls

Crates.io

A movie playlist file (MPLS) parser. Written in Rust using the nom parser combinator library.

Dual-licensed under MIT and Apache 2.0.

Example

use std::fs::File;
use std::io::Read;
use mpls::Mpls;

fn main() -> std::io::Result<()> {
    // open the playlist file
    let mut file = File::open("00800.mpls")?;

    // parse the play list
    let mpls = Mpls::from(&file).expect("failed to parse MPLS file.");

    // extract the play list's angles
    let angles = mpls.angles();

    // extract the segments
    for angle in angles {
        let segment_numbers: Vec<i32> = angle
            .segments()
            .iter()
            .map(|s| s.file_name.parse::<i32>().unwrap())
            .collect();
        println!("angle {}: {:?}", angle, segment_numbers);
    }

    Ok(())
}

Installation

Add this to your Cargo.toml:

[dependencies]

mpls = "0.2.0"

Documentation

See the reference docs on crates.io.