initial commit

This commit is contained in:
Théo Le Calvar 2021-03-30 19:25:24 +02:00
commit 7d60dc2120
2 changed files with 61 additions and 0 deletions

40
main.js Normal file
View File

@ -0,0 +1,40 @@
async function register ({
transcodingManager
}) {
// Adapt bitrate when using libx264 encoder
{
const builder = (options) => {
const { input, resolution, fps, streamNum } = options
const streamString = streamNum ? ':' + streamNum : ''
console.log(options);
// You can also return a promise
return {
outputOptions: [
// enable hardware acceleration
'-hwaccel vaapi -hwaccel_output_format vaapi -vaapi_device /dev/dri/renderD128'
]
}
}
const encoder = 'libx264'
const profileName = 'foobarbaz'
// Support this profile for VOD transcoding
transcodingManager.addVODProfile(encoder, profileName, builder)
// And/Or support this profile for live transcoding
transcodingManager.addLiveProfile(encoder, profileName, builder)
}
}
async function unregister() {
return true;
}
module.exports = {
register,
unregister
}

21
package.json Normal file
View File

@ -0,0 +1,21 @@
{
"name": "peertube-plugin-hardware-transcode-vaapi",
"version": "0.0.1",
"description": "Plugin add transcode profils which use vaapi for hardware acceleration",
"engine": {
"peertube": ">=3.1.0"
},
"keywords": [
"peertube",
"plugin"
],
"homepage": "https://git.kher.nl/tlc/peertube-plugin-hardware-transcode-vaapi",
"author": "gdsn",
"bugs": "https://git.kher.nl/tlc/peertube-plugin-hardware-transcode-vaapi",
"library": "./main.js",
"staticDirs": {},
"css": [],
"clientScripts": [],
"translations": {}
}