Skip to content

[pull] master from HaveAGitGat:master#34

Open
pull[bot] wants to merge 232 commits into
tehniemer:masterfrom
HaveAGitGat:master
Open

[pull] master from HaveAGitGat:master#34
pull[bot] wants to merge 232 commits into
tehniemer:masterfrom
HaveAGitGat:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Oct 20, 2024

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull Bot added the ⤵️ pull label Oct 20, 2024
Boosh1 and others added 22 commits October 20, 2024 18:02
Fairly major revision. Been using this locally for months on HEVC & AV1 encodes and not had any issues currently.
I can't verify if my 4k HDR & DoVi setups are 'actually' working for real but they seem to look correct & I've not had errors for encodes or on Plex.

With AV1 support, admittedly this may be confusing since the plugin ID still specifies HEVC but I have updated the name. I didn't want to split this into a new plugin since the logic is pretty much exactly the same & I don't want to maintain two almost identical plugins)

- Adding AV1 encode support, added as drop down selector (default is still hevc)
- Logic should pick valid video profile for either encoder setting
- HDR detection & encode improvement (Appears to work on my HDR content & DoVi)
- Added target bitrate modifier so it's possible to tune the bitrate (useful for AV1 to crunch it down further)
- Better bitrate detection, should error if it can't be found at all
- Mac support is over. Doubt anyone was really using it on Mac but it's not worth touching further. Plugin should still use videotoolbox when on Mac but I won't be fixing up errors.
- Cleaned up descriptions & info logs where reasonable to try and clarify what's happening
- Tests updated & added new test for a fully loaded AV1 setup
Done more testing & confirmed, dolby vision files are normally not converted properly so we'll filter these out now.
The output usually doesn't have evident issues, it's only when tested on a Dolby vision TV that issues present & it's highly dependant on the source material.
i.e I think if the file has the correct HDR10 fallback info then it will play fine on a Dolby vision TV (just can't play Dovi proper), but a lot of files I've had don't have this info & after conversion the Dovi TV will display a pink blown out version.
It'll be better to just prevent Dovi conversions & I guess there's the question of why compress a Dovi file? I don't think it fits the work flow of a bitrate based re-encode.
Realised haven't accounted for HDR10+ which would also likely be affected by ffmpeg so we skip those too.
Also some tidy up on comments
Removed a map cmd that shouldn't be needed
Add example info to Custom JS Function
HaveAGitGat and others added 30 commits April 24, 2026 08:28
…) (#963)

* fix: await subtitle extraction in 078d to avoid replace-file race (#869)

* fix: throw on 078d extraction failure to keep embedded subs

* chore: bump 078d plugin version to 1.01

* refactor: preserve original exec error properties when rethrowing

* fix: cap 078d error message size and reduce exec maxBuffer
…rror -> use vpp_qsv (#791)

* handle qsv specific scalling arguments

* handle qsv specific scalling arguments

* cleanup

* fix lint

---------

Co-authored-by: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com>
* fix: remove legacy cuvid and allow auto detection

* fix: gate cuda hwaccel on NVDEC-supported codecs to avoid AV1 regression

Forcing -hwaccel cuda -hwaccel_output_format cuda unconditionally caused
AV1 inputs to fail on pre-Ampere NVIDIA GPUs (no AV1 NVDEC), producing
empty output instead of falling back to software decode.

Adds methods/nvdecPreset.js with a getNvdecHwaccelPreset(file) helper
that walks ffProbeData.streams to find the first non-attached-pic video
stream and only returns the cuda hwaccel preset for codecs supported by
NVDEC across common GPU generations (h263, h264, hevc, mjpeg, mpeg1video,
mpeg2video, mpeg4, vc1, vp8, vp9). AV1 and unknown codecs return '',
preserving the pre-PR software-decode fallback for those inputs.

Wires the helper into the 9 affected community plugins.
…#965)

* fix: drop -hwaccel_output_format cuda to fix 10-bit NVENC transcodes

Migz1FFMPEG with enable_10bit=true (and any other plugin combining the
cuvid-replacement preset with -pix_fmt p010le) failed at the start of
encode with "Function not implemented (-38)" / "Could not open encoder
before EOF" on 8-bit yuv420p inputs.

Cause: -hwaccel_output_format cuda keeps decoded frames as CUDA hwframes
in the GPU's native format. Encoder-side -pix_fmt p010le then tries to
apply a CPU pixel format to a hwframe, which ffmpeg can't reconcile
without an explicit hwdownload or scale_cuda filter.

Fix: emit only -hwaccel cuda. NVDEC still accelerates decode but frames
land in system memory, so any encoder pix_fmt works without filter
gymnastics. Verified on GTX 1050 + ffmpeg 7.1.2: the user's failing
8-bit -> 10-bit Migz scenario now produces a valid 281KB output at
~2.8x realtime, and 8-bit transcodes still hit ~13x with no frame drops.

Test fixtures updated to match the new preset string.

* Revert "fix: drop -hwaccel_output_format cuda to fix 10-bit NVENC transcodes"

This reverts commit 49892ac.

* fix: use scale_cuda filter for 10-bit output when CUDA hwaccel is active

Migz1FFMPEG with enable_10bit=true (and the always-10-bit d5d3 plugin)
fails at the start of encode with "Function not implemented (-38)" /
"Could not open encoder before EOF" on real 8-bit yuv420p inputs. The
encoder-side -pix_fmt p010le cannot be applied to CUDA hwframes that
arrive from the -hwaccel_output_format cuda decode path.

Add getNvenc10BitFormatArg(file) to methods/nvdecPreset.js. It returns
-vf scale_cuda=format=p010le when the decode path is CUDA-accelerated
(frames are GPU-resident, scale_cuda does the format conversion on the
GPU before the encoder), or -pix_fmt p010le when the decode path is
software (frames are CPU-resident, encoder pix_fmt works as expected).

Wire the helper into the three NVENC plugins that emit -pix_fmt p010le:
- MC93_Migz1FFMPEG (gated by enable_10bit input)
- 00td_action_transcode (gated by enable_10bit input)
- d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV (always 10-bit)

Verified on Pascal NVIDIA + ffmpeg 7.1.2-Jellyfin: the failing 8-bit
to 10-bit Migz scenario now produces valid output at ~10x realtime,
which matches the speed claim from #921. 8-bit transcodes preserve the
full-GPU pipeline (no behaviour change for the 8-bit path).

e5c3_CnT_Remove_Letterbox is also affected by a similar 10-bit issue but
combines pix_fmt with a software crop filter chain; deferring its fix to
keep this PR focused on the user-reported regression.
* fix: e5c3 CnT_Remove_Letterbox 10-bit transcode failure

e5c3's NVENC path produces a 0-byte output with "Function not
implemented" / "Could not open encoder before EOF". The plugin combines
the helper's `-hwaccel cuda -hwaccel_output_format cuda` with software
filters (crop, scale) and an unconditional `-pix_fmt p010le`, both of
which are incompatible with the CUDA hwframes that arrive from the
decode path.

Add a `softwareFrames` option to `getNvdecHwaccelPreset` that omits
`-hwaccel_output_format cuda`, so NVDEC still accelerates decode but
frames land in system memory. Existing software filters and the
encoder-side `-pix_fmt p010le` then work without modification.

Wire e5c3's `decoder_string()` to pass `{ softwareFrames: true }`. No
changes to the filter or encoder logic, keeping the diff minimal for a
plugin with no unit tests (// tdarrSkipTest).

Verified end-to-end on real NVIDIA hardware + ffmpeg 7.1.2-Jellyfin
across all four `encoder_string_full` branches (highres+crop, highres
only, crop only, no filter): all produce valid output, with NVDEC decode
giving ~5-7x realtime on the test clip vs ~2.6x for pure software decode.
The full-GPU pipeline isn't appropriate here since the plugin's filters
require system-memory frames anyway.

* fix: thread softwareFrames option through getNvenc10BitFormatArg

The 10-bit format helper internally calls getNvdecHwaccelPreset to
decide between `-vf scale_cuda=format=p010le` and `-pix_fmt p010le`,
but it was discarding the caller's options. A future plugin combining
both helpers with `softwareFrames: true` would have received the
GPU-frame branch (`scale_cuda`) for an actual sw-frame decode path,
which fails at runtime.

Accept the same options object so the two helpers always agree on the
decode path. Existing call sites pass no options and keep current
behaviour.
…ng commentary (#883) (#967)

* fix: Migz4CleanSubs no longer treats SDH subtitles as commentary (#883)

Splits SDH track removal out of the existing 'commentary' option into a
new dedicated 'sdh' option that defaults to false. SDH (Subtitles for
the Deaf and Hard of hearing) are accessibility tracks, not commentary,
so they are now preserved by default. Users who want SDH tracks stripped
can opt in via the new 'sdh' input.

Adds regression tests covering both default (SDH kept) and opt-in (SDH
removed) behaviour.

* fix: keep pre-existing SDH default, sdh option is opt-out

Reverses the default for the new 'sdh' input from false to true so that
upgrading users see no behaviour change: when commentary=true, SDH tracks
continue to be removed alongside commentary/description as they were
before. Users who hit issue #883 can now disable SDH removal by setting
the new sdh option to false. Tests updated to cover the opt-out path
and the preserved default.
AMD AV1 (av1_amf) on RDNA4 GPUs (e.g. RX 9070 XT) rejects 256x256
input with AMF_OUT_OF_RANGE, causing checkNodeHardwareEncoder to
report av1_amf as unsupported. Bumping the lavfi color source to
512x512 satisfies AMF's minimum, stays well below any real media
size, and does not regress detection on Intel QSV/VAAPI or NVIDIA
NVENC encoders.
* Preserve original track name when downmix

Append channels at end

* fix: sanitize downmix track titles and resolve lint errors in Migz5ConvertAudio

Strip quoting-sensitive characters from preserved track title and language
before interpolating into the ffmpeg command, wrap long lines, and remove
trailing whitespace so the file passes the repo lint config.

* test: update Migz5ConvertAudio expectations for preserved track titles

The plugin now appends the channel layout to the source track title
(e.g. "Anglais E-AC3 2.0 - 5.1") and emits a language metadata flag
when the source track has one. Refresh test expectations to match.

* fix: extend title preservation to 7ch DTS paths and skip redundant suffix

Apply the same source-title and language preservation to the 7-channel
(DTS 6.1) downmix paths so behavior is consistent with the 8-to-6 and
6-to-2 paths. Skip appending the channel layout suffix when the source
title already ends with that layout (e.g. "Anglais E-AC3 2.0" stays
"Anglais E-AC3 2.0" instead of becoming "Anglais E-AC3 2.0 - 2.0").
Update tests to match.

* refactor: hoist buildDownmixTitle and widen suffix dedup boundary

Move the helper out of the per-stream loop so it isn't reallocated
for every audio stream. Switch its boundary check from \s to [^0-9.]
so titles like "stereo (2.0)" or "stereo [2.0]" also dedup, while
still rejecting digit-prefixed lookalikes such as "15.1" or "12.0".

---------

Co-authored-by: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com>
…amByProperty plugin (#880)

* Convert to use exact match instead of substring

* Expanded the control of stream removal with more conditions

* chore: rebuild ffmpegCommandRemoveStreamByProperty index.js after merge

* refactor: drop unreachable empty-input validation in ffmpegCommandRemoveStreamByProperty

loadDefaultValues rewrites '' back to each input's defaultValue ('codec_name'
and 'aac'), so the empty-string guards could never fire. Remove them rather
than carry dead code.

* test: cover equals and not_equals conditions in ffmpegCommandRemoveStreamByProperty

Add 6 cases verifying:
- equals matches exact values only (ac3 does not remove eac3)
- equals supports multiple values via OR
- equals is case insensitive
- not_equals removes everything that is not the value
- not_equals over multiple values means equalling NONE of them
- not_equals is case insensitive

---------

Co-authored-by: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com>
The downmix paths emitted `title="${val}"` and `language="${val}"`.
Tdarr splits presets with parseArgsStringToArgv, which only strips
quotes around a whole token, so the inner quotes survived into ffmpeg
as literal characters. New tracks were tagged with language `"eng"`
(with quote chars) instead of `eng`, which Keep_Native_Lang_Plus_Eng
treats as unknown and removes, causing the plugin stack to loop.

Wrap the whole `key=value` token in quotes instead so they're stripped
once. Tests updated to match.
* feat: preserve_channel_title

* docs: update tooltip

* test: cover preserved title deduping
* Update Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT

Extract HI/SDH and forced subtitles instead of overwriting normal subtitles

* style: lint quote issues

* fix: disposition guard

---------

Co-authored-by: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com>
* fix: copy ffmpeg streams with metadata args

* test: strengthen test cases
* fix: runCli shell command argument parsing

* fix: tighten runCli bash command option parsing

* fix: preserve runCli shell command arguments
* Initial commit

* Error correction

* Improved logs

* fix: tag audio streams count plugin as audio

* test: add audio streams count flow tests

* fix: order audio streams count outputs

---------

Co-authored-by: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com>
* replaceOriginalFile: Add additional output for file not replaced

when replaceOriginalFile does not replace the file, notifyRadarrOrSonarr causes a flow error

* feat: add file changed check plugin

---------

Co-authored-by: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com>
* feat: allow pause plugin to target current node

* fix: normalize pause plugin server URL
* feat: add check streams count flow plugin

* fix: use number input for stream count

* fix: use number input for audio stream count
…680)

* allow plugin to process more subtitle types

* use single quotes

* feat: add configurable subtitle extraction codecs

* docs: clarify subtitle extraction codecs

---------

Co-authored-by: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com>
* Add AV1 support to rename based on codec plugin

* fix: keep codec rename scoped to filenames

* fix: satisfy codec rename plugin lint

---------

Co-authored-by: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com>
* chore: require source deletion for move to directory

* chore: require source deletion for move plugins
* feat: add set file permissions flow plugin

* fix: harden metadata updates

* fix: preserve file permissions during ownership updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.