Skip to content

Commit 0b7d373

Browse files
Merge pull request #8 from patrickenfuego/vpy-test
Merge vpy-test into main
2 parents aac3478 + a56ccb8 commit 0b7d373

14 files changed

+862
-583
lines changed

FFEncoder.ps1

+393-285
Large diffs are not rendered by default.

README.md

+30-24
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# FFEncoder
1010

11-
FFEncoder is a cross-platform PowerShell script and module that is meant to make high definition video encoding workflows easier. FFEncoder uses [ffmpeg](https://ffmpeg.org/), [ffprobe](https://ffmpeg.org/ffprobe.html), the [x264 H.264 encoder](https://x264.org/en/), and the [x265 HEVC encoder](https://x265.readthedocs.io/en/master/index.html) to compress video files for streaming or archiving.
11+
FFEncoder is a cross-platform PowerShell script and module that is meant to make high definition video encoding workflows easier. FFEncoder uses [ffmpeg](https://ffmpeg.org/), [VapourSynth](https://www.vapoursynth.com/doc/), [Mkvtoolnix](https://mkvtoolnix.download/), [ffprobe](https://ffmpeg.org/ffprobe.html), the [x264 H.264 encoder](https://x264.org/en/), and the [x265 HEVC encoder](https://x265.readthedocs.io/en/master/index.html) to compress, filter, and multiplex multimedia files for streaming or archiving.
1212

1313
- [FFEncoder](#ffencoder)
1414
- [About](#about)
@@ -48,7 +48,8 @@ Check out the [wiki](https://github.com/patrickenfuego/FFEncoder/wiki) for addit
4848
4949
- ffmpeg / ffprobe
5050
- PowerShell v. 7.0 or newer
51-
- [Mkvtoolnix](https://mkvtoolnix.download/) (optional, but highly recommended)
51+
- Mkvtoolnix (optional, but highly recommended)
52+
- VapourSynth (optional)
5253

5354
The script requires PowerShell 7.0 or newer on all systems as it utilizes new parallel processing features introduced in this version. Multi-threading prior to PowerShell 7 was prone to memory leaks which persuaded me to make the change.
5455

@@ -167,14 +168,15 @@ FFEncoder can accept the following parameters from the command line:
167168

168169
> An Asterisk <b>\*</b> denotes that the parameter is mandatory only for its given parameter set (for example, you can choose either `-CRF` or `-VideoBitrate` for rate control, but not both):
169170
170-
| Parameter Name | Default | Mandatory | Alias | Description | Mandatory For |
171-
| ---------------- | ------- | ------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------- |
172-
| **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 |
173-
| **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 |
174-
| **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 |
175-
| **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 |
176-
| **ScaleFilter** | None | <b>\*</b>True | **Resize**, **Resample** | Scaling filter to use. Scaling options are `scale` (ffmpeg default) and `zscale` (requires `libzimg`) | Resizing |
177-
| **CompareVMAF** | N/A | <b>\*</b>True | None | Runs a VMAF comparison on two video files | VMAF |
171+
| Parameter Name | Default | Mandatory | Alias | Description | Mandatory For |
172+
| ---------------- | ------- | ------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
173+
| **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 |
174+
| **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 |
175+
| **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 |
176+
| **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 |
177+
| **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 |
178+
| **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 |
179+
| **CompareVMAF** | N/A | <b>\*</b>True | None | Flag to enable a VMAF comparison on two video files | VMAF |
178180

179181
### Utility
180182

@@ -206,23 +208,27 @@ FFEncoder can accept the following parameters from the command line:
206208

207209
### Video Filtering
208210

209-
| Parameter Name | Default | Mandatory | Alias | Description |
210-
| --------------- | ---------------- | --------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
211-
| **Deinterlace** | Disabled | False | **DI** | Switch to enable deinterlacing of interlaced content using yadif |
212-
| **NLMeans** | Disabled | False | **NL** | High quality de-noising filter. Accepts a hashtable containing 5 values. See [here](https://ffmpeg.org/ffmpeg-filters.html#nlmeans-1) for more info |
213-
| **Scale** | bilinear | False | **ScaleType**, **SF** | Scaling/resizing filter to use. See [Rescaling Video](https://github.com/patrickenfuego/FFEncoder/wiki/Video-Options#rescaling-videos) for more info |
214-
| **Resolution** | Source Dependent | False | **Res**, **R** | Scaling resolution. See [Rescaling Video](https://github.com/patrickenfuego/FFEncoder/wiki/Video-Options#rescaling-videos) for more info |
211+
> See the Mandatory section above for parameters needed to enable certain filters
212+
213+
| Parameter Name | Default | Mandatory | Alias | Description |
214+
| ------------------- | ---------------- | --------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
215+
| **Deinterlace** | Disabled | False | **DI** | Switch to enable deinterlacing of interlaced content using yadif |
216+
| **NLMeans** | Disabled | False | **NL** | High quality de-noising filter. Accepts a hashtable containing 5 values. See [here](https://ffmpeg.org/ffmpeg-filters.html#nlmeans-1) for more info |
217+
| **Scale** | bilinear | False | **ScaleType**, **SF** | Scaling/resizing filter to use. See [Rescaling Video](https://github.com/patrickenfuego/FFEncoder/wiki/Video-Options#rescaling-videos) for more info |
218+
| **Resolution** | Source Dependent | False | **Res**, **R** | Scaling resolution. See [Rescaling Video](https://github.com/patrickenfuego/FFEncoder/wiki/Video-Options#rescaling-videos) for more info |
219+
| **UnsharpStrength** | luma_mild | False | **UStrength** | Specify the unsharp filters strength, in the form `<sharpen\|blur>_<mild\|medium\|strong>` |
215220

216221
### Encoder Config
217222

218-
| Parameter Name | Default | Mandatory | Alias | Description |
219-
| ------------------- | ------------ | --------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
220-
| **Encoder** | x265 | False | **Enc** | Specifies which encoder to use - x264 or x265 |
221-
| **FirstPassType** | Default | False | **PassType**, **FTP** | Tuning option for two pass encoding. See [Two Pass Encoding Options](https://github.com/patrickenfuego/FFEncoder/wiki/Video-Options#two-pass-encoding-options) for more info |
222-
| **SkipDolbyVision** | False | False | **NoDV**, **SDV** | Switch to disable Dolby Vision encoding, even if metadata is present |
223-
| **SkipHDR10Plus** | False | False | **No10P**, **NTP** | Switch to disable HDR10+ encoding, even if metadata is present |
224-
| **TestFrames** | 0 (Disabled) | False | **T**, **Test** | Integer value representing the number of test frames to encode. When `-TestStart` is not set, encoding starts at 00:01:30 so that title screens are skipped |
225-
| **TestStart** | Disabled | False | **Start**, **TS** | Starting point for test encodes. Accepts formats `00:01:30` (sexagesimal time), `200f` (frame start), `200t` (decimal time in seconds) |
223+
| Parameter Name | Default | Mandatory | Alias | Description |
224+
| --------------------- | ------------ | --------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
225+
| **Encoder** | x265 | False | **Enc** | Specifies which encoder to use - x264 or x265 |
226+
| **FirstPassType** | Default | False | **PassType**, **FTP** | Tuning option for two pass encoding. See [Two Pass Encoding Options](https://github.com/patrickenfuego/FFEncoder/wiki/Video-Options#two-pass-encoding-options) for more info |
227+
| **SkipDolbyVision** | False | False | **NoDV**, **SDV** | Switch to disable Dolby Vision encoding, even if metadata is present |
228+
| **SkipHDR10Plus** | False | False | **No10P**, **NTP** | Switch to disable HDR10+ encoding, even if metadata is present |
229+
| **TestFrames** | 0 (Disabled) | False | **T**, **Test** | Integer value representing the number of test frames to encode. When `-TestStart` is not set, encoding starts at 00:01:30 so that title screens are skipped |
230+
| **TestStart** | Disabled | False | **Start**, **TS** | Starting point for test encodes. Accepts formats `00:01:30` (sexagesimal time), `200f` (frame start), `200t` (decimal time in seconds) |
231+
| **VapourSynthScript** | Disabled | False | **VSScript**, **VPY** | Path to VapourSynth script. Video filtering parameters are ignored when enabled, and must be done in the vpy script |
226232

227233
### Universal Encoder Settings
228234

bin/windows/dee_wrapper/config.toml

+1
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,6 @@ threads = 6 # You can overwrite this with -t/--threads. The threads number will
5454

5555

5656

57+
5758

5859

modules/FFTools/FFTools.psm1

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ ___________ .__ __ .__ ______________________
133133
'@
134134

135135
# Current script release version
136-
[version]$release = '2.0.3'
136+
[version]$release = '2.1.0'
137137

138138

139139
#### End module variables ####

modules/FFTools/Private/Set-AudioPreference.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ function Set-AudioPreference {
253253
break
254254
}
255255
{ 0..12 -contains $_ } {
256-
Write-Host "AUDIO STREAM $UserChoice SELECTED" @progressColors
257-
Write-Host "Stream $UserChoice from input will be mapped to stream $Stream in the output"
256+
Write-Host "$("`u{25c7}" * 2) AUDIO STREAM $UserChoice SELECTED $("`u{25c7}" * 2)" @progressColors
257+
Write-Host "Stream $UserChoice from input will be mapped to stream $Stream in the output`n"
258258
@('-map', "0:a:$UserChoice`?", "-c:a:$Stream", 'copy')
259259
break
260260
}
@@ -318,7 +318,7 @@ function Set-AudioPreference {
318318
# Start a background job to run Dolby Encoder if selected
319319
if ($UserChoice -like '*dee*') {
320320
Write-Verbose "DEE - Audio bitrate is: $Bitrate"
321-
Write-Host "Spawning dee encoder in a separate process`n" @emphasisColors
321+
Write-Host "Spawning dee encoder in a separate thread`n" @emphasisColors
322322
# Create hash of dee params to marshall across process line
323323
$deeParams = @{
324324
Paths = $Paths

0 commit comments

Comments
 (0)