Skip to content

Commit

Permalink
Merge pull request #7 from patrickenfuego/x264
Browse files Browse the repository at this point in the history
Merge x264 into main
  • Loading branch information
patrickenfuego authored Jun 21, 2022
2 parents d2d6d31 + 5f6aaa4 commit 46dcf85
Show file tree
Hide file tree
Showing 50 changed files with 2,852 additions and 1,976 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ sandbox.ps1
.VSCodeCounter
*.DS_Store
**/.idea
**/__pycache__
**/config.toml
**/__pycache__
675 changes: 403 additions & 272 deletions FFEncoder.ps1

Large diffs are not rendered by default.

188 changes: 116 additions & 72 deletions README.md

Large diffs are not rendered by default.

Binary file removed bin/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
ffmpeg_path = 'ffmpeg'
ffprobe_path = 'ffprobe'
dee_path = 'dee.exe'
dee_path = 'dee'
temp_path = ''
# empty: next to the script
# relative path: from your current directory
# you can also use fullpath
# in any case will be created automatically if it doesn't exist already
wsl = false # set this to true if you run the script in Linux but use the Windows version of DEE
logo = 1 # set between 1 and 10, use the -pl/--printlogos option to see the available logos, set to 0 to disable logo
logo = 0 # set between 1 and 10, use the -pl/--printlogos option to see the available logos, set to 0 to disable logo
show_summary = true
threads = 6 # You can overwrite this with -t/--threads. The threads number will be clamped between 1 and cpu_count() - 2.

















Binary file added bin/linux/dee_wrapper/deew
Binary file not shown.
29 changes: 29 additions & 0 deletions bin/mac/dee_wrapper/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ffmpeg_path = 'ffmpeg'
ffprobe_path = 'ffprobe'
dee_path = 'dee'
temp_path = ''
# empty: next to the script
# relative path: from your current directory
# you can also use fullpath
# in any case will be created automatically if it doesn't exist already
wsl = false # set this to true if you run the script in Linux but use the Windows version of DEE
logo = 0 # set between 1 and 10, use the -pl/--printlogos option to see the available logos, set to 0 to disable logo
show_summary = true
threads = 6 # You can overwrite this with -t/--threads. The threads number will be clamped between 1 and cpu_count() - 2.

















Binary file added bin/mac/dee_wrapper/deew
Binary file not shown.
56 changes: 56 additions & 0 deletions bin/windows/dee_wrapper/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
ffmpeg_path = 'ffmpeg'
ffprobe_path = 'ffprobe'
dee_path = 'dee'
temp_path = ''
# empty: next to the script
# relative path: from your current directory
# you can also use fullpath
# in any case will be created automatically if it doesn't exist already
wsl = false # set this to true if you run the script in Linux but use the Windows version of DEE
logo = 0 # set between 1 and 10, use the -pl/--printlogos option to see the available logos, set to 0 to disable logo
show_summary = true
threads = 6 # You can overwrite this with -t/--threads. The threads number will be clamped between 1 and cpu_count() - 2.












































Binary file added bin/windows/dee_wrapper/deew.exe
Binary file not shown.
24 changes: 12 additions & 12 deletions modules/FFTools/FFTools.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@
RootModule = 'FFTools.psm1'

# Version number of this module.
ModuleVersion = '1.0'
ModuleVersion = '2.0.0'

# Supported PSEditions
# CompatiblePSEditions = @()
CompatiblePSEditions = 'Core'

# ID used to uniquely identify this module
GUID = '9f724436-f327-4487-8eb9-1704f92283c8'

# Author of this module
Author = 'Patrick Kelly'
Author = 'patrickenfuego'

# Company or vendor of this module
CompanyName = 'NA'

# Copyright statement for this module
Copyright = '(c) 2021 patrickenfuego, quietvoid, deew, and the FFMpeg developers.'
Copyright = '(c) 2022 patrickenfuego, Moritz Bunkus, quietvoid, pcroland, Multicoreware, and the FFMpeg developers.'

# Description of the functionality provided by this module
Description = 'Module designed to make interfacing with FFMpeg tools easier for audio/video encoding'

# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '7.1'
PowerShellVersion = '7.0'

# Name of the Windows PowerShell host required by this module
# PowerShellHostName = ''
Expand Down Expand Up @@ -70,13 +70,13 @@ PowerShellVersion = '7.1'

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = 'Invoke-FFMpeg', 'Invoke-TwoPassFFMpeg', 'New-CropFile', 'Measure-CropDimensions', 'Remove-FilePrompt', 'Write-Report', 'Confirm-HDR10Plus',
'Confirm-DolbyVision', 'Confirm-ScaleFilter', 'Invoke-MkvMerge'
'Confirm-DolbyVision', 'Confirm-ScaleFilter', 'Invoke-MkvMerge', 'Invoke-DeeEncoder', 'Read-TimedInput', 'Invoke-VMAF'

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
# CmdletsToExport = @()

