Skip to content
Nongorilla edited this page Jun 14, 2018 · 21 revisions

Mediags Software Suite

Mediags is a suite of programs that perform media file diagnostics. The suite consists of three products:

What these products have in common is their deep knowledge of file formats, with a focus on media files. All this knowledge is stored in a single library that is common to all executables. This ensures that functionality remains consistent regardless of the front end.

Each program is a standalone, portable .NET executable. All programs are console only except UberFLAC which also includes a GUI version.

Programs may be installed by xcopy (simply copying any of the four executables) or by running a provided .msi installer. The installer optionally modifies Explorer's right-click menu to invoke these tools on it's current directory. Aside from the registry changes made for Explorer's right-click menu, there are no registry changes or settings files.

Mediags

Description

Mediags is a console program that scans directories for media files and verifies the integrity of those files. Detailed content reports may optionally be produced. At this time the following types are supported:

ape, asf/wmv/wma, avi/divx, cue, db (Thumbs), flac, flv, gif, ico, jpg/jpeg, log (EAC), log (XLD), m3u, m3u8, m4a, md5, mkv/mka, mov/qt, mp3, mp4, mpg/mpeg/vob, ogg, png, sha1, sha1x, sha256, wav

Mediags will verify any internal CRC or self-hash against the file contents and report mismatches caused by bit rot, truncation, tampering, etc. Types that store CRCs and self-hashes include FLAC, JPEG, MP3 (LAME only), OGG, PNG, and EAC logs. Mediags makes no assumption of content based on extension - every file's contents are analyzed for its actual type. Total errors will be displayed at the end along with total file counts. Zero errors and zero warnings are good.

For first time use, the following line is recommended:

mediags /g:quiet .

The /g:quiet switch will produce a less detailed report with only the most serious issues being reported. Later reports may be produced with greater granularity. See usage below.

Usage

mediags [/R] [/f:<wildcard>] [/g:<granularity>] [/h:<hashes>] [/v:<validations>] [/w:<escalators>] [/e:<escalators>] [/out:<mirror>] [/p:<counter>] [/x:<exclusion>] [/k] <fileOrDirectory>

Where <granularity> is one of Detail, Long, Verbose, Advisory, Terse, Quiet, Summary

Where <hashes> is list from None, Intrinsic, FileMD5, FileSHA1, FileSHA256, MetaSHA1, MediaSHA1, PcmCRC32, PcmMD5, WebCheck

Where <validations> is list from None, Exists, MD5, SHA1, SHA256

Where <escalators> is list from HasId3v1, HasId3v24, HasApe, Substandard, Overstandard, ProveErr, ProveWarn, Fussy

Where <fileOrDirectory> is a file or directory name without wildcards.

If a directory name contains <exclusion>, it will not be traversed.

Example switches:

Use /f:*.log to diagnose only files with the .log extension.

Use /k to wait for keypress before exiting.

Use /g:detail to display maximum diagnostics.

Use /out:results.txt to mirror output to results.txt.

Use /p:0 to suppress the progress counter.

Use /R to prompt for confirmation to repair fixable issues with the file. Each and every repair must be confirmed before attempted. The following issues may be repaired:

  1. Phantom MP3 ID3v1 tag.
  2. EAC-induced bug that sometimes creates an MP3 with a bad ID3v2 tag size.
  3. End-of-file watermarks on .avi, .mp4 and .mkv files. This is bogus data that can be removed without harm.
  4. Incorrect file extensions.

Example session

In this session, /R is supplied to repair files:


N:\Vid>mediags /R /g:detail /h:filemd5 .
Mediags v4.0.0

N:\Vid\
MST3K - 0309 - 20010930 - The Amazing Colossal Man.mpg

File MD5  = A9963B6C7E061FF2C1BF6E68B3428E16
File size = 728020992

RIFF size = 728019000
JUNK size = 1992
Codec = MP42
Streams = 2
Resolution = 480x360

Diagnostics:
  Warning: True file format is .avi

Rename to extension of .avi? y
Repair successful!

Mediags can be used as an EAC log checker that performs a subset of the comprehensive checks performed by UberLAME or UberFLAC. To include validation of the EAC log self-hash, supply /h:webcheck as seen here:


T:\FLAC>mediags /g:verbose /h:webcheck /f:*.log .
Mediags v4.0.0

T:\FLAC\Ministry - 1995 - Filth Pig\
Ministry - 1995 - Filth Pig.FLAC.CHECKED.log
  AccurateRip verification confidence 24 (v2).
  CUETools DB verification confidence 12.
  EAC log self-hash verification successful.
T:\FLAC\Peter Gabriel - 1982 - Security\
Peter Gabriel - 1982 - Security.log
  AccurateRip verification confidence 61 (v2).
  CUETools DB verification confidence 56.
- Warning: EAC log self-hash not present.
T:\FLAC\Radiation City - 2012 - Cool Nightmare\
Radiation City - 2012 - Cool Nightmare.FLAC.CHECKED.log
  AccurateRip verification confidence 2 (v2).
  CUETools DB verification confidence 2.
  Test/copy CRC-32s match for all tracks.
  EAC log self-hash verification successful.

