From f77c42ebdef38402393fa29fe7d83ed9d5aff6a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Le=20Calvar?= Date: Sun, 4 Apr 2021 01:35:16 +0200 Subject: [PATCH] added input options to enable vaapi, override default bf value, add video filter --- main.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/main.js b/main.js index c0c9221..b98583d 100644 --- a/main.js +++ b/main.js @@ -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 { + videoFilters: [ + 'hwupload' + ], + inputOptions: [ + // enable hardware acceleration + '-hwaccel vaapi', + '-hwaccel_output_format vaapi', + '-vaapi_device /dev/dri/renderD128' + ], outputOptions: [ - // enable hardware acceleration - '-hwaccel vaapi -hwaccel_output_format vaapi -vaapi_device /dev/dri/renderD128' + '-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)