Recording audio and/or video from RSB into a video container file

Pipeline

The following diagram contains a simplified illustration of a minimal GStreamer pipeline that can be used to generate video files from RSB events containing audio and video data. The vorbisenc, theoraenc and oggmux elements can be replaced with different encoders and container multiplexers as required.

rsbaudiosrc--->vorbisenc---+  
                           v
                         oggmux--->filesink
                           ^  
rsbvideosrc--->theoraenc---+   

Scripts

The RSB GStreamer Integration project includes the scripts source:trunk/scripts/record_ogv.sh and source:trunk/scripts/record_mp4.sh in the source:trunk/scripts subdirectory. These scripts allow encoding audio data and video data into a video container file. Both scripts are used as follows:

record_{ogv,mp4}.sh OUTPUTFILE VIDEOSCOPE ( AUDIOSCOPE | _ )

_ can be used to indicate that a particular component should not be recorded.

Example

Assuming audio data and video data have been recorded into a log file named video.tide, this example demonstrates converting the log file into a video container file with encoded audio and video streams.

  1. Start the recording pipeline:
    $ ./record_ogv.sh video.ogv /video/camera1 /audio/mic1
    

    This part of the example assumes an RSB configuration that enables the Spread transport for a Spread daemon listening on port 4803 of localhost.
  1. Replay audio and video data from the log file:
    $ bag-play -r as-fast-as-possible video.tide 'spread://localhost:4803'