initial commit
This commit is contained in:
commit
7d60dc2120
40
main.js
Normal file
40
main.js
Normal 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
21
package.json
Normal 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": {}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user