muaz-khan / RecordRTC

RecordRTC is WebRTC JavaScript library for audio/video as well as screen activity recording. It supports Chrome, Firefox, Opera, Android, and Microsoft Edge. Platforms: Linux, Mac and Windows.

Home Page:https://www.webrtc-experiment.com/RecordRTC/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to pass bitrate to Media Recorder API on Safari

Baldur10 opened this issue · comments

Tested on:
Safari: ver. 16.1 (18614.2.9.1.12)
Chrome: 107.0.5304.110 (Official Build) (arm64)

So my firm relies on RecordRTC for our video recording app. We noticed that the files being recorded on Safari were much larger than than those on Chrome due to having almost 5 times the bitrate. Upon further investigation, we narrowed the issue down to:

  1. Safari as of yet not supporting webm (18 Nov, 2022)

image

  1. This throws an error

image

  1. Which is caught by the following statement
try {
       mediaRecorder = new MediaRecorder(mediaStream, recorderHints);
       // reset
       config.mimeType = recorderHints.mimeType;

    } catch (e) {
      // chrome-based fallback
      mediaRecorder = new MediaRecorder(mediaStream);
}
  1. Thus, the specified bitrate isn't passed to the Media Recorder API and default bitrate is selected. This behaviour can be observed in the live demo website as well.

해당 문제는 ios 15.x 버전(아마도 그 이하 버전들)에서 발생하는 문제입니다. 나는 여러 시도를 했지만, 해결법을 찾지는 못했습니다. 그냥 ios 버전을 17.x로 올리니까 해결이 되었습니다. 아마도 16.x버전으로 올려도 해결이 될 수 있을 겁니다. 사용자들에게 ios 버전을 업그레이드 하라고 메세지를 띄우는 것이 현명합니다. 다만, 녹화 옵션의 값을 조정해도 그것이 적용되지는 않습니다.

Tested on: Safari: ver. 16.1 (18614.2.9.1.12) Chrome: 107.0.5304.110 (Official Build) (arm64)

So my firm relies on RecordRTC for our video recording app. We noticed that the files being recorded on Safari were much larger than than those on Chrome due to having almost 5 times the bitrate. Upon further investigation, we narrowed the issue down to:

  1. Safari as of yet not supporting webm (18 Nov, 2022)
image
  1. This throws an error
image
  1. Which is caught by the following statement
try {
       mediaRecorder = new MediaRecorder(mediaStream, recorderHints);
       // reset
       config.mimeType = recorderHints.mimeType;

    } catch (e) {
      // chrome-based fallback
      mediaRecorder = new MediaRecorder(mediaStream);
}
  1. Thus, the specified bitrate isn't passed to the Media Recorder API and default bitrate is selected. This behaviour can be observed in the live demo website as well.

Did you find any solution for this issue?