Overview

As you develop applications that leverage Vidyo.io, you may want to include a feature for recording and distributing recordings for private or public viewing. By integrating the Media Bridge Docker image with your Vidyo application, you can record and distribute your Vidyo conferences.

What's Docker?

Docker is a robust software container platform you install on a dedicated server and use to run the Media Bridge image. The Media Bridge image provides record/playback functionality you might want to integrate with your Vidyo.io-based application. Docker provides the thorough resources and documentation you need to integrate basic or extensive Media Bridge features. See the Docker Overview here.

What's Media Bridge?

Media Bridge is a Docker image providing the functionality for recording and distributing video conferences accessed using your Vidyo.io-based application. From Docker, you pull the Media Bridge image, create a config file, create a container, drop in your config file, then start recording.

Before You Begin

Before you begin, ensure that your Linux server is configured with a running Docker Engine.

What you will need

Server platforms other than Ubuntu Linux 14.04+ have not been tested; they might not run smoothly or predictably in your deployment.

Set-up

To set up your server with Media Bridge for managing video conference recordings, follow these steps:

        1. Install the Media Bridge docker image:
          docker pull vidyo/mediabridge
        2. Create a recording configuration file (see Recording Configuration File).
        3. Create a container from the Media Bridge image:
          docker run -d --name my_recorder vidyo/mediabridge
        4. Copy your config file to the container:
          docker cp config my_recorder:/opt/vidyo

Start a Recording

To start the container, enter:

docker exec -d my_recorder /opt/vidyo/record

Monitor a Recording

To monitor the recording, enter:

docker inspect -f {{.State.Running}} "my_recorder"

The container my_recorder returns false when the recording ends.

Stop a Recording

The recording stops automatically when the last participant leaves the room.

To force the recording to stop with a SIGINT call, enter:

docker exec my_recorder pkill -x --signal INT call

Retrieve a Recording

By default, the recording is saved to a file named recording.flv at this path:
/opt/vidyo folder

To retrieve the recording, enter:

docker cp my_recorder:/opt/vidyo/recording.flv $HOME

To override this, use the destination option described in the Recording Configuration File Options table below.

Troubleshooting

        • If you encounter a problem, retrieve the log file gw.log from the container at this path and use it to troubleshoot:
          /var/log
        • You can enable full logging by adding sdklog="-sdklog on" to the recording configuration file.

Resource Requirements

To ensure Media Bridge has sufficient resources for smooth HD streaming and playback, use the following CPU and memory reservation guidelines.

Resolution (fps) CPU [GHz] RAM [GB]
HD @ 720p (30) 2.2 2
HD @ 1080p (30) 4.0 4

Recording Configuration File

The recording configuration file is a plain text file with key-value pairs. Name this file config and place it at this path:
/opt/vidyo

Each key-value pair must be on a separate line.

The key is separated from the value with an equal (=) sign only; do not use spaces in key-value pairs.

Use a # before comments; text appearing on a line after a # is ignored at runtime.

The following table describes the options available for the recording configuration file.

Recording Configuration File Options
Option Description
width The width of the video stream.
height The height of the video stream.
fps The frame rate of the video stream in frames per second.
kbps The bandwidth of the recording in kilo-bits per second.
layout Set to 1 for a basic layout, set to 2 for a presenter layout, where the current speaker occupies a larger tile than the rest, set to 3 for a film strip layout, where the current speaker occupies most of the screen and other participants appear in a film strip at the bottom.
maxParticipants The maximum number of participants to be rendered in the video stream.  Minimum is 1, maximum is 8.
overlay When set to 1, Media Bridge displays each participant's name as an overlay in the video stream.
presentationAllowed When set to 0, Media Bridge ignores presentations during the conference. When set to 1, Media Bridge records presentations instead of the main video streams.
presWidth The maximum width of the presentation stream.
presHeight The maximum height of the presentation stream.
presFps The frame rate of the presentation stream in frames per second.
presKbps The bandwidth used for the presentation stream in kilo-bits per second.
destination

This can be a file name, a folder name (preceded by flv:) or an RTMP URI (preceded by rtmp:).

        • When you set this field to a folder name, Media Bridge randomly generates the file name. This directs the recording to a central storage location you mount inside the docker container (use the -v option).
        • When you set this field to an RTMP URI, Media Bridge streams the recording to that destination. No permanent record is stored.
resourceId The vidyo.io resource to connect to and record.
token The access token to the vidyo.io system.
host The vidyo.io host name to connect to. Make sure that this host name can be resolved inside your container. This can be done using the --add-host parameter when creating the container.

Sample Configuration File

#main video settings
width=1280
height=720
fps=30
kbps=2000
layout=1
maxParticipants=8
overlay=1

#Presentation settings
presentationAllowed=1 #0 - ignore presentations 1 - replace main video with presentation
presWidth=1280
presHeight=720
presFps=5
presKbps=300
destination="flv:/opt/vidyo/recording.flv"

#vidyo.io connection info
resourceId="my_room"
token="cHJvdmlzaW9uAHVzZXIwQGRlZmF1bHQuZGVmYXVsdC5jb20ANjQ4NzU0NjY0NjIAPHZDYXJkIHhtbG5zPSd2Y2FyZC10ZW1wJz48Rk4+RnVsbCBVc2VybmFtZTA8L0ZOPjxOSUNLTkFNRT51c2VyMDwvTklDS05BTUU+PC92Q2FyZD4AOWRiN2QxN2ZjMTNiOTc2ZTIxZjcwMjY4NmNjNzdkMzEwOTM2ODBkOTk3ZWJhN2Y2OTQ1ZmEwNTA5Njc4MWZlOTU1YTlmM2M4ODExNGQ5YzIwMjFhNjhlNmJlOGMwMmY1"
host="prod.vidyo.io"
Was this article helpful?
1 out of 1 found this helpful

0 Comments

Follow
Please sign in to leave a comment.