---- ---- ---- ---- ----
3 total files diagnosed
3 log (EAC) files
1 file with warnings
0 files with errors

UberFLAC

Description

The purpose of the UberFLAC project is to enable the long term archival of audio compact disc contents to secondary media. Such an archive is intended to function as an exact historical record while also a living media library that may be accessed from popular media players.

UberFLAC requires that extraction of CD contents must be performed by the Exact Audio Copy program (EAC) with the CUETools plugin and proper configuration. The extraction results must be contained within a single directory and that directory must not contain any results from another extraction.

Once the disc content is extracted, UberFLAC takes over. By deep analysis of the EAC log file and corresponding audio files, UberFLAC guarantees that the extracted audio is exact and complete. Verification by UberFLAC should be repeated periodically to ensure that quality has not degraded due to media failure or user error.

Directories may be "signed" by UberFLAC as correct by renaming the log file to include a signature and generating an MD5 hash file. If a signature is provided and there are errors, a diagnostics text file will be placed in the offending directory and the directory will be given an error prefix.

For a guide to installing EAC along with tagging requirements, see the UberFLAC Guide.

Usage

uberflac [/autoname[:<strategy>]] [/fussy] [/g:<granularity>] [/k] [/md5] [/out:<file>] [/p:<n>] [/prove[:web]] [/rg] [/safety:<n>] [/sig:<signature>] [/ubertags] <directory>

Where <strategy> is one of Manual, ArtistTitle, ShortTitle, UnloadedAlbum

Where <granularity> is one of Detail, Long, Verbose, Advisory, Terse, Quiet

Where <directory> is a relative or absolute directory name without wildcards.

Example switches:

Use /autoname to rename files based on tag values. See Naming Strategies for details.

Use /fussy to escalate rip acceptability issues.

Use /g:verbose to get more feedback.

Use /k to wait for keypress before exiting.

Use /md5 to also perform MD5 verifications of FLACs. For the paranoid.

Use /out:results.txt to mirror console output to results.txt.

Use /p:0 to suppress the progress counter.

Use /prove to escalate the severity of rip integrity issues.

Use /prove:web to escalate rip issues and verify EAC log hash. Requires web connection.

Use /rg to add ReplayGain on first signing.

Use /safety:0 to disable prompting after consecutive rip invalidations (default is 3).

Use /sig:SIG to sign (rename) the .log file and create a .md5 digest.

Use /ubertags to escalate substandard tagging issues.

Example session

In the session below, one of the two rips is corrupt due to EAC log file tampering and therefore fails.


T:\My library\FLAC>uberflac /g:verbose /prove:web /sig:CHECKED .
UberFLAC v4.0.0

T:\My library\FLAC\

  No EAC-to-FLAC rip found.

T:\My library\FLAC\Peter Gabriel - 1982 - Security\
01 - The Rhythm of the Heat.flac
02 - San Jacinto.flac
03 - I Have the Touch.flac
04 - The Family and the Fishing Net.flac
05 - Shock the Monkey.flac
06 - Lay Your Hands on Me.flac
07 - Wallflower.flac
08 - Kiss of Life.flac
Peter Gabriel - 1982 - Security.log
  AccurateRip verification confidence 67 (v2).
  CUETools DB verification confidence 93.
  Test/copy CRC-32s match for all tracks.
  EAC log self-hash verify successful.
  CRC-32, CRC-16 & tag checks of 8 FLACs successful.
Peter Gabriel - 1982 - Security.m3u
  Playlist created.
Peter Gabriel - 1982 - Security.FLAC.CHECKED.md5
  Digest created.

+ EAC log is signed and uber!

T:\My library\FLAC\Whitney Houston - 1991 - The Star Spangled Banner\
The Star Spangled Banner.log
  AccurateRip verification confidence 5 (v2).
  CUETools DB verification confidence 8.
  Test/copy CRC-32s match for all tracks.
* Error: EAC log self-hash mismatch, file has been modified.

* EAC rip is not uber.

---- ---- ---- ---- ----
12 total files checked
 8 flac files
 2 log (EAC) files (1 signed)
 1 m3u file (1 created)
 1 md5 file (1 created)
 0 files with warnings
 1 file with errors

UberFLAC is also available with a Windows graphical user interface. The GUI version works on only one directory at a time. For more information on the GUI version of UberFLAC, see UberFLAC over WPF.

UberLAME

Description

UberLAME is an MP3 rip validator which leveraged the existing Mediags/UberFLAC codebase. It is a standalone portable application that may be invoked from the command line or installed to be invoked from Explorer's right-click menu. To see usage details, invoke with no arguments.

Usage

uberlame [/fussy] [/g:<granularity>] [/k] [/logtag] [/out:<mirror>] [/p:<n>] [/safety:<n>] [/sig:<signature>] [/verify[:web]] <directory>

Where <granularity> is one of Detail, Long, Verbose, Advisory, Terse, Quiet

Where <directory> is a relative or absolute directory name without wildcards.

