From edc1f14f5e92519805049ed938cbccb334361dd5 Mon Sep 17 00:00:00 2001 From: oshinongit Date: Fri, 9 Aug 2024 14:21:27 +0200 Subject: [PATCH] feat: qvbr aws example profile --- examples/aws/encoding-profile-qvbr.json | 45 +++++++++++++++++++++++++ src/pipelines/aws/aws-pipeline.ts | 12 ++++--- 2 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 examples/aws/encoding-profile-qvbr.json diff --git a/examples/aws/encoding-profile-qvbr.json b/examples/aws/encoding-profile-qvbr.json new file mode 100644 index 0000000..1fedbe0 --- /dev/null +++ b/examples/aws/encoding-profile-qvbr.json @@ -0,0 +1,45 @@ +{ + "Inputs": [ + { + "TimecodeSource": "ZEROBASED", + "VideoSelector": {}, + "FileInput": "$INPUT" + } + ], + "OutputGroups": [ + { + "Name": "File Group", + "OutputGroupSettings": { + "Type": "FILE_GROUP_SETTINGS", + "FileGroupSettings": { + "Destination": "$OUTPUT" + } + }, + "Outputs": [ + { + "VideoDescription": { + "CodecSettings": { + "Codec": "H_264", + "H264Settings": { + "RateControlMode": "QVBR", + "QvbrSettings": { + "QvbrQualityLevel": "$QVBRQUALITYLEVEL" + }, + "CodecProfile": "HIGH" + } + }, + "Width": "$WIDTH", + "Height": "$HEIGHT" + }, + "ContainerSettings": { + "Container": "MP4", + "Mp4Settings": {} + } + } + ] + } + ], + "TimecodeConfig": { + "Source": "ZEROBASED" + } +} diff --git a/src/pipelines/aws/aws-pipeline.ts b/src/pipelines/aws/aws-pipeline.ts index a6d0445..f41169d 100644 --- a/src/pipelines/aws/aws-pipeline.ts +++ b/src/pipelines/aws/aws-pipeline.ts @@ -158,11 +158,13 @@ export default class AWSPipeline implements Pipeline { '$HEIGHT', targetResolution.height.toString() ); - settingsStr = this.stringReplacement( - settingsStr, - '$BITRATE', - targetBitrate.toString() - ); + if (!settingsStr.includes("$QVBRQUALITYLEVEL")) { + settingsStr = this.stringReplacement( + settingsStr, + '$BITRATE', + targetBitrate.toString() + ); + } // HEVC specific settings settingsStr = this.stringReplacement( settingsStr,