added input options to enable vaapi, override default bf value, add video filter

This commit is contained in:
Théo Le Calvar 2021-04-04 01:35:16 +02:00
parent 7d60dc2120
commit f77c42ebde

21
main.js
View File

@ -7,23 +7,30 @@ async function register ({
const builder = (options) => {
const { input, resolution, fps, streamNum } = options
const streamString = streamNum ? ':' + streamNum : ''
console.log(options);
// You can also return a promise
return {
outputOptions: [
videoFilters: [
'hwupload'
],
inputOptions: [
// enable hardware acceleration
'-hwaccel vaapi -hwaccel_output_format vaapi -vaapi_device /dev/dri/renderD128'
'-hwaccel vaapi',
'-hwaccel_output_format vaapi',
'-vaapi_device /dev/dri/renderD128'
],
outputOptions: [
'-bf 8', // override hardcoded bf value which cause memory error
'-pix_fmt vaapi_vld'
]
}
}
const encoder = 'libx264'
const profileName = 'foobarbaz'
const encoder = 'h264_vaapi'
const profileName = 'vaapi'
// Support this profile for VOD transcoding
transcodingManager.addVODProfile(encoder, profileName, builder)
transcodingManager.addVODEncoderPriority('video', encoder, 1000)
// And/Or support this profile for live transcoding
transcodingManager.addLiveProfile(encoder, profileName, builder)