Skip to content

Commit

Permalink
Hardcode videoBitsPerSecond to when mime type is mp4
Browse files Browse the repository at this point in the history
point to custom package

point to custom package
  • Loading branch information
nicolo-kira committed Oct 9, 2024
1 parent 1285cec commit 53da77a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
15 changes: 8 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"opus"
],
"dependencies": {
"recordrtc": ">=5.6.2",
"recordrtc": "github:kira/RecordRTC#566a27536f1aaa007058d94cf0af06a1f697b934",
"video.js": ">=7.0.5",
"videojs-wavesurfer": ">=3.10.0",
"webrtc-adapter": ">=9.0.1"
Expand Down
7 changes: 6 additions & 1 deletion src/js/engine/record-rtc.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class RecordRTCEngine extends RecordEngine {
if (this.recorderType !== undefined) {
this.mediaType.video = this.recorderType;
}

// setup RecordRTC
this.engine = new RecordRTC.MRecordRTC();
this.engine.mediaType = this.mediaType;
Expand All @@ -61,6 +61,11 @@ class RecordRTCEngine extends RecordEngine {
this.engine.canvas = this.canvas;
this.engine.bitrate = this.bitRate;

if (this.mimeType?.video?.includes("mp4")) {
console.debug("Setting videoBitsPerSecond to 1 Mbps")
this.engine.videoBitsPerSecond = 1000000; // 1 Mbps
}

// animated gif settings
this.engine.quality = this.quality;
this.engine.frameRate = this.frameRate;
Expand Down

0 comments on commit 53da77a

Please sign in to comment.