Skip to content

Commit f2566d3

Browse files
fix(liveness): increase max frame rate and bitrate (#6437)
* fix(liveness): increase max frame rate and bitrate * Create large-chefs-agree.md * move bps to constant
1 parent e0fcb43 commit f2566d3

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.changeset/large-chefs-agree.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@aws-amplify/ui-react-liveness": patch
3+
---
4+
5+
fix(liveness): increase max frame rate and bitrate

packages/react-liveness/src/components/FaceLivenessDetector/service/utils/videoRecorder.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { isAndroidChromeWithBrokenH264 } from '../../utils/device';
22

3+
// Equivalent to 2 Kbps - needed for maintaining video quality at 60 FPS
4+
const BITS_PER_SECOND = 2000000;
35
// Only to be used with Chrome for the Android Chrome H264 Bug - https://issues.chromium.org/issues/343199623
46
const ALTERNATE_CHROME_MIME_TYPE = 'video/x-matroska;codecs=vp8';
57

@@ -30,7 +32,7 @@ export class VideoRecorder {
3032
this._stream = stream;
3133
this._chunks = [];
3234
this._recorder = new MediaRecorder(stream, {
33-
bitsPerSecond: 1000000,
35+
bitsPerSecond: BITS_PER_SECOND,
3436
mimeType: isAndroidChromeWithBrokenH264()
3537
? ALTERNATE_CHROME_MIME_TYPE
3638
: undefined,

packages/react-liveness/src/components/FaceLivenessDetector/utils/helpers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ export const STATIC_VIDEO_CONSTRAINTS: MediaTrackConstraints = {
77
min: 240,
88
ideal: 480,
99
},
10-
frameRate: { min: 15, ideal: 30, max: 30 },
10+
frameRate: { min: 15, ideal: 30, max: 60 },
1111
facingMode: 'user',
1212
};

0 commit comments

Comments
 (0)