This commit is contained in:
matty 2024-03-07 19:46:57 -05:00
parent dcddc6f60b
commit 606d1d6377
3 changed files with 3262 additions and 11 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "peertube-plugin-hardware-transcode-nvenc", "name": "peertube-plugin-nctv-nvenc-transcode",
"version": "0.0.1", "version": "1.0.0",
"license": "MIT", "license": "MIT",
"description": "Plugin that adds transcode profiles which use NVIDIA NVENC for hardware acceleration", "description": "Plugin that adds transcode profiles which use NVIDIA NVENC for hardware acceleration",
"engine": { "engine": {
@ -10,9 +10,9 @@
"peertube", "peertube",
"plugin" "plugin"
], ],
"homepage": "https://github.com/ryanho/peertube-plugin-hardware-transcode-nvenc", "homepage": "https://gitea.nicecrew.digital/matty/peertube-plugin-nctv-nvenc-transcode",
"author": "ryanho", "author": "ryanho",
"bugs": "https://github.com/ryanho/peertube-plugin-hardware-transcode-nvenc/issues", "bugs": "https://gitea.nicecrew.digital/matty/peertube-plugin-nctv-nvenc-transcode/issues",
"library": "./dist/main.js", "library": "./dist/main.js",
"files": [ "files": [
"/dist" "/dist"

View File

@ -76,7 +76,8 @@ export async function register({settingsManager, peertubeHelpers, transcodingMan
{ label: 'medium (default)', value: '15' }, { label: 'medium (default)', value: '15' },
{ label: 'slow', value: '16' }, { label: 'slow', value: '16' },
{ label: 'slower', value: '17' }, { label: 'slower', value: '17' },
{ label: 'slowest', value: '18' } { label: 'slowest', value: '18' },
{ label: 'nctv', value: 'p7' }
], ],
descriptionHTML: 'This parameter controls the speed / quality tradeoff. Slower speed mean better quality. Faster speed mean lower quality. This setting is hardware dependent, you may need to experiment to find the best value for your hardware.', descriptionHTML: 'This parameter controls the speed / quality tradeoff. Slower speed mean better quality. Faster speed mean lower quality. This setting is hardware dependent, you may need to experiment to find the best value for your hardware.',
@ -174,12 +175,11 @@ function printResolution(resolution : VideoResolution) : string {
function buildInitOptions() { function buildInitOptions() {
if (pluginSettings.hardwareDecode) { if (pluginSettings.hardwareDecode) {
return [ return [
'-hwaccel cuda', '-vcodec h264_nvenc'
'-hwaccel_output_format cuda'
] ]
} else { } else {
return [ return [
'-hwaccel cuda' '-vcodec h264_nvenc'
] ]
} }
} }
@ -210,7 +210,8 @@ async function vodBuilder(params: EncoderOptionsBuilderParams) : Promise<Encoder
outputOptions: [ outputOptions: [
`-preset ${pluginSettings.vodQuality}`, `-preset ${pluginSettings.vodQuality}`,
`-b:v${streamSuffix} ${targetBitrate}`, `-b:v${streamSuffix} ${targetBitrate}`,
`-bufsize ${targetBitrate * 2}` `-bufsize ${targetBitrate * 2}`,
`-bf 4`
] ]
} }
logger.info(`EncoderOptions: ${JSON.stringify(options)}`) logger.info(`EncoderOptions: ${JSON.stringify(options)}`)
@ -245,10 +246,10 @@ async function liveBuilder(params: EncoderOptionsBuilderParams) : Promise<Encode
`-preset ${pluginSettings.liveQuality}`, `-preset ${pluginSettings.liveQuality}`,
`-r:v${streamSuffix} ${fps}`, `-r:v${streamSuffix} ${fps}`,
`-profile:v${streamSuffix} high`, `-profile:v${streamSuffix} high`,
`-level:v${streamSuffix} 3.1`,
`-g:v${streamSuffix} ${fps*2}`, `-g:v${streamSuffix} ${fps*2}`,
`-b:v${streamSuffix} ${targetBitrate}`, `-b:v${streamSuffix} ${targetBitrate}`,
`-bufsize ${targetBitrate * 2}` `-bufsize ${targetBitrate * 2}`,
`-bf 4`
] ]
} }
logger.info(`EncoderOptions: ${JSON.stringify(options)}`) logger.info(`EncoderOptions: ${JSON.stringify(options)}`)

3250
yarn.lock Normal file

File diff suppressed because it is too large Load Diff