Muaz Khan edited this page Apr 29, 2017 · 3 revisions

This wiki page explains how to install ffmpeg on CentOS and Ubunto; and how to use ffmpeg with RecordRTC.js

Install Ffmpeg

  1. CentOS
  2. Ubuntu
  3. Other OS/platforms

Here is 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

Sometimes ffmpeg installations miss to copy libz.so.1. Here is how to fix such issues:

cp - /lib64/libz.so.1 /usr/local/lib/

Ffmpeg-asm.js

Resources & Demos are available here:

Convert WebM into mp4

ffmpeg -i video.webm -vcodec h264 -i audio.wav -acodec libfaac out.mp4

You can use above command within following demos:

  1. RecordRTC-to-Nodejs
  2. RecordRTC-over-Socketio
  3. PHP and Ffmpeg
  4. Other demos here

E.g. here:

  1. https://github.com/muaz-khan/RecordRTC/blob/master/RecordRTC-to-Nodejs/merger.bat#L2
  2. https://github.com/muaz-khan/RecordRTC/blob/master/PHP-and-FFmpeg/save.php#L70

Merge Screen And Camera Into Single WebM

ffmpeg -y -i video.webm -i screen.webm -filter_complex "[0:v]setpts=PTS-STARTPTS, pad=iw:ih[bg]; [1:v]scale=320:240,setpts=PTS-STARTPTS[fg]; [bg][fg]overlay=main_w-overlay_w-10:main_h-overlay_h-10" videoPlusScreenInSingleFile.webm

Now both video+screen will be played in parallel. Video will overlay the screen, and will be displayed as a small video on bottom-right corner of screen.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.