Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

Ayush1325/media_infer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Small Crate to infer various media containers. Works by reading Magic Bytes.

Supported Containers

  • MKV
  • ASF
  • GXF
  • WTV
  • RCWT
  • MP4
  • TS
  • M2TS
  • PS
  • Tivo PS
  • MXF

Examples

Get Container type from starting bytes

let buf = [0x1a, 0x45, 0xdf, 0xa3, 0, 1];
let kind = media_infer::ContainerType::from_bytes(&buf);

assert_eq!(kind, Ok(media_infer::ContainerType::MKV));
#+end_src

** Get Container type from path to file
#+begin_src rust
use std::path::PathBuf;

let file_path = PathBuf::from("some.abc");
let kind = media_infer::ContainerType::from_file_path(&file_path);

Get Container type from open file

use std::fs::File;

let mut file = File::open("some.abc").unwrap();
let kind = media_infer::ContainerType::from_file(&mut file);

Resources

About

Small Crate to infer various media containers. Works by reading Magic Bytes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages