Skip to content

Add NewMediaTools module to eventually replace MediaTools module - #41

Merged
Dadstart merged 8 commits into
mainfrom
feat/newmediatools
Jul 25, 2025
Merged

Add NewMediaTools module to eventually replace MediaTools module#41
Dadstart merged 8 commits into
mainfrom
feat/newmediatools

Conversation

@Dadstart

Copy link
Copy Markdown
Owner

NewMediaTools Module

Will replace MediaTools module, eventually.

New module scaffolding

CodeNotes
NewMediaTools.psd1Module description
NewMediaTools.psm1Module manifest
install.ps1Add NewMediaTools; Double-quotes to single quotes.
uninstall.ps1Add NewMediaTools; Double-quotes to single quotes.

New functions and types

CodeNotes
Get-MediaFileGets media information from a file using ffprobe. Retrieves MediaFormat, zero or more MediaChapter, and zero or more MediaStream. Returns a MediaFile
MediaFileData object for a media file, with container format, chapters, and streams
MediaFormatData object for container media format
MediaChapterData object for a media file chapter
MediaStreamData object for a media file stream
Get-MediaStreamGets one or more media streams from a file. Returns an array of MediaStream
Convert-MediaFileFunction that converts one or more input files to an output file. This takes in a VideoEncodingSettings and multiple AudioTrackMapping
New-AudioTrackMappingBuilds an AudioTrackMapping class based on the specified parameters
AudioTrackMappingClass representing the mapping of an audio track. This is used by Convert-MediaFile. Can build it's own FFMpeg args.
New-VideoEncodingSettingsBuilds a 'VideoEncodingSettings` class based on the specified parameters
I VideoEncodingSettingsClass representing the video settings. This is used by Convert-MediaFile. Can build its own FFMpeg args.
Export-MediaStreamFunction that exports a stream from a media file.
Format-MediaStreamReturns formatted props describing a MediaStream
Show-MediaStreamDisplays MediaStream objects with type-specific formatting and properties. Used in conjunction with Format-MediaStream
Convert-Directory.os1Sample script that shows how to use Convert-MediaFile on a directory of files

Copied/modified several existing things

CodeNotes
Invoke-FFMpegCopied. Change OutputType for terminal usage. Remove FFMpegResult.
Invoke-FFProbeCopied. Minor updates. Remove FFProbeResult.
Invoke-ProcessCopied. Capture process start result and check for failure. Removed ProcessResult. Use Write-Message
Get-PathMove Create to after the final path is determined so Create can use that
Clean-WhitespaceChanged it to not remove blank lines, only the whitespace

Updated module loading

Update module function/class loading for GitTools, MediaTools, RipTools, and PlexTools.
Also update Shared loading.

Add new documentation:

FileNotes
Docs/media.mdDocumentation for fields from FFProbe output
Docs/media.jsonSample JSON output from FFProbe output

Current MediaTools Changes:

CodeNotes
Export-MediaStreamsFixed; Also use Write-Message

Dadstartand others added 8 commits July 19, 2025 13:13
Fix bad merge
# `NewMediaTools` Module
Will replace `MediaTools` module, eventually.
## New module scaffolding
| Code | Notes |
|-------|--------|
| `NewMediaTools.psd1` | Module description |
| `NewMediaTools.psm1` | Module manifest |
| `install.ps1` | Add NewMediaTools; Double-quotes to single quotes. |
| `uninstall.ps1` | Add NewMediaTools; Double-quotes to single quotes. |
## New functions and types
| Code | Notes |
|-------|--------|
| `Get-MediaFile` | Gets media information from a file using ffprobe. Retrieves `MediaFormat`, zero or more `MediaChapter`, and zero or more `MediaStream`. Returns a `MediaFile` |
| `MediaFile` | Data object for a media file, with container format, chapters, and streams |
| `MediaFormat` | Data object for container media format |
| `MediaChapter` | Data object for a media file chapter |
| `MediaStream` | Data object for a media file stream |
| `Get-MediaStream` | Gets one or more media streams from a file. Returns an array of `MediaStream` |
| `Convert-MediaFile` | Function that converts one or more input files to an output file. This takes in a `VideoEncodingSettings` and multiple `AudioTrackMapping` |
| `New-AudioTrackMapping` | Builds an `AudioTrackMapping` class based on the specified parameters |
| `AudioTrackMapping` | Class representing the mapping of an audio track. This is used by `Convert-MediaFile`. Can build it's own FFMpeg args. |
| `New-VideoEncodingSettings` | Builds a 'VideoEncodingSettings` class based on the specified parameters |
I `VideoEncodingSettings` | Class representing the video settings. This is used by `Convert-MediaFile`. Can build its own FFMpeg args. |
| `Export-MediaStream` | Function that exports a stream from a media file. |
| `Format-MediaStream` | Returns formatted props describing a `MediaStream` |
| `Show-MediaStream` | Displays `MediaStream` objects with type-specific formatting and properties. Used in conjunction with `Format-MediaStream` |
| `Convert-Directory.os1` | Sample script that shows how to use `Convert-MediaFile` on a directory of files |
## Copied/modified several existing things
| Code | Notes |
|-------|--------|
| `Invoke-FFMpeg` | Copied. Change OutputType for terminal usage. Remove `FFMpegResult`. |
| `Invoke-FFProbe` | Copied. Minor updates. Remove `FFProbeResult`. |
| `Invoke-Process` | Copied. Capture process start result and check for failure. Removed `ProcessResult`. Use `Write-Message` | `Test-FFMpegInstalled` | Copied. Use Get-Command to detect ffmpeg |
| `Get-Path` | Move Create to after the final path is determined so Create can use that |
| `Clean-Whitespace` | Changed it to not remove blank lines, only the whitespace |
## Updated module loading
Update module function/class loading for `GitTools`, `MediaTools`, `RipTools`, and `PlexTools`.
Also update `Shared` loading.
## Add new documentation:
| File | Notes |
|-------|--------|
| `Docs/media.md` | Documentation for fields from FFProbe output |
| `Docs/media.json` | Sample JSON output from FFProbe output |
## Current `MediaTools` Changes:
| Code | Notes |
|-------|--------|
| `Export-MediaStreams` | Fixed; Also use Write-Message |
Clean-Whitespace run on the repo.
@Dadstart
Dadstart merged commit 459584a into mainJul 25, 2025
2 of 8 checks passed
@Dadstart
Dadstart deleted the feat/newmediatools branch July 25, 2025 18:24
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@Dadstart