项目作者: stax76

项目描述 :
Get-MediaInfo is a complete PowerShell MediaInfo solution
高级语言: PowerShell
项目地址: git://github.com/stax76/Get-MediaInfo.git
创建时间: 2019-10-16T07:00:49Z
项目社区:https://github.com/stax76/Get-MediaInfo

开源协议:

下载


Get-MediaInfo

Get-MediaInfo is a PowerShell MediaInfo solution.

It consists of three functions:

-

-

Installation

Installation or download via PowerShellGet:

https://www.powershellgallery.com/packages/Get-MediaInfo

Get-MediaInfo

Converts media file objects into MediaInfo objects.

  1. NAME
  2. Get-MediaInfo
  3. SYNTAX
  4. Get-MediaInfo [[-Path] <string[]>] [-Video] [-Audio] [<CommonParameters>]
  5. ALIASES
  6. gmi

Description

Converts media file objects into MediaInfo objects.

Examples

Displays media files of the defined folder using a grid view.

  1. Get-ChildItem 'D:\Samples' | Get-MediaInfo | Out-GridView

Same as above but using the current folder and aliases.

  1. gci | gmi | ogv

Find duplicates by comparing the duration.

  1. gci | gmi | select filename, duration, filesize | group duration | where { $_.count -gt 1 } | select -expand group | format-list

Parameters

-Path

String array with audio or video files or FileInfo objects via pipeline.

-Video

Only video files will be processed.

-Audio

Only audio files will be processed.

Input

String array with audio or video files as Path parameter or FileInfo objects via pipeline.

Output

MediaInfo objects.

Get-MediaInfoValue

Returns specific properties from media files.

  1. NAME
  2. Get-MediaInfoValue
  3. SYNTAX
  4. Get-MediaInfoValue
  5. [-Path] <string>
  6. [-Kind] {General | Video | Audio | Text | Image | Menu}
  7. [[-Index] <int>]
  8. [-Parameter] <string>
  9. [<CommonParameters>]
  10. ALIASES
  11. gmiv

Description

Returns specific properties from media files.

Examples

Get the artist from a MP3 file.

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

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

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

Get the language of the second audio stream in a movie.

The Index parameter is zero based.

  1. Get-MediaInfoValue '.\The Warriors.mkv' -Kind Audio -Index 1 -Parameter 'Language/String'
  2. English

Get the count of subtitle streams in a movie.

  1. Get-MediaInfoValue '.\The Warriors.mkv' -Kind General -Parameter 'TextCount'
  2. 2

Parameters

-Path

Path to a media file.

-Kind General | Video | Audio | Text | Image | Menu

A MediaInfo kind.

Kinds and their properties can be seen with MediaInfo.NET.

-Index

Zero based stream number.

-Parameter

Name of the property to get.

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.

Input

Input can be defined with the Path parameter, pipe input supports a path as string or a FileInfo object.

Output

Output will always be of type string and must be cast to other types like integer if necessary.

Using the .NET class directly for highest performance

To retrieve specific properties with highest possible performance the .NET class must be used directly:

  1. $mi = New-Object MediaInfo -ArgumentList $Path
  2. $value1 = $mi.GetInfo($Kind, $Index, $Parameter)
  3. $value2 = $mi.GetInfo($Kind, $Index, $Parameter)
  4. $mi.Dispose()

Get-MediaInfoSummary

Shows a summary in text format for a media file.

  1. NAME
  2. Get-MediaInfoSummary
  3. SYNTAX
  4. Get-MediaInfoSummary [-Path] <string> [-Full] [-Raw] [<CommonParameters>]
  5. ALIASES
  6. gmis

Description

Shows a summary in text format for a media file.

Examples

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

Parameters

-Path

Path to a media file. Can also be passed via pipeline.

-Full

Show a extended summary.

-Raw

Show not the friendly parameter names but rather the names as they are used in the MediaInfo API.

Parameter names passed to Get-MediaInfoValue -Parameter must use the raw parameter name.

Input

Path as string to a media file. Can also be passed via pipeline.

Output

A summary line by line as string array.

Find a list of related apps:

https://stax76.github.io/frankskare