From 3e03b961b8ab897500dfea626f808c009f64e551 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 9 Apr 2021 10:36:21 +0200 Subject: Add ability for plugins to specify scale filter --- .../peertube-plugin-test-transcoding-one/main.js | 97 +++++++++++++--------- 1 file changed, 59 insertions(+), 38 deletions(-) (limited to 'server/tests/fixtures/peertube-plugin-test-transcoding-one') diff --git a/server/tests/fixtures/peertube-plugin-test-transcoding-one/main.js b/server/tests/fixtures/peertube-plugin-test-transcoding-one/main.js index 366b827a9..59b136947 100644 --- a/server/tests/fixtures/peertube-plugin-test-transcoding-one/main.js +++ b/server/tests/fixtures/peertube-plugin-test-transcoding-one/main.js @@ -1,63 +1,84 @@ async function register ({ transcodingManager }) { + // Output options { - const builder = () => { - return { - outputOptions: [ - '-r 10' - ] + { + const builder = () => { + return { + outputOptions: [ + '-r 10' + ] + } } - } - transcodingManager.addVODProfile('libx264', 'low-vod', builder) - } + transcodingManager.addVODProfile('libx264', 'low-vod', builder) + } - { - const builder = () => { - return { - videoFilters: [ - 'fps=10' - ] + { + const builder = (options) => { + return { + outputOptions: [ + '-r:' + options.streamNum + ' 5' + ] + } } - } - transcodingManager.addVODProfile('libx264', 'video-filters-vod', builder) + transcodingManager.addLiveProfile('libx264', 'low-live', builder) + } } + // Input options { - const builder = () => { - return { - inputOptions: [ - '-r 5' - ] + { + const builder = () => { + return { + inputOptions: [ + '-r 5' + ] + } } - } - transcodingManager.addVODProfile('libx264', 'input-options-vod', builder) - } + transcodingManager.addVODProfile('libx264', 'input-options-vod', builder) + } - { - const builder = (options) => { - return { - outputOptions: [ - '-r:' + options.streamNum + ' 5' - ] + { + const builder = () => { + return { + inputOptions: [ + '-r 5' + ] + } } - } - transcodingManager.addLiveProfile('libx264', 'low-live', builder) + transcodingManager.addLiveProfile('libx264', 'input-options-live', builder) + } } + // Scale filters { - const builder = () => { - return { - inputOptions: [ - '-r 5' - ] + { + const builder = () => { + return { + scaleFilter: { + name: 'Glomgold' + } + } } + + transcodingManager.addVODProfile('libx264', 'bad-scale-vod', builder) } - transcodingManager.addLiveProfile('libx264', 'input-options-live', builder) + { + const builder = () => { + return { + scaleFilter: { + name: 'Flintheart' + } + } + } + + transcodingManager.addLiveProfile('libx264', 'bad-scale-live', builder) + } } } -- cgit v1.2.3