Skip to content

Commit b909a38

Browse files
Merge pull request #11 from patrickenfuego/binary-updates-pwsh-73
Binary & PowerShell 7.3 Updates
2 parents 9b00429 + ff578ce commit b909a38

20 files changed

+227
-118
lines changed

FFEncoder.ps1

+60-2
Large diffs are not rendered by default.

README.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ FFEncoder is a cross-platform PowerShell script and module that is meant to make
2626
- [Configuration Files](#configuration-files)
2727
- [Mandatory](#mandatory)
2828
- [Utility](#utility)
29-
- [Audio & Subtitles](#audio--subtitles)
29+
- [Audio \& Subtitles](#audio--subtitles)
3030
- [Video Filtering](#video-filtering)
3131
- [Encoder Config](#encoder-config)
3232
- [Universal Encoder Settings](#universal-encoder-settings)
3333
- [x265 Only Settings](#x265-only-settings)
3434
- [Extra](#extra)
35+
- [Acknowledgements](#acknowledgements)
3536

3637
---
3738

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

4647
## Dependencies
4748

48-
> For Windows users, PowerShell 7 is a supplemental installation and will will be installed alongside PowerShell 5.1
49+
> For Windows users, PowerShell 7.x is a supplemental installation and will will be installed alongside PowerShell 5.1
50+
51+
> **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
4952
5053
- ffmpeg / ffprobe
5154
- PowerShell v. 7.0 or newer
5255
- Mkvtoolnix (optional, but highly recommended)
5356
- VapourSynth (optional)
57+
- Dolby Encoding Engine (DEE) (optional)
5458

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

@@ -178,6 +182,7 @@ FFEncoder can accept the following parameters from the command line:
178182
| **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 |
179183
| **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 |
180184
| **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 |
185+
| **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 |
181186
| **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 |
182187
| **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 |
183188
| **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 |
@@ -277,3 +282,13 @@ FFEncoder can accept the following parameters from the command line:
277282
| ---------------- | ------- | --------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
278283
| **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 |
279284
| **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 |
285+
286+
---
287+
288+
## Acknowledgements
289+
290+
This section contains acknowledgements for the authors of tools distributed with this project. All credit goes to them!
291+
292+
- [dovi_tool](https://github.com/quietvoid/dovi_tool) - Developed by **quietvoid**
293+
- [hdr10plus_tool](https://github.com/quietvoid/hdr10plus_tool) - Developed by **quietvoid**
294+
- [deew](https://github.com/pcroland/deew) - While this project contains a modified, custom compiled version of `deew`, the original project was developed by **pcroland**

bin/linux/dee_wrapper/config.toml

+35-24
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,40 @@
1+
# These are required.
2+
# If only name is specified, it will look in your system PATH variable, which includes the current directory on Windows.
3+
# Setup instructions: https://github.com/pcroland/deew#setup-system-path-variable
4+
# If full path is specified, that will be used.
15
ffmpeg_path = 'ffmpeg'
26
ffprobe_path = 'ffprobe'
37
dee_path = 'dee'
4-
temp_path = ''
5-
# empty: next to the script
6-
# relative path: from your current directory
7-
# you can also use fullpath
8-
# in any case will be created automatically if it doesn't exist already
9-
wsl = false # set this to true if you run the script in Linux but use the Windows version of DEE
10-
logo = 0 # set between 1 and 10, use the -pl/--printlogos option to see the available logos, set to 0 to disable logo
11-
show_summary = true
12-
threads = 6 # You can overwrite this with -t/--threads. The threads number will be clamped between 1 and cpu_count() - 2.
13-
14-
15-
16-
17-
18-
19-
20-
21-
22-
23-
24-
25-
26-
27-
288

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

13+
# Set between 1 and 10, use the -pl/--print-logos option to see the available logos, set to 0 to disable logo.
14+
logo = 0
15+
16+
# Specifies how many encodes can run at the same time.
17+
# It can be a number or a % compared to your number of threads (so '50%' means 4 on an 8 thread cpu).
18+
# One DEE can use 2 threads so setting '50%' can utilize all threads.
19+
# You can override this setting with -in/--instances.
20+
# The number will be clamped between 1 and cpu_count().
21+
# With the Windows version of DEE the max will be cpu_count() - 2 or 6 due to a limitation.
22+
# examples: 1, 4, '50%'
23+
max_instances = '50%'
24+
25+
[default_bitrates]
26+
dd_1_0 = 128
27+
dd_2_0 = 256
28+
dd_5_1 = 640
29+
ddp_1_0 = 128
30+
ddp_2_0 = 256
31+
ddp_5_1 = 1024
32+
ddp_7_1 = 1536
33+
34+
# You can toggle what sections you would like to see in the encoding summary
35+
[summary_sections]
36+
deew_info = false
37+
binaries = false
38+
input_info = false
39+
output_info = false
40+
other = false

bin/linux/dee_wrapper/deew

149 KB
Binary file not shown.

bin/linux/dovi_tool

256 KB
Binary file not shown.

bin/linux/hdr10plus_tool

232 KB
Binary file not shown.

bin/mac/dee_wrapper/config.toml

+35-24
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,40 @@
1+
# These are required.
2+
# If only name is specified, it will look in your system PATH variable, which includes the current directory on Windows.
3+
# Setup instructions: https://github.com/pcroland/deew#setup-system-path-variable
4+
# If full path is specified, that will be used.
15
ffmpeg_path = 'ffmpeg'
26
ffprobe_path = 'ffprobe'
37
dee_path = 'dee'
4-
temp_path = ''
5-
# empty: next to the script
6-
# relative path: from your current directory
7-
# you can also use fullpath
8-
# in any case will be created automatically if it doesn't exist already
9-
wsl = false # set this to true if you run the script in Linux but use the Windows version of DEE
10-
logo = 0 # set between 1 and 10, use the -pl/--printlogos option to see the available logos, set to 0 to disable logo
11-
show_summary = true
12-
threads = 6 # You can overwrite this with -t/--threads. The threads number will be clamped between 1 and cpu_count() - 2.
13-
14-
15-
16-
17-
18-
19-
20-
21-
22-
23-
24-
25-
26-
27-
288

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

13+
# Set between 1 and 10, use the -pl/--print-logos option to see the available logos, set to 0 to disable logo.
14+
logo = 0
15+
16+
# Specifies how many encodes can run at the same time.
17+
# It can be a number or a % compared to your number of threads (so '50%' means 4 on an 8 thread cpu).
18+
# One DEE can use 2 threads so setting '50%' can utilize all threads.
19+
# You can override this setting with -in/--instances.
20+
# The number will be clamped between 1 and cpu_count().
21+
# With the Windows version of DEE the max will be cpu_count() - 2 or 6 due to a limitation.
22+
# examples: 1, 4, '50%'
23+
max_instances = '50%'
24+
25+
[default_bitrates]
26+
dd_1_0 = 128
27+
dd_2_0 = 256
28+
dd_5_1 = 640
29+
ddp_1_0 = 128
30+
ddp_2_0 = 256
31+
ddp_5_1 = 1024
32+
ddp_7_1 = 1536
33+
34+
# You can toggle what sections you would like to see in the encoding summary
35+
[summary_sections]
36+
deew_info = false
37+
binaries = false
38+
input_info = false
39+
output_info = false
40+
other = false

bin/mac/dee_wrapper/deew

-2.51 MB
Binary file not shown.

bin/mac/dovi_tool

243 KB
Binary file not shown.

bin/mac/hdr10plus_tool

214 KB
Binary file not shown.

bin/windows/dee_wrapper/config.toml

+35-54
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,40 @@
1+
# These are required.
2+
# If only name is specified, it will look in your system PATH variable, which includes the current directory on Windows.
3+
# Setup instructions: https://github.com/pcroland/deew#setup-system-path-variable
4+
# If full path is specified, that will be used.
15
ffmpeg_path = 'ffmpeg'
26
ffprobe_path = 'ffprobe'
37
dee_path = 'dee'
4-
temp_path = ''
5-
# empty: next to the script
6-
# relative path: from your current directory
7-
# you can also use fullpath
8-
# in any case will be created automatically if it doesn't exist already
9-
wsl = false # set this to true if you run the script in Linux but use the Windows version of DEE
10-
logo = 0 # set between 1 and 10, use the -pl/--printlogos option to see the available logos, set to 0 to disable logo
11-
show_summary = true
12-
threads = 6 # You can overwrite this with -t/--threads. The threads number will be clamped between 1 and cpu_count() - 2.
13-
14-
15-
16-
17-
18-
19-
20-
21-
22-
23-
24-
25-
26-
27-
28-
29-
30-
31-
32-
33-
34-
35-
36-
37-
38-
39-
40-
41-
42-
43-
44-
45-
46-
47-
48-
49-
50-
51-
52-
53-
54-
55-
56-
57-
588

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

13+
# Set between 1 and 10, use the -pl/--print-logos option to see the available logos, set to 0 to disable logo.
14+
logo = 0
15+
16+
# Specifies how many encodes can run at the same time.
17+
# It can be a number or a % compared to your number of threads (so '50%' means 4 on an 8 thread cpu).
18+
# One DEE can use 2 threads so setting '50%' can utilize all threads.
19+
# You can override this setting with -in/--instances.
20+
# The number will be clamped between 1 and cpu_count().
21+
# With the Windows version of DEE the max will be cpu_count() - 2 or 6 due to a limitation.
22+
# examples: 1, 4, '50%'
23+
max_instances = '50%'
24+
25+
[default_bitrates]
26+
dd_1_0 = 128
27+
dd_2_0 = 256
28+
dd_5_1 = 640
29+
ddp_1_0 = 128
30+
ddp_2_0 = 256
31+
ddp_5_1 = 1024
32+
ddp_7_1 = 1536
33+
34+
# You can toggle what sections you would like to see in the encoding summary
35+
[summary_sections]
36+
deew_info = false
37+
binaries = false
38+
input_info = false
39+
output_info = false
40+
other = false

bin/windows/dee_wrapper/deew.exe

-3.93 MB
Binary file not shown.

bin/windows/dovi_tool.exe

394 KB
Binary file not shown.

bin/windows/hdr10plus_tool.exe

194 KB
Binary file not shown.

modules/FFTools/FFTools.psm1

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ ___________ .__ __ .__ ______________________
137137
'@
138138

139139
# Current script release version
140-
[version]$release = '2.2.1'
140+
[version]$release = '2.3.0'
141141

142142

143143
#### End module variables ####

modules/FFTools/Private/Set-AudioPreference.ps1

+5-4
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function Set-AudioPreference {
9595
elseif ($Userchoice -like '*thd*') { "TrueHD $channelStr" }
9696
else { '' }
9797

98-
if ($Stereo -and $RemuxStream) {
98+
if ($Stereo -and $UserChoice -notin $dee['DeeArgs']) {
9999
$trackTitle['StereoTitle'] = $trackName
100100
}
101101
elseif ($RemuxStream) {
@@ -278,7 +278,8 @@ function Set-AudioPreference {
278278
# If not stream copying, append track label
279279
if ($audioArgs -and ($audioArgs[-1] -ne 'copy') -and ($audioArgs -notin $dee['DeeArgs']) -and !$RemuxStream) {
280280
if ($dee['DeeUsed']) { $ident = 2 }
281-
$title = $Stereo ? ("title=`"$($TrackTitle['StereoTitle'])`"") : ("title=`"$($TrackTitle["AudioTitle$($ident)"])`"")
281+
$title = $Stereo ? "title=$($TrackTitle['StereoTitle'])" :
282+
"title=$($TrackTitle["AudioTitle$($ident)"])"
282283
$audioArgs = $audioArgs + @("-metadata:s:a:$Stream", $title)
283284
}
284285

@@ -395,7 +396,7 @@ function Set-AudioPreference {
395396
return $null
396397
}
397398

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

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

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

440441
} | Out-Null

modules/FFTools/Private/Set-FFMpegArgs.ps1

+5-2
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ function Set-FFMpegArgs {
169169
'-f'
170170
'vapoursynth'
171171
'-i'
172-
"`"$($Paths.VPY)`""
172+
"$($Paths.VPY)"
173173
}
174174
else {
175175
'-i'
176-
"`"$($Paths.InputFile)`""
176+
"$($Paths.InputFile)"
177177
}
178178
if ($TrackTitle['VideoTitle']) {
179179
'-metadata:s:v:0'
@@ -262,6 +262,9 @@ function Set-FFMpegArgs {
262262
elseif ($PSBoundParameters['PsyRd'] -match '\d\.?\d{0,2}.*') {
263263
"psy-rd=$($PsyRd -replace '\s', ''),$($PresetParams.PsyRdoq)"
264264
}
265+
elseif (!$PSBoundParameters['PsyRd'] -and $PresetParams.PsyRdoq) {
266+
"psy-rd=1.00,$($PresetParams.PsyRdoq)"
267+
}
265268
else {
266269
'psy-rd=1.00,0.00'
267270
}

modules/FFTools/Private/Set-VideoFilter.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ function Set-VideoFilter {
240240
# If string is not empty, generate array
241241
if ($tmpArray) {
242242
$vfString = $tmpArray -join ','
243-
$vfArray = @('-vf', "`"$vfString`"")
243+
$vfArray = @('-vf', "$vfString")
244244
}
245245
else { $vfArray = $null }
246246

0 commit comments

Comments
 (0)