Example switches:

Use /fussy to escalate rip acceptability issues.

Use /g:verbose to get more feedback.

Use /k to wait for keypress before exiting.

Use /logtag to insert the encoding profile into the EAC .log name.

Use /out:results.txt to mirror output to results.txt.

Use /p:0 to suppress the progress counter.

Use /safety:0 to disable prompting after consecutive rip invalidations (default is 3).

Use /sig:SIG to sign (rename) EAC log file and create .sha1x digest.

Use /verify:web to verify EAC 1.x log self-hashes online.

Example session

Let's enforce (sign) a sample rip for the first time. Here is the rip contents before enforcement:


T:\My library\MP3>dir /B "King Crimson - 1974 - Red"
01 - Red.mp3
02 - Fallen Angle.mp3
03 - One More Red Nightmare.mp3
04 - Providence.mp3
05 - Starless.mp3
King Crimson - 1974 - Red.log

Now let's enforce (sign) this rip. The first parameter specifies a user ID. The second parameter instructs UberLAME to verify the .log self-hash by contacting the EAC web site.


T:\My library\MP3>uberlame /sig:CHECKED /logtag:V2 /verify:web .
T:\My library\MP3\King Crimson - 1974 - Red\
King Crimson - 1974 - Red.log
  EAC log self-hash verify successful.
  CRC-16 checks of 5 MP3s successful.
King Crimson - 1974 - Red.LAME.CHECKED.sha1x
  Digest created.

+ EAC rip is signed and uber!

--- --- --- --- --- --- --- ---
7 total files checked
1 log (EAC) file
5 mp3 files
1 sha1x file (1 created)
0 files with warnings or errors

Here is the directory contents after signing:


T:\My library\MP3>dir /B "King Crimson - 1974 - Red"
01 - Red.mp3
02 - Fallen Angle.mp3
03 - One More Red Nightmare.mp3
04 - Providence.mp3
05 - Starless.mp3
King Crimson - 1974 - Red.LAME.CHECKED.sha1x
King Crimson - 1974 - Red.log

UberLAME has created a file with the extension of .sha1x that stores a hash of the log file along with hashes of the audio portions of the MP3s. Subsequent validations require that these SHA1 hashes are unchanged for success. Modifying this .sha1x file outside UberLAME will invalidate it.

The EAC log name and MP3 file names may be changed if the rip is re-signed afterwards. Metadata such as tags may be altered and does not require re-signing. In this next example, track 2 is renamed and a .m3u playlist is added. This example also includes the /g:verbose switch to provide additional detail:


T:\My library\MP3>uberlame /sig:CHECKED /verify:web /g:verbose .
UberLAME v4.1.0

T:\My library\MP3\

  No EAC-to-MP3 rip found.

T:\My library\MP3\King Crimson - 1974 - Red\
01 - Red.mp3
02 - Fallen Angel.mp3
03 - One More Red Nightmare.mp3
04 - Providence.mp3
05 - Starless.mp3
King Crimson - 1974 - Red.log
  AccurateRip verification confidence 9 (v2).
  CUETools DB verification confidence 106.
  Test/copy CRC-32s match for all tracks.
  CRC-16 checks of 5 MP3s successful.
Red picks.m3u
  Existence checks of 2 files successful.
King Crimson - 1974 - Red.LAME.CHECKED.sha1x
  EAC log self-hash previously verified.
  Track renamed to '02 - Fallen Angel.mp3'.
  SHA-1 checks of log, 5 MP3 audios successful.
  Change log updated with 'renamed'.

+ EAC rip is uber!

--- --- --- --- --- --- --- ---
8 total files checked
1 log (EAC) file
1 m3u file
5 mp3 files
1 sha1x file
0 files with warnings or errors

This example showed the additional detail provided with the /g:verbose switch including the listing of track names and EAC rip details. The output also showed that the .sha1x file was updated with the new file name and that the contents of the new playlist was validated. If the /sig switch had not been provided, the file renaming would have otherwise caused this validation to fail.

Here is the contents of the revised .sha1x file:


; generated by UberLAME v4.1.0
; 27B3D1AB do not modify
;
; 20180610 12:41:55: CHECKED: ripped
; 20180610 12:41:55: CHECKED: verified
; 20180610 12:45:58: CHECKED: renamed
;
def6875bc8448c3c4b7098065ba4c92e54aae8bf *King Crimson - 1974 - Red.log
12558dbc4fc843ef2a769a7e2a7648c9d0eb2939 :01 - Red.mp3
fec154a835bf6dcdde693d3b24ccf3c8396f492a :02 - Fallen Angel.mp3
7cbbe852010be145ed95f6c507921cc018140164 :03 - One More Red Nightmare.mp3
7f5cbcff3e53ebc74e6cae7bd90eeb907275f482 :04 - Providence.mp3
284bca618348782937f95cf104da36568a534438 :05 - Starless.mp3

This format would be compatible with the .sha1 format except for the colon (:) preceeding the MP3 file names to indicate that the SHA1's hash only the audio portion of their files.