RecordRTC: WebRTC audio/video recording ® Muaz Khan
HOME
©
Muaz Khan .
@WebRTCWeb .
Github .
Latest issues .
What's New?
into
URL Parameters
// AUDIO ?bufferSize=16384&sampleRate=44100 ?leftChannel=false&disableLogs=false // VIDEO ?canvas_width=1280&canvas_height=720 ?frameInterval=10
RecordRTC Sources Codes / Wiki Pages
- RecordRTC Main Demo (Records screen/video/audio in all browsers!)
- RecordRTC-to-PHP (audio/video recording and uploading to server)
- Canvas Recording! (Web-Page Recording)
- Record Canvas2D Drawings (Huge collection of 2D drawings!)
- Record Mp3 or Wav (Pre-recorded audio) i.e. (Audio on Demand)
- MRecordRTC and writeToDisk/getFromDisk!
- Audio+Video Recording on Firefox
- RecordRTC / PHP / FFmpeg (Syncing/Merging audio/video in single file!)
- RecordRTC-to-Nodejs (used ffmpeg to merge wav/webm in single WebM container)
- RecordRTC-to-ASP.NET MVC (audio/video recording and uploading to server)
- RecordRTC-to-Socket.io (used ffmpeg to merge wav/webm in single WebM container)
- RecordRTC and ffmpeg-asm.js (ffmpeg inside the browser!)
Screen Capturing Prerequisites
- Chrome? Store / Source Code /
- Firefox? Store / Source Code /
Feedback
Using RecordRTC...
- You can record both Audio/Video in single file in Firefox.
- You can record both Audio/Screen in single file in Firefox.
- You can record audio as WAV and video as WebM in Chrome/Opera.
- You can record audio as WAV in Microsoft Edge.
- You can record remote audios (RTCPeerConnection.onaddstream) in Firefox using "recorderType:StereoAudioRecorder"
- You can record Gif in all browsers.
You can even control buffer-size, sample-rates, video-resolutions, etc.
Technical Guide
- Chrome allows getUserMedia invocation on majority of non-file protocols e.g. HTTP/HTTPS/ or inside chrome extension pages. Though, there is always options to use CL (command-line) flags to support file protocols.
- ( In Chrome) RecordRTC captures video frames via Canvas2D; which is encoded in webp-DataURL; now it is using a library named “weppy” which encodes webp into webm.
- ( In Firefox) RecordRTC is using MediaRecorder API; which supports both audio/video recordings, both in single and multiple files.
- ( In Chrome) RecordRTC is using WebAudio API for audio-recording. Such API has many issues e.g. unable to capture mono audio in wav format; unable to capture remote audio; failure on XP SP2; etc.
- ( In Chrome) If you’re using notebook’s built-in audio input device for audio recording; then you may get "blank" blob.
- ( In Chrome) RecordRTC is incapable to record audio/video in a single file; however there is ffmpeg merging solution available on Github repository.
How to use RecordRTC?
<script src="//cdn.webrtc-experiment.com/RecordRTC.js"></script>
How to record audio using RecordRTC?
var recordRTC = RecordRTC(mediaStream, { recorderType: StereoAudioRecorder // optionally force WebAudio API to record audio }); recordRTC.startRecording(); recordRTC.stopRecording(function(audioURL) { mediaElement.src = audioURL; });
How to record video using RecordRTC?
var options = { type: 'video', video: { width: 320, height: 240 }, canvas: { width: 320, height: 240 }, recorderType: WhammyRecorder // optional }; var recordRTC = RecordRTC(mediaStream, options); recordRTC.startRecording(); recordRTC.stopRecording(function(videoURL) { mediaElement.src = videoURL; });
How to record animated GIF using RecordRTC?
// you must link: // https://www.webrtc-experiment.com/gif-recorder.js var options = { type: 'gif', video: { width: 320, height: 240 }, canvas: { width: 320, height: 240 }, frameRate: 200, quality: 10 }; var recordRTC = RecordRTC(mediaStream, options); recordRTC.startRecording(); recordRTC. stopRecording(function(gifURL) { mediaElement.src = gifURL; });
Possible issues/failures:
(
In Chrome) The biggest issue is that RecordRTC is
unable to record both audio and video streams in single file.
Do you know "RecordRTC" fails recording audio because following conditions fails (
applies only to chrome):
- Sample rate and channel configuration must be the same for input and output sides on Windows i.e. audio input/output devices must match
- Only the Default microphone device can be used for capturing.
- The requesting scheme is must be one of the following: http, https, chrome, extension's, or file (only works with --allow-file-access-from-files)
- The browser must be able to create/initialize the metadata database for the API under the profile directory
RecordRTC is MIT licensed on Github! Documentation