/Get-MediaInfo

Get-MediaInfo is a PowerShell MediaInfo solution

Primary LanguagePowerShell

Get-MediaInfo

Get-MediaInfo is a PowerShell MediaInfo solution.

It consists of three functions:

-

-

Installation


Installation or download via PowerShellGet:

No build provided for PSGallery. Options:

Get-MediaInfoRAW

SYNOPSIS

Get-MediaInfoRAW.ps1 - Returns an object reflecting all of the raw 'low-level' MediaInfo properties of a media file.

DESCRIPTION

Created this variant because I want the full low-level range of MediaInfo.dll properties, and not simply a subset. So this function parses out the -RAW text returned, into a nested General|Video|Audio object

PARAMETERS

-Path

Foo Foo
Path to a media file. Can also be passed via pipeline.[-Path D:\path-to\video.ext]

-StorageUnits

Foo Foo Foo\

-Decimals

Foo Foo Foo\

-fixNames

Foo Foo Foo
Switch to replace spaces and forward-slashes in default MediaInfo property names, with underscores (default's True)

-noPostConversion

Foo Foo Foo\

EXAMPLE 1

PS>$data = Get-MediaInfoRAW 'D:\Samples\Downton Abbey.mkv' ;

Assign the Raw MediaInfo.dll properties for the specified video, as a System.Object to the $data variable.

- - - -

Get-MediaInfoSummary

SYNOPSIS

Get-MediaInfoSummary.ps1 - - Shows a summary in text format for a media file.

DESCRIPTION

Get-MediaInfoSummary.ps1 - - Shows a summary in text format for a media file.

PARAMETERS

-Path

Foo Foo
Path to a media file. Can also be passed via pipeline.[-Path D:\path-to\video.ext]

-Full

Foo Foo Foo
Switch to show a extended summary.[-Full]

-Raw

Foo Foo Foo
Switch to show not the friendly parameter names but rather the names as they are used in the MediaInfo API.[-Raw]

-RawParsed

Foo Foo Foo\

EXAMPLE 1

PS>Get-MediaInfoSummary 'D:\Samples\Downton Abbey.mkv'

Output the default Full media summary for the specified video.

Get-MediaInfoValue

SYNOPSIS

Get-MediaInfoValue.ps1 - Returns specific properties from media files.

DESCRIPTION

Get-MediaInfoValue.ps1 - Returns specific properties from media files.

PARAMETERS

-Path

Foo Foo
Path to a media file.[-Path D:\path-to\video.ext]

-Kind

Foo Foo
A MediaInfo kind (General|Video|Audio|Text|Image|Menu).[-Kind Video] Kinds and their properties can be seen with MediaInfo.NET.

-Index

Foo Foo Foo
Zero based stream number.[-index 0]

-Parameter

Foo Foo
Name of the property to get.[-param 'Performer'] The property names can be seen with MediaInfo.NET with following setting enabled: Show parameter names as they are used in the MediaInfo API They can also be seen with Get-MediaInfoSummary with the -Raw flag enabled.

EXAMPLE 1

PS>Get-MediaInfoValue '.\Meg Myers - Desire (Hucci Remix).mp3' -Kind General -Parameter Performer

output:
Meg Myers
Get the artist from a MP3 file.

EXAMPLE 2

PS>'.\Meg Myers - Desire (Hucci Remix).mp3' | Get-MediaInfoValue -Kind Audio -Parameter 'Channel(s)'

output:
2
Get the channel count in a MP3 file. Return types are always strings and if necessary must be cast to integer.

EXAMPLE 3

PS C:\>Get-MediaInfoValue '.\The Warriors.mkv' -Kind Audio -Index 1 -Parameter 'Language/String'

output:
English
Get the language of the second audio stream in a movie.
The Index parameter is zero based.

EXAMPLE 4

PS C:\>Get-MediaInfoValue '.\The Warriors.mkv' -Kind General -Parameter 'TextCount'

output:
2
Get the count of subtitle streams in a movie.

EXAMPLE 5

PS C:\>$mi = New-Object MediaInfo -ArgumentList $Path ;

$value1 = $mi.GetInfo($Kind, $Index, $Parameter) ;
$value2 = $mi.GetInfo($Kind, $Index, $Parameter) ;
$mi.Dispose() ;
To retrieve specific properties with highest possible performance the .NET class must be used directly: