Skip to content

Commit

Permalink
Merge pull request #11 from patrickenfuego/binary-updates-pwsh-73
Browse files Browse the repository at this point in the history
Binary & PowerShell 7.3 Updates
  • Loading branch information
patrickenfuego authored Nov 26, 2022
2 parents 9b00429 + ff578ce commit b909a38
Show file tree
Hide file tree
Showing 20 changed files with 227 additions and 118 deletions.
62 changes: 60 additions & 2 deletions FFEncoder.ps1

Large diffs are not rendered by default.

19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ FFEncoder is a cross-platform PowerShell script and module that is meant to make
- [Configuration Files](#configuration-files)
- [Mandatory](#mandatory)
- [Utility](#utility)
- [Audio & Subtitles](#audio--subtitles)
- [Audio \& Subtitles](#audio--subtitles)
- [Video Filtering](#video-filtering)
- [Encoder Config](#encoder-config)
- [Universal Encoder Settings](#universal-encoder-settings)
- [x265 Only Settings](#x265-only-settings)
- [Extra](#extra)
- [Acknowledgements](#acknowledgements)

---

Expand All @@ -45,12 +46,15 @@ Check out the [wiki](https://github.com/patrickenfuego/FFEncoder/wiki) for addit

## Dependencies

> For Windows users, PowerShell 7 is a supplemental installation and will will be installed alongside PowerShell 5.1
> For Windows users, PowerShell 7.x is a supplemental installation and will will be installed alongside PowerShell 5.1
> **NOTE**: PowerShell 7.3 completely changed the way string arguments are parsed with third party executables. I have updated the code to support this, and it should be backward compatible to version 7.0.0. If issues are found, please let me know
- ffmpeg / ffprobe
- PowerShell v. 7.0 or newer
- Mkvtoolnix (optional, but highly recommended)
- VapourSynth (optional)
- Dolby Encoding Engine (DEE) (optional)

For users with PowerShell 7.2 or newer, the script uses ANSI output in certain scenarios to enhance the console experience.

Expand Down Expand Up @@ -178,6 +182,7 @@ FFEncoder can accept the following parameters from the command line:
| **InputPath** | N/A | True | **I**, **Source**, **Reference** | The path to the source file, i.e. remux. Also acts as the reference path for VMAF comparisons | All |
| **OutputPath** | N/A | True | **O**, **Encode**, **Distorted** | The path of the the encoded output file, or the encoded (distorted) file path during VMAF comparisons | All |
| **CRF** | N/A | <b>\*</b>True | **C** | Rate control parameter that targets a specific quality level. Ranges from 0.0 to 51.0. Lower values result in higher quality | Rate Control |
| **ConstantQP** | N/A | <b>\*</b>True | **QP** | Constant quantizer rate control mode. Forces a consistent QP throughout the encode. Generally not recommended outside of testing. | Rate Control |
| **VideoBitrate** | N/A | <b>\*</b>True | **VBitrate** | Rate control parameter that targets a specific bitrate. Can be used as an alternative to CRF when file size is a priority | Rate Control |
| **Scale** | None | <b>\*</b>True | **ScaleType**, **SF** | Scaling/resizing filter to use. See [Rescaling Video](https://github.com/patrickenfuego/FFEncoder/wiki/Video-Options#rescaling-videos) for more info | Scaling |
| **Unsharp** | None | <b>\*</b>True | **U** | Enable unsharp filter and set search range, in the form `<luma\|chroma\|yuv>_<small\|medium\|large>` or `custom=<filter>` | Sharpen/Blur |
Expand Down Expand Up @@ -277,3 +282,13 @@ FFEncoder can accept the following parameters from the command line:
| ---------------- | ------- | --------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **FFMpegExtra** | N/A | False | **FE** | Pass additional settings to ffmpeg as a generic array of single and multi-valued elements. Useful for options not covered by other parameters |
| **EncoderExtra** | N/A | False | **XE** | Pass additional settings to the specified encoder as a hashtable of values. Useful for options not covered by other parameters |

---

## Acknowledgements

This section contains acknowledgements for the authors of tools distributed with this project. All credit goes to them!

- [dovi_tool](https://github.com/quietvoid/dovi_tool) - Developed by **quietvoid**
- [hdr10plus_tool](https://github.com/quietvoid/hdr10plus_tool) - Developed by **quietvoid**
- [deew](https://github.com/pcroland/deew) - While this project contains a modified, custom compiled version of `deew`, the original project was developed by **pcroland**
59 changes: 35 additions & 24 deletions bin/linux/dee_wrapper/config.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,40 @@
# These are required.
# If only name is specified, it will look in your system PATH variable, which includes the current directory on Windows.
# Setup instructions: https://github.com/pcroland/deew#setup-system-path-variable
# If full path is specified, that will be used.
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.
















# If this is empty, the default OS temporary directory will be used (or `temp` next to the script if you use the exe).
# You can also specify an absolute path or a path relative to the current directory.
temp_path = ''

# Set between 1 and 10, use the -pl/--print-logos option to see the available logos, set to 0 to disable logo.
logo = 0

# Specifies how many encodes can run at the same time.
# It can be a number or a % compared to your number of threads (so '50%' means 4 on an 8 thread cpu).
# One DEE can use 2 threads so setting '50%' can utilize all threads.
# You can override this setting with -in/--instances.
# The number will be clamped between 1 and cpu_count().
# With the Windows version of DEE the max will be cpu_count() - 2 or 6 due to a limitation.
# examples: 1, 4, '50%'
max_instances = '50%'

[default_bitrates]
dd_1_0 = 128
dd_2_0 = 256
dd_5_1 = 640
ddp_1_0 = 128
ddp_2_0 = 256
ddp_5_1 = 1024
ddp_7_1 = 1536

# You can toggle what sections you would like to see in the encoding summary
[summary_sections]
deew_info = false
binaries = false
input_info = false
output_info = false
other = false
Binary file modified bin/linux/dee_wrapper/deew
Binary file not shown.
Binary file modified bin/linux/dovi_tool
Binary file not shown.
Binary file modified bin/linux/hdr10plus_tool
Binary file not shown.
59 changes: 35 additions & 24 deletions bin/mac/dee_wrapper/config.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,40 @@
# These are required.
# If only name is specified, it will look in your system PATH variable, which includes the current directory on Windows.
# Setup instructions: https://github.com/pcroland/deew#setup-system-path-variable
# If full path is specified, that will be used.
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.
















# If this is empty, the default OS temporary directory will be used (or `temp` next to the script if you use the exe).
# You can also specify an absolute path or a path relative to the current directory.
temp_path = ''

# Set between 1 and 10, use the -pl/--print-logos option to see the available logos, set to 0 to disable logo.
logo = 0

# Specifies how many encodes can run at the same time.
# It can be a number or a % compared to your number of threads (so '50%' means 4 on an 8 thread cpu).
# One DEE can use 2 threads so setting '50%' can utilize all threads.
# You can override this setting with -in/--instances.
# The number will be clamped between 1 and cpu_count().
# With the Windows version of DEE the max will be cpu_count() - 2 or 6 due to a limitation.
# examples: 1, 4, '50%'
max_instances = '50%'

[default_bitrates]
dd_1_0 = 128
dd_2_0 = 256
dd_5_1 = 640
ddp_1_0 = 128
ddp_2_0 = 256
ddp_5_1 = 1024
ddp_7_1 = 1536

# You can toggle what sections you would like to see in the encoding summary
[summary_sections]
deew_info = false
binaries = false
input_info = false
output_info = false
other = false
Binary file modified bin/mac/dee_wrapper/deew
Binary file not shown.
Binary file modified bin/mac/dovi_tool
Binary file not shown.
Binary file modified bin/mac/hdr10plus_tool
Binary file not shown.
89 changes: 35 additions & 54 deletions bin/windows/dee_wrapper/config.toml
Original file line number Diff line number Diff line change
@@ -1,59 +1,40 @@
# These are required.
# If only name is specified, it will look in your system PATH variable, which includes the current directory on Windows.
# Setup instructions: https://github.com/pcroland/deew#setup-system-path-variable
# If full path is specified, that will be used.
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.














































# If this is empty, the default OS temporary directory will be used (or `temp` next to the script if you use the exe).
# You can also specify an absolute path or a path relative to the current directory.
temp_path = ''

# Set between 1 and 10, use the -pl/--print-logos option to see the available logos, set to 0 to disable logo.
logo = 0

# Specifies how many encodes can run at the same time.
# It can be a number or a % compared to your number of threads (so '50%' means 4 on an 8 thread cpu).
# One DEE can use 2 threads so setting '50%' can utilize all threads.
# You can override this setting with -in/--instances.
# The number will be clamped between 1 and cpu_count().
# With the Windows version of DEE the max will be cpu_count() - 2 or 6 due to a limitation.
# examples: 1, 4, '50%'
max_instances = '50%'

[default_bitrates]
dd_1_0 = 128
dd_2_0 = 256
dd_5_1 = 640
ddp_1_0 = 128
ddp_2_0 = 256
ddp_5_1 = 1024
ddp_7_1 = 1536

# You can toggle what sections you would like to see in the encoding summary
[summary_sections]
deew_info = false
binaries = false
input_info = false
output_info = false
other = false
Binary file modified bin/windows/dee_wrapper/deew.exe
Binary file not shown.
Binary file modified bin/windows/dovi_tool.exe
Binary file not shown.
Binary file modified bin/windows/hdr10plus_tool.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion modules/FFTools/FFTools.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ ___________ .__ __ .__ ______________________
'@

# Current script release version
[version]$release = '2.2.1'
[version]$release = '2.3.0'


#### End module variables ####
Expand Down
9 changes: 5 additions & 4 deletions modules/FFTools/Private/Set-AudioPreference.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function Set-AudioPreference {
elseif ($Userchoice -like '*thd*') { "TrueHD $channelStr" }
else { '' }

if ($Stereo -and $RemuxStream) {
if ($Stereo -and $UserChoice -notin $dee['DeeArgs']) {
$trackTitle['StereoTitle'] = $trackName
}
elseif ($RemuxStream) {
Expand Down Expand Up @@ -278,7 +278,8 @@ function Set-AudioPreference {
# If not stream copying, append track label
if ($audioArgs -and ($audioArgs[-1] -ne 'copy') -and ($audioArgs -notin $dee['DeeArgs']) -and !$RemuxStream) {
if ($dee['DeeUsed']) { $ident = 2 }
$title = $Stereo ? ("title=`"$($TrackTitle['StereoTitle'])`"") : ("title=`"$($TrackTitle["AudioTitle$($ident)"])`"")
$title = $Stereo ? "title=$($TrackTitle['StereoTitle'])" :
"title=$($TrackTitle["AudioTitle$($ident)"])"
$audioArgs = $audioArgs + @("-metadata:s:a:$Stream", $title)
}

Expand Down Expand Up @@ -395,7 +396,7 @@ function Set-AudioPreference {
return $null
}

Write-Host "Stream copy detected: Spawning audio encoder in a separate thread...`n" @progressColors
Write-Host "Stream copy detected: Spawning audio encoder in a separate thread...`n" @emphasisColors

# Modify and combine arrays for background job
#$stereoArgs[0] = '-af'
Expand Down Expand Up @@ -434,7 +435,7 @@ function Set-AudioPreference {
}

# Encode the audio track
ffmpeg -hide_banner -i $tPaths.AudioPath -metadata:s:a:0 "title=`"$Using:title`"" $Using:audioArgs -y `
ffmpeg -hide_banner -i $tPaths.AudioPath -metadata:s:a:0 "title=$Using:title" $Using:audioArgs -y `
$tPaths.StereoPath 2>$audioDebugLog

} | Out-Null
Expand Down
7 changes: 5 additions & 2 deletions modules/FFTools/Private/Set-FFMpegArgs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ function Set-FFMpegArgs {
'-f'
'vapoursynth'
'-i'
"`"$($Paths.VPY)`""
"$($Paths.VPY)"
}
else {
'-i'
"`"$($Paths.InputFile)`""
"$($Paths.InputFile)"
}
if ($TrackTitle['VideoTitle']) {
'-metadata:s:v:0'
Expand Down Expand Up @@ -262,6 +262,9 @@ function Set-FFMpegArgs {
elseif ($PSBoundParameters['PsyRd'] -match '\d\.?\d{0,2}.*') {
"psy-rd=$($PsyRd -replace '\s', ''),$($PresetParams.PsyRdoq)"
}
elseif (!$PSBoundParameters['PsyRd'] -and $PresetParams.PsyRdoq) {
"psy-rd=1.00,$($PresetParams.PsyRdoq)"
}
else {
'psy-rd=1.00,0.00'
}
Expand Down
2 changes: 1 addition & 1 deletion modules/FFTools/Private/Set-VideoFilter.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ function Set-VideoFilter {
# If string is not empty, generate array
if ($tmpArray) {
$vfString = $tmpArray -join ','
$vfArray = @('-vf', "`"$vfString`"")
$vfArray = @('-vf', "$vfString")
}
else { $vfArray = $null }

Expand Down
Loading

0 comments on commit b909a38

Please sign in to comment.