A Python script to extract audio and video streams from USM (CRI Middleware) files. It automatically demultiplexes USM files (the file extension does not need to be .usm) and attempts to convert the extracted video streams into .mp4 format using FFmpeg.
- Extract video and audio streams (
.adx,.hca,.aix,.ac3) from USM files. - Process a single file or batch-process a directory of files recursively.
- Automatically converts video streams to
.mp4using FFmpeg. - Fix for common mosaic artifacts on the first frame of video streams.
- Python 3.x
- FFmpeg (Must be available in your system's PATH, or the standalone executable can be placed in the same directory as
usm.py, for automatic video conversion to.mp4)
python usm.py [InputPath] [options]InputPath: The path to a single USM file (the.usmextension is not strictly required) or a directory containing such files.
| Flag | Description |
|---|---|
--save-m2v |
Saves the extracted video as .m2v instead of automatically converting to .mp4 with FFmpeg. |
--skip-first-frame |
Skips the first frame of the video to fix mosaic artifacts (requires re-encoding via FFmpeg). |
Process a single file:
python usm.py path/to/video.usmProcess an entire directory (recursive):
python usm.py path/to/folder/Extract without converting to MP4 (keep as .m2v):
python usm.py path/to/video.usm --save-m2vExtract and skip the first frame to fix mosaic artifacts:
python usm.py path/to/video.usm --skip-first-frame