Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

recordrtc

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

recordrtc

RecordRTC is a server-less (entire client-side) JavaScript library can be used to record WebRTC audio/video media streams. It supports cross-browser audio/video recording. Current experiment: 1. Records audio/video separately as wav/webm 2. POST both fil

  • 3.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
115K
increased by7.35%
Maintainers
1
Weekly downloads
 
Created
Source

Note: You MUST always manually create a directory and name it "uploads".

=

RecordRTC to Node.js
npm install recordrtc

// to run it!
cd ./node_modules/recordrtc/ && node index.js

Make sure that directory names MUST NOT have spaces; e.g.

// invalid directory
C:\Hello Sir\Another\RecordRTC

// valid
C:\Hello-Sir\Another\RecordRTC

// invalid directory
C:\First\Second Dir\Third\RecordRTC

// valid
C:\\First\Second-Dir\Third\RecordRTC

This experiment:

  1. Records audio/video separately as wav/webm
  2. POST both files in single HttpPost-Request to Node.js (FormData)
  3. Node.js code saves both files into disk
  4. Node.js code invokes ffmpeg to merge wav/webm in single "webm" file
  5. The merged webm file's URL is returned using same HTTP-callback for playback!

=

Windows Batch File (merger.bat)

merger.bat file is executed to invoke ffmpeg functionalities on windows:

@echo off
ffmpeg -i audio-file.wav -i video-file.webm 0:0 -map 1:0 output-file-name.webm

It is assumed that you already have installed ffmpeg on your system. Though, EXE file is hard-coded to "C:\ffmpeg\bin\ffmpeg.exe" however you can easily edit it according to your own installations.

=

.sh file

merger.sh file is executed to invoke ffmpeg functionalities on Mac/Linux/etc.

ffmpeg -i audio-file.wav -i video-file.webm -map 0:0 -map 1:0 output-file-name.webm

Using Linux; ffmpeg installation is super-easy! You can install DEVEL packages as well.

=

Ubuntu, Debian, or Linux Mint?

You're suggested to install ffmpeg and libvpx from following URL:

Another useful resource is:

Read following comments:

Actually it is very easy to install FFmpeg under Ubuntu with the apt-get command. Unfortunately, the default FFmpeg installation doesn't let you include the latest codecs which are needed to merge WAV/WebM into vp8 encoded video i.e. WebM! Thus you have to compile FFmpeg yourself!

For example, you can check libvpx installation using following command:

dpkg -s libvpx | grep Status

This doesn't mean that you enabled libvpx for ffmpeg; you need to verify vp8 encoders in ffmpeg using following commands:

ffmpeg -codecs     # to check list of all decoders
ffmpeg -encoders   # to check list of all encoders

Usually latest ffmpeg can decode WebM i.e. vp8 codecs; however it can't encode back into vp8 until you manually install libvpx.

There is another useful resource!

This provides a good command to check list of encoders in ffmpeg:

ffmpeg -encoders|grep -E "mp3|xvid|aac|gsm|amr|x264|theora|vorbis"

Sometimes you mistakenly install multiple ffmpeg instances. Find-out ffmpeg instance that has included libvpx; then include that instance's full path in the ffmpeg-command. E.g.

ffmpeg -itsoffset -00:00:00 -i audioFile -itsoffset -00:00:00 -i videoFile -map 0:0 -map 1:0 outputFile

=

How to install ffmpeg on windows?
  1. Download ffmpeg and extract ZIP file
  2. Rename extracted directory to "ffmpeg"
  3. Right click over "My Computer" icon and select "Properties" context-menu option
  4. Select "Advance system settings" from top-left section
  5. Click "Environment Variables..." button from "Advanced" tab
  6. Click "New..." button and in the "Variable name" box, enter "Path".
  7. In the "Variable value" box, enter extracted directory full URI e.g. "C:\ffmpeg"
  8. Click "OK" and done!

http://www.wikihow.com/Install-FFmpeg-on-Windows

=

How to install ffmpeg on Mac OSX?

Make sure you have homebrew installed. Then run following command:

brew install ffmpeg --with-libvpx --with-theora --with-libogg --with-libvorbis

More info here:

How to test?

In the node.js command prompt window; type node index; then open http://localhost:8000/.

=

How to fix audio/video sync issues on chrome?
recordAudio = RecordRTC( stream, {
     onAudioProcessStarted: function( ) {
         recordVideo.startRecording();
     }
});

recordVideo = RecordRTC(stream, {
    type: 'video'
});

recordAudio.startRecording();

onAudioProcessStarted fixes shared/exclusive audio gap (a little bit). Because shared audio sometimes causes 100ms delay... sometime about 400-to-500 ms delay. Delay depends upon number of applications concurrently requesting same audio devices and CPU/Memory available. Shared mode is the only mode currently available on 90% of windows systems especially on windows 7.

=

Want to recording only audio?
// line 91:

// Firefox can record both audio/video in single webm container
// Don't need to create multiple instances of the RecordRTC for Firefox
// You can even use below property to force recording only audio blob on chrome
var isRecordOnlyAudio = true;

=

  1. RecordRTC to Node.js
  2. RecordRTC to PHP
  3. RecordRTC to ASP.NET MVC
  4. RecordRTC & HTML-2-Canvas i.e. Canvas/HTML Recording!
  5. MRecordRTC i.e. Multi-RecordRTC!
  6. RecordRTC on Ruby!
  7. RecordRTC over Socket.io

=

License

RecordRTC-to-Nodejs is released under MIT licence . Copyright (c) Muaz Khan.

Keywords

FAQs

Package last updated on 12 May 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc