Skip to main content

Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC

Boosh-Transcode Using QSV GPU & FFMPEG (v1.3)

==DETAILS== This is a QSV plugin. 8th+ gen INTEL QSV enabled CPUs are recommended. VAAPI is NOT used.

==OS SUPPORT== This plugin supports Linux & Windows using QSV. Mac is supported though cannot use QSV and relies on 'VideoToolBox' - Expect to see different encode speed & quality on Mac compared to other platforms. Ensure you set your node settings accordingly!

==LOGIC== Files will be transcoded into H265/HEVC using Quick Sync Video (QSV) via Intel GPU using ffmpeg. Settings are dependant on file bitrate working by the logic that H265 can support the same amount of data at half the bitrate of H264. This plugin will skip files already in HEVC, AV1 & VP9 unless "reconvert_hevc" is marked as true. If it is then these will be reconverted again if they exceed the bitrate specified in "hevc_max_bitrate". This plugin relies on understanding the accurate video bitrate of your files. It's highly recommended to remux into MKV & enable "Run mkvpropedit on files before running plugins" under Tdarr>Options.

View Source

Inputs:

Name: container 

Type: string

Tooltip:

\n
==DESCRIPTION==
\nSpecifies the output container of the file.
\nEnsure that all stream types you may have are supported by your chosen container.
\n
==INFO==
\nOnly MP4 & MKV are supported and MKV is recommended.
\nExample:\n
mkv
\nExample:\n
mp4
Name: force_conform 

Type: boolean

Tooltip:

\n
==DESCRIPTION==
\nMake the file conform to output containers requirements.
Use if you need to ensure the encode works from mp4>mkv or mkv>mp4. \n
==WARNING== \n
This will remove data of certain types so ensure you are happy with that,
or use another plugin to convert these data types first!
\n
==INFO==
\nDrop hdmv_pgs_subtitle/eia_608/subrip/timed_id3 for MP4.
\nDrop data streams/mov_text/eia_608/timed_id3 for MKV.
\nDefault is false.
\nExample:\n
true
\nExample:\n
false
Name: enable_10bit 

Type: boolean

Tooltip:

\n
==DESCRIPTION==
\nSpecify if we want to enable 10bit encoding.
\nIf this is enabled files will be processed and converted into 10bit
HEVC using main10 profile and with p010le pixel format.

If you just want to retain files that are already 10 bit then this can be left as false, as
10bit to 10bit in ffmpeg should be automatic.
\n
==INFO==
\nDefault is "false".
\nExample:\n
true
\nExample:\n
false
Name: encoder_speedpreset 

Type: string

Tooltip:

\n
==DESCRIPTION==
\nSpecify the encoder speed/preset to use.
Slower options mean a slower encode but better quality and faster options mean faster encodes but
worse quality.
\nFor more information see intel white paper on ffmpeg results using QSV: \nhttps://www.intel.com/content/dam/www/public/us/en/documents/white-papers/cloud-computing-quicksync-video-ffmpeg-white-paper.pdf
\n
==INFO==
\nDefault is "slow".
\nExample:\n
medium
\nExample:\n
slower
Name: extra_qsv_options 

Type: string

Tooltip:

\n
==DESCRIPTION==
\nHere you can add extra options to the ffmpeg QSV ENCODE cmd.
This does not override the ffmpeg cmd, it just allows additions to it.
\n
There are extra QSV options that can be
forced on/off as desired. See here for some possible cmds -
https://ffmpeg.org/ffmpeg-codecs.html#toc-HEVC-Options-1
\n
==WARNING== \n
Be certain to verify the cmds work before adding to your workflow. \n
Check Tdarr Help Tab. Enter ffmpeg cmd - "-h encoder=hevc_qsv". This will give a list of supported commands. \n
MAC SPECIFIC - This option is ignored on Mac because videotoolbox is used rather than qsv.
\n
==INFO==
\nDefault is empty but the first example below has a suggested value. If unsure just leave empty.
\nEnsure to only use cmds valid to encoding QSV as the script handles other ffmpeg cmds relating to
bitrate etc. Anything else entered here might be supported but could cause undesired results.
\nIf you are using a "-vf" cmd, please put it at the end to avoid issues!
\nExample:\n
-look_ahead 1 -look_ahead_depth 100 -extbrc 1 -rdo 1 -mbbrc 1 -b_strategy 1 -adaptive_i 1 -adaptive_b 1
\n Above enables look ahead, extended bitrate control, b-frames, etc.\n
\nExample:\n
-vf scale_qsv=w=1280:h=720
\nScale video resolution Method 1\n
\nExample:\n
-vf scale_qsv=1280:-1
\nScale video resolution Method 2\n
Name: bitrate_cutoff 

Type: number

Tooltip:

\n
==DESCRIPTION==
\nSpecify bitrate cutoff, files with a video bitrate lower then this will not be processed.

\n
==INFO==
\nRate is in kbps.
\nDefaults to 0 which means this is disabled.
\nEnter a valid number to enable.
\nExample:\n
2500
\nExample:\n
1500
Name: max_average_bitrate 

Type: number

Tooltip:

\n
==DESCRIPTION==
\nSpecify a maximum average video bitrate. When encoding we take the current video bitrate and halve it
to get an average target. This option sets a upper limit to that average
(i.e if you have a video bitrate of 10000, half is 5000, if your maximum desired average bitrate is 4000
then we use that as the target instead of 5000).
\n
==INFO==
\nBitrate here is referring to video bitrate as we want to set the video bitrate on encode.
\nRate is in kbps.
\nDefaults to 0 which means this is disabled.
\nEnter a valid number to enable.
\nExample:\n
4000
\nExample:\n
3000
Name: min_average_bitrate 

Type: number

Tooltip:

\n
==DESCRIPTION==
\nSpecify a minimum average video bitrate. When encoding we take the current video bitrate and halve
it to get an average target. This option sets a lower limit to that average (i.e if you have a video bitrate
of 3000, half is 1500, if your minimum desired average bitrate is 2000 then we use that as the target instead
of 1500).
\n
==INFO==
\nBitrate here is referring to video bitrate as we want to set the video bitrate on encode.
\nRate is in kbps.
\nDefaults to 0 which means this is disabled.
\nEnter a valid number to enable.
\nExample:\n
2000
\nExample:\n
1000
Name: reconvert_hevc 

Type: boolean

Tooltip:

\n
==DESCRIPTION==
\nSet to reprocess HEVC, VP9 or AV1 files (i.e reduce bitrate of files already in those codecs).
\nSince this uses the same logic as normal, halving the current bitrate, this is NOT recommended
unless you know what you are doing, so please leave FALSE if unsure!
\nNEEDS to be used in conjunction with "bitrate_cutoff" or "hevc_max_bitrate" otherwise is ignored.
\nThis is useful in certain situations, perhaps you have a file which is HEVC but has an extremely high
bitrate and you'd like to reduce it.
\n
==WARNING== \n
IF YOU HAVE VP9 OR AV1 FILES YOU WANT TO KEEP IN THOSE FORMATS THEN DO NOT USE THIS OPTION. \n
\nThis option has the potential to LOOP your encodes! You can encode a file to HEVC and still
be above your cutoff and it would be converted again & again if this is set to true (since it's now HEVC).
So if you use this be sure to set "hevc_max_bitrate" & "max_average_bitrate" to help prevent the plugin looping.
Also it is highly suggested that you have your "hevc_max_bitrate" higher than "max_average_bitrate".
\nPlease be certain you want this enabled before setting it otherwise leave this as FALSE!
While the plugin will attempt to generate accurate video bitrate metadata, it can not always reliably do so
and will be forced to fall back onto estimates. Please bare this in mind when using the HEVC reprocess option.
\n
\nExample:\n
true
\nExample:\n
false
Name: hevc_max_bitrate 

Type: number

Tooltip:

\n
==DESCRIPTION==
\nHas no effect unless "reconvert_hevc" is set to true. This allows you to specify a maximum
allowed average OVERALL bitrate for HEVC or similar files. Much like the "bitrate_cutoff" option, but
specifically for HEVC files. It should be set HIGHER then your standard cutoff for safety.
\nAlso, it's highly suggested you use the min & max average bitrate options in combination with this. You
will want those to control the encoded video bitrate, otherwise you may end up repeatedly reprocessing HEVC files.
i.e your file might have a overall bitrate of 20000, if your hevc cutoff is 5000 then it's going to reconvert
multiple times before it'll fall below that cutoff. While HEVC reprocessing can be useful this is why it is NOT
recommended!
\n
==WARNING== \n
While the plugin will attempt to generate accurate video bitrate metadata, it can not always reliably do so
and will be forced to fall back onto estimates. Please bare this in mind when using the HEVC reprocess option.
\n
==INFO==
\nRate is in kbps.
\nDefaults to 0 which means this is disabled.
\nEnter a valid number to enable, otherwise we use "bitrate_cutoff" and multiply x2 for a safe limit.
\nExample:\n
4000
\nExample:\n
3000