1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//! # rsmediainfo
//!
//! A Rust library for extracting media file metadata through the MediaInfo
//! shared library.
//!
//! ## Overview
//!
//! Provides a safe Rust interface on top of the MediaInfo C library so
//! callers can extract detailed metadata from audio, video, and other media
//! files without writing FFI code themselves. The crate covers the full
//! surface most callers need:
//!
//! - file, reader, and URL inputs through a single [`MediaInfo::parse`]
//! entrypoint plus a family of specialized helpers
//! - structured track models with typed and dynamic attribute access
//! - raw text, JSON, XML, and `%`-delimited template output formats
//! - configurable parsing through [`ParseOptions`]
//! - reusable [`MediaInfoContext`] for batch workloads that parse many
//! files in a row without repeating the shared library load cost
//! - a typed error model ([`MediaInfoError`]) that surfaces every failure
//! mode of the underlying library through [`Result`]
//! - cross-platform support (Windows, macOS, Linux) for both x86_64 and
//! arm64 where the underlying library publishes a build
//!
//! ## Library availability
//!
//! The MediaInfo shared library must be available at runtime. By default
//! the `bundled` feature is enabled, which downloads a copy of the library
//! for the target platform during the build and ships it alongside the
//! resulting binary. To use a system-installed copy instead, disable
//! default features:
//!
//! ```bash
//! cargo build --no-default-features
//! ```
//!
//! When the bundled feature is enabled but downloads are not desirable
//! (offline builds, sandboxed CI), set `RS_MEDIAINFO_SKIP_DOWNLOAD=1`. The
//! download timeout can be tuned with `RS_MEDIAINFO_DOWNLOAD_TIMEOUT`.
//!
//! ## Quickstart
//!
//! ```no_run
//! use rsmediainfo::MediaInfo;
//!
//! // Parse a file from disk and walk its tracks.
//! let mi = MediaInfo::parse_media_info("video.mp4").unwrap();
//! for track in mi.tracks() {
//! println!("{} track", track.track_type());
//! }
//! ```
//!
//! Runnable end-to-end examples for the most common workflows live under
//! the crate's `examples/` directory:
//!
//! - `parse_path` — parse a media file from a path on disk
//! - `parse_reader` — parse from an already-open `File` via `BufReader`
//! - `parse_url` — fetch a remote file and parse it through an in-memory
//! cursor
//! - `parse_raw_output` — request raw JSON output instead of a structured
//! value
//! - `parse_xml` — construct a [`MediaInfo`] directly from a pre-generated
//! XML string with no shared library required at runtime
//! - `batch_parse` — build a [`MediaInfoContext`] once and parse a list of
//! files through it without reloading the shared library
//!
//! Run any of them with `cargo run --example <name>`.
//!
//! ## Thread safety
//!
//! The underlying media library shares option state across every handle in
//! the process, so this crate serializes parse calls behind an internal
//! mutex to keep results deterministic. Pure XML parsing through
//! [`MediaInfo::from_xml`] is fully concurrent and never takes the lock.
//! See the README's "Thread safety" section for the full story.
pub use ;
pub use ;
pub use ;
/// Crate version, taken from `CARGO_PKG_VERSION` at compile time.
pub const VERSION: &str = env!;