# Variables to export from this module
VariablesToExport = 'progressColors', 'warnColors', 'emphasisColors'
VariablesToExport = 'progressColors', 'warnColors', 'emphasisColors', 'errColors', 'osInfo', 'banner1', 'banner2', 'exitBanner', 'ScriptsDirectory', 'release'

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = 'iffmpeg', 'cropfile', 'cropdim'
Expand All @@ -89,10 +89,10 @@ AliasesToExport = 'iffmpeg', 'cropfile', 'cropdim'

# List of all files packaged with this module
FileList = 'FFTools.psd1', 'FFTools.psm1', 'Private\Set-AudioPreference.ps1', 'Private\Get-SubtitleStream', 'Private\Set-SubtitlePreference',
'Private\Get-HDRMetadata.ps1', 'Public\Invoke-FFMpeg.ps1', 'Public\Invoke-TwoPassFFMpeg.ps1', 'Public\New-CropFile.ps1', 'Public\Measure-CropDimensions.ps1',
'Private\ConvertTo-Stereo.ps1', 'Private\Set-PresetParameters.ps1', 'Private\Set-FFMPegArgs.ps1', 'Private\Set-VideoFilter.ps1', 'Private\Set-TestParameters.ps1',
'Private\Set-DVArgs.ps1', 'Private\Invoke-DeeEncoder.ps1','Utils\Confirm-ScaleFilter.ps1','Utils\Write-Report.ps1', 'Utils\Invoke-MkvMerge.ps1',
'Utils\Confirm-HDR10Plus.ps1', 'Utils\Confirm-DolbyVision.ps1', 'Utils\Remove-FilePrompt.ps1'
'Private\Get-HDRMetadata.ps1', 'Public\Invoke-FFMpeg.ps1', 'Public\Invoke-TwoPassFFMpeg.ps1', 'Public\New-CropFile.ps1', 'Public\Measure-CropDimensions.ps1', 'Public\Invoke-VMAF.ps1',
'Private\ConvertTo-Stereo.ps1', 'Private\Set-PresetParameters.ps1', 'Private\Set-FFMPegArgs.ps1', 'Private\Set-VideoFilter.ps1', 'Private\Set-TestParameters.ps1',
'Private\Confirm-Parameters.ps1', 'Private\Set-DVArgs.ps1', 'Utils\Invoke-DeeEncoder.ps1','Utils\Confirm-ScaleFilter.ps1','Utils\Write-Report.ps1',
'Utils\Invoke-MkvMerge.ps1', 'Utils\Confirm-HDR10Plus.ps1', 'Utils\Confirm-DolbyVision.ps1', 'Utils\Remove-FilePrompt.ps1'

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{
Expand All @@ -102,7 +102,7 @@ PrivateData = @{
Category = "Video Encoding"

# Tags applied to this module. These help with module discovery in online galleries.
Tags = @("ffmpeg", "4K", "HDR", "x265", "H.265", "FFEncoder", "PowerShellCore")
Tags = @("ffmpeg", "4K", "HDR", "x265", "x264", "H.265", "FFEncoder", "PowerShellCore")

# A URL to the license for this module.
# LicenseUri = ''
Expand Down
131 changes: 123 additions & 8 deletions modules/FFTools/FFTools.psm1
Original file line number Diff line number Diff line change
@@ -1,15 +1,56 @@
#Setting Module Run Location
<#
MODULE VARIABLES
Local
Set module/script paths
Set ANSI escape sequences
DEE Variables - Some can be manually set here, or dynamically generated by the script
Export
Console color hashes
OSType Verification
Banners
Current Script Release
#>

# Setting Module Run Location
$ScriptPath = Split-Path $MyInvocation.MyCommand.Path
$PSModule = $ExecutionContext.SessionState.Module
$PSModuleRoot = $PSModule.ModuleBase

## Module Variables ##
$ScriptsDirectory = [System.IO.Path]::Join($(Get-Item $ScriptPath).Parent.Parent, 'scripts')

$progressColors = @{ForegroundColor = 'Green'; BackgroundColor = 'Black'}
$warnColors = @{ForegroundColor = 'Yellow'; BackgroundColor = 'Black'}
$emphasisColors = @{ForegroundColor = 'Cyan'; BackgroundColor = 'Black'}
$errColors = @{ ForegroundColor = 'Red'; BackgroundColor = 'Black'}

# Ansi colors
$aYellow = $PSStyle.Foreground.BrightYellow
$aRed = $PSStyle.Foreground.Red
$aBlue = $PSStyle.Foreground.Blue
$aBBlue = $PSStyle.Foreground.BrightBlue
$aGreen = $PSStyle.Foreground.Green
$aCyan = $PSStyle.Foreground.Cyan
$aMagenta = $PSStyle.Foreground.Magenta
$aBMagenta = $PSStyle.Foreground.BrightMagenta
$aBrightBlack = $PSStyle.Foreground.BrightBlack

# Ansi fonts
$boldOn = $PSStyle.Bold
$boldOff = $PSStyle.BoldOff

$italicOn = $PSStyle.Italic
$italicOff = $PSStyle.ItalicOff

$blinkOn = $PSStyle.Blink
$blinkOff = $PSStyle.BlinkOff

$ul = $PSStyle.Underline
$ulOff = $PSStyle.UnderlineOff

$reset = $PSStyle.Reset


# Track titles for muxing files with mkvmerge
$Script:trackTitle = @{
AudioTitle1 = $null
Expand All @@ -21,11 +62,84 @@ $Script:trackTitle = @{

# Arguments for dee encoders and audio
$Script:dee = @{
DeeArgs = @('dee_ddp', 'dee_eac3', 'dee_dd', 'dee_ac3', 'dee_thd')
DeeArgs = @('dee_ddp', 'dee_eac3', 'dee_dd', 'dee_ac3', 'dee_thd', 'dee_ddp_51', 'dee_eac3_51')
DeeUsed = $false
}

## End module variables ##
# Detect operating system info
if ($isMacOs) {
$osInfo = @{
OperatingSystem = "Mac"
DefaultPath = "$HOME/Movies"
}
}
elseif ($isLinux) {
$osInfo = @{
OperatingSystem = "Linux"
DefaultPath = "$HOME/Videos"
}
}
elseif ($env:OS -like "*Windows*") {
$osInfo = @{
OperatingSystem = "Windows"
DefaultPath = [Environment]::GetFolderPath('MyVideos')
}
}
else {
Write-Error "Failed to load module. Could not detect operating system." -ErrorAction Stop
}

## Define Banners ##

# $banner_old = @'
# _____ _ _ _ _ _____ _____ _____ _
# | ___(_)_ __(_)_ __ __ _ | | | |_ __ | ___| ___| ____|_ __ ___ ___ __| | ___ _ __
# | |_ | | '__| | '_ \ / _` | | | | | '_ \ | |_ | |_ | _| | '_ \ / __/ _ \ / _` |/ _ \ '__|
# | _| | | | | | | | | (_| | | |_| | |_) | | _| | _| | |___| | | | (_| (_) | (_| | __/ |
# |_| |_|_| |_|_| |_|\__, | \___/| .__/ |_| |_| |_____|_| |_|\___\___/ \__,_|\___|_|
# |___/ |_|
# '@

$banner1 = @'
_____ _ _ _ _
| ___(_)_ __(_)_ __ __ _ | | | |_ __
| |_ | | '__| | '_ \ / _` | | | | | '_ \
| _| | | | | | | | | (_| | | |_| | |_) |
|_| |_|_| |_|_| |_|\__, | \___/| .__/
|___/ |_|
'@

$banner2 = @'
███████ ███████ ███████ ███ ██ ██████ ██████ ██████ ███████ ██████
██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██
█████ █████ █████ ██ ██ ██ ██ ██ ██ ██ ██ █████ ██████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ███████ ██ ████ ██████ ██████ ██████ ███████ ██ ██
'@

$exitBanner = @'
___________ .__ __ .__ ______________________ .___
\_ _____/__ __|__|/ |_|__| ____ ____ \_ _____/\_ _____/___ ____ ____ ____ __| _/___________
| __)_\ \/ / \ __\ |/ \ / ___\ | __) | __)/ __ \ / \_/ ___\/ _ \ / __ |/ __ \_ __ \
| \> <| || | | | | \/ /_/ > | \ | \\ ___/| | \ \__( <_> ) /_/ \ ___/| | \/
/_______ /__/\_ \__||__| |__|___| /\___ / \___ / \___ / \___ >___| /\___ >____/\____ |\___ >__|
\/ \/ \//_____/ \/ \/ \/ \/ \/ \/ \/
See ya next time
'@

# Current script release version
[version]$release = '2.0.0'


#### End module variables ####

<#
LOAD MODULE FUNCTIONS
#>

## region Load Public Functions ##
try {
Expand Down Expand Up @@ -66,11 +180,12 @@ New-Alias -Name iffmpeg -Value Invoke-FFMpeg -Force
New-Alias -Name cropfile -Value New-CropFile -Force
New-Alias -Name cropdim -Value Measure-CropDimensions -Force


# Export module functions, aliases, and variables
$ExportModule = @{
Alias = @('iffmpeg', 'cropfile', 'cropdim')
Function = @('Invoke-FFmpeg', 'Invoke-TwoPassFFmpeg', 'New-CropFile', 'Measure-CropDimensions', 'Remove-FilePrompt', 'Write-Report', 'Confirm-HDR10Plus',
'Confirm-DolbyVision', 'Confirm-ScaleFilter', 'Invoke-MkvMerge')
Variable = @('progressColors', 'warnColors', 'emphasisColors' )
'Confirm-DolbyVision', 'Confirm-ScaleFilter', 'Invoke-MkvMerge', 'Invoke-DeeEncoder', 'Read-TimedInput', 'Invoke-VMAF')
Variable = @('progressColors', 'warnColors', 'emphasisColors', 'errColors', 'osInfo', 'banner1', 'banner2', 'exitBanner', 'ScriptsDirectory',
'release' )
}
Export-ModuleMember @ExportModule
Loading

0 comments on commit 46dcf85

Please sign in to comment.