/Tdarr-H264-HEVC-to-NVENC-with-Optional-HDR

Tdarr plugin to transcode H264 or reconvert HEVC using NVENC with bframes, 10bit, and (optional) HDR

Primary LanguageJavaScript

purpan's H264/HEVC to NVENC with Optional HDR

This utilizes code from multiple other plugins, but it's but mostly built off of tws101's Ultimate_GPU_Transcoder_HDR plugin. I heavily tweaked it for higher quality encodes with even smaller sizes, added the tagging function, changed HDR to be optional, and made some other various edits, but most of the credit goes to them.

Installation

Right click the .js file above and hit "Save link as.." or click the file name and hit the download button. Place the plugin in (main Tdarr directory)/server/Tdarr/plugins/local. Refresh your UI and it will appear under the 'local' plugins tab.

Make sure to add Migz-Remove-Image-formats-from-file before this plugin. Otherwise it will attempt to remove the image formats itself, but it will go very slow.

Description

This plugin will transcode H264 or reconvert HEVC files using NVENC with bframes, 10bit, and (optional) HDR. Requires a Turing NVIDIA GPU or newer. If reconvert HEVC is on and the entire file is over the bitrate filter, the HEVC stream will be re-encoded. Typically results in a 20-55% smaller size with very little quality loss.

This plugin is designed for processing entire movie libraries, HDR content and all. However, it's not recommended you actually use this to reconvert HDR files as it strips some HDR10/+/Dolby Vision metadata and leaves just PQ. The reconvert_hdr option is more meant to filter out these files rather than actually convert them.

Because of the heavily tweaked ffmpeg encoder settings, HEVC to HEVC reconverting somtimes results in a higher bitrate than the specified target bitrate, but much less than the original file's. This plugin implements the filter_by_stream_tag plugin to prevent infinite loops caused by that higher bitrate being above that target bitrate.

By default, all settings are ideal for most use cases.

Screenshots and previews

You can click on the pictures and zoom in to get a feel for the (very minimal) difference in quality.

Disclaimer: the % reduction in these pictures is inaccurate. Use the GB/mbps numbers for comparison instead-

Full frames

Screenshot 2023-12-31 152131

Screenshot 2023-12-31 152201

Screenshot 2023-12-31 152216

Zoomed and cropped frames from dark scenes with motion

theoutsiders

thenun