Media Plugin¶
Overview¶
The media plugin (MediaPlugin) is a plugin for playing various media files such as video and audio on Choreonoid. Media files can be loaded as items and played back in synchronization with the time bar. This makes it possible, for example, to check a video recording of an experiment in synchronization with simulation results.
This plugin makes the following items and view available.
Media item (MediaItem)
An item corresponding to media files such as videos. Load it from the main menu with “File” - “Load” - “Media file”. Loaded media are played back in synchronization with the time bar operations.
Audio item (AudioItem)
An item corresponding to audio files. Load it from the main menu with “File” - “Load” - “Audio File”. The supported file formats are WAV (.wav) and Ogg (.ogg). These are also played back in synchronization with the time bar.
Media view (MediaView)
A view that displays the videos of media items. It can be shown from the main menu with “View” - “Show View” - “MediaView”. When you operate the time bar with a media item loaded, the images of the corresponding time are displayed in this view.
Item Properties¶
The following properties are available in the media item.
Property |
Default value |
Meaning |
|---|---|---|
uri |
— |
The URI of the media. When loaded from a file, it indicates the location of the file. |
offset |
0.0 |
The offset of the playback time [s]. The playback timing of the media can be shifted by the specified time relative to the time bar time. |
The following properties are available in the audio item. Only offset can be configured; the others are the display of the information obtained from the loaded audio file.
Property |
Default value |
Meaning |
|---|---|---|
title |
— |
The title information recorded in the audio file. |
length |
— |
The time length of the audio data [s]. |
offset |
0.0 |
The offset of the playback time [s]. The playback timing of the audio can be shifted by the specified time relative to the time bar time. |
channels |
— |
The number of channels of the audio data. |
sampling rate |
— |
The sampling rate of the audio data [Hz]. |
copyright / artists / comment / date |
— |
Displayed when these pieces of meta information are recorded in the audio file. |
How to Build¶
This plugin can be built by turning ON the CMake option BUILD_MEDIA_PLUGIN.
On Ubuntu, the playback functionality is implemented using libraries such as GStreamer, and the required packages are installed by the package installation script of Choreonoid.
On Windows, the standard media playback functionality of the OS is used. Some media file formats, such as MPEG-4 files, cannot be played by default, but such files may become playable by installing a codec pack that supports the format. Please use one that suits your system.
How to Use¶
By loading the above items into a project and playing / seeking with the time bar, the videos and audio are played back in synchronization with other time-series data such as simulation results. To check videos, also show the media view.