• Stars
    star
    198
  • Rank 195,764 (Top 4 %)
  • Language
    JavaScript
  • Created about 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple Record Demo using Mediasoup 3 and GStreamer

Simple video/audio Record Demo Using mediasoup 3 and GStreamer/FFmpeg


Introduction

Simple video/audio record application using Mediasoup and GStreamer

Recorded files are stored in the server's files directory or the directory set by the user (via process.env.RECORD_FILE_LOCATION_PATH)

File names are simply the current timestamp

This sample currently only uses VP8/opus and the output file is .webm


How to use

Install GStreamer

# For Ubuntu
sudo apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio

Install Server Modules

cd server && npm i

Install App Modules

cd app && npm i

Configure the server

Change the announced IP in src/config.js to your local ip (config -> webRtcTransport -> listenIps)

Start the server

# The server uses FFmpeg as default
cd server && node src/server

# To use GStreamer
PROCESS_NAME="GStreamer" node src/server

Build and start the application

cd app
npm run build

# Copy the files from dist to a webserver etc.
# OR start the dev server
npm run dev

Access the sample page

https://localhost:8080

By default recorded videos will be available in server/files directory.


Server ENV Options

Argument Type Explanation
RECORD_FILE_LOCATION_PATH string Path to store the recorded files (user running node MUST have read/write permission)
GSTREAMER_DEBUG_LEVEL number GStreamer Debug Level (GStreamer only)
PROCESS_NAME string The command to use (GStreamer/FFmpeg) (case sensitive) default is FFmpeg
SERVER_PORT number Server port number (default is 3000). Note if you change this you will also need to edit the WebSocket connection url.

TODO

  • video/audio only recording
  • Multiple formats (mp4/avi etc)
  • Docker support

Like my work? Any support is appreciated.

Buy Me A Coffee

More Repositories

1

mediasoup-ios-client

Mediasoup 3 iOS Client
Objective-C
130
star
2

mediasoup-ios-client-sample

Sample iOS mediasoup client sample
Swift
38
star
3

mediasoup-sample-server

Mediasoup sample server application
JavaScript
27
star
4

webrtc-tutorial

Simple WebRTC Tutorial
JavaScript
20
star
5

mediasoup-android-sample

Simple Mediasoup@3 Android Sample App
Java
18
star
6

mediasoup3-wsdemo

Mediasoup 3 Simple WS Demo
JavaScript
15
star
7

simple-meeting

A Simple Meeting Application
JavaScript
15
star
8

react-typescript-tailwind

Simple React app with Typescript and Tailwind
HTML
8
star
9

markdown-blog

Simple Markdown blog created with Nextjs and Tailwind
JavaScript
7
star
10

htmx-crud

Sample HTMX-CRUD Application
HTML
7
star
11

simple-htmx-form

Simple example showing HTMX
HTML
6
star
12

android_libwebrtc

Android libwebrtc file
5
star
13

python-youtube

Simple python script that downloads youtube videos
Python
5
star
14

webrtc-mac-src

WebRTC Mac src directory
C++
4
star
15

android-compose-store

Simple Android Compose Datastore Example
Kotlin
4
star
16

python-gender-age-detect

Simple Python 3 + OpenCV Age and Gender detector
Python
3
star
17

gstreamer-rtmp-sample

Sample showing how to stream webcam to an rtmp server
C++
3
star
18

compose-api-tutorial

Simple Android Compose API Example
Kotlin
2
star
19

screen-streaming

Simple example showing streaming the screen with GStreamer and C++
C++
2
star
20

webrtc-android

WebRTC Android Tutorial
Java
2
star
21

rails-tinder-clone

A Simple Tinder like clone created using Rails
Ruby
1
star
22

gstreamer-samples

Simple repo showing native GStreamer samples
C++
1
star
23

python-leaf-image-generation

Sample Python code that shows how to generate images with the Leaf API
Python
1
star
24

rtmp-to-local

Streaming RTMP stream to local example
C++
1
star
25

webrtc-gstreamer

Sample showing streaming camera with C++, GStreamer
C++
1
star
26

go-crud

Sample CRUD app using Go
Go
1
star
27

android-compose-todo

Simple Todo App created using Android compose
Kotlin
1
star
28

yolonas-object-detect

Object detection on images and videos using the latest YOLO NAS
Python
1
star
29

python-opencv-filters

Project showing some simple opencv/python filters
Python
1
star
30

mediarecorder-localfile-sample

Simple repo demonstrating the use of MediaRecorder API and saving the file locally.
JavaScript
1
star
31

rust-grpc

simple example showing rust and gRPC
Rust
1
star
32

omniauth-amazon-sp

Rails Omniauth Strategy for Amazon Selling Partner API
Ruby
1
star
33

opencv-segmentation

Sample showing image segmentation using opencv
Python
1
star
34

python-text-extraction

Simple Python text extraction using Tesseract OCR
Python
1
star
35

sample-sms

Simple Social media sample created using MERN
JavaScript
1
star