RecordText » History » Version 1

J. Moringen, 11/24/2011 01:56 AM
initial version

1 1 J. Moringen
h1. Augmenting Audio/Video Recordings with Text Overlays
2 1 J. Moringen
3 1 J. Moringen
{{>toc}}
4 1 J. Moringen
5 1 J. Moringen
_This description extends [[RecordAudioVideo|the description of audio/video recording]]._
6 1 J. Moringen
7 1 J. Moringen
h2. Pipeline
8 1 J. Moringen
9 1 J. Moringen
The following diagram contains a simplified illustration of a minimal GStreamer pipeline that can be used to generate videos with text overlays from RSB events. The @vorbisenc@, @theoraenc@ and @oggmux@ elements can be replaced with different encoders and container multiplexers as required.
10 1 J. Moringen
<pre>
11 1 J. Moringen
rsbaudiosrc------------------->vorbisenc---+  
12 1 J. Moringen
                                           v  
13 1 J. Moringen
rsbvideosrc--------+                     oggmux--->filesink
14 1 J. Moringen
                   v                       ^
15 1 J. Moringen
            subtitleoverlay--->theoraenc---+   
16 1 J. Moringen
                   ^
17 1 J. Moringen
rsbtextsrc---------+
18 1 J. Moringen
</pre>
19 1 J. Moringen
20 1 J. Moringen
h2. Script
21 1 J. Moringen
22 1 J. Moringen
The project:rsb-gstreamer projects includes the script source:trunk/scripts/record_subtitles.sh in the source:trunk/scripts subdirectory. This script is sufficient for cases in which audio data, video data and a single text overlay should be renderer into a video container file. The script is used as follows:
23 1 J. Moringen
24 1 J. Moringen
<pre>
25 1 J. Moringen
record_subtitles.sh OUTPUTFILE VIDEOSCOPE ( AUDIOSCOPE | _ ) ( TEXTSCOPE | _ )
26 1 J. Moringen
</pre>
27 1 J. Moringen
28 1 J. Moringen
@_@ can be used to indicate that a particular component should not be recorded.
29 1 J. Moringen
30 1 J. Moringen
h2. Example
31 1 J. Moringen
32 1 J. Moringen
Assuming audio data, video data and some sort of textual controller state messages have been [[rsbag:bag-record|recorded]] into a logfile named @state_transitions.tide@, this example demonstrates overlaying the video with the textual controller state messages.
33 1 J. Moringen
34 1 J. Moringen
# Start the recording and overlay rendering pipeline:
35 1 J. Moringen
<pre>
36 1 J. Moringen
$ ./record_subtitles.sh state_visualization.ogv /video/camera1 /audio/mic1 /controller/states
37 1 J. Moringen
</pre>
38 1 J. Moringen
_This part of the example assumes an [[rsb:Configuration|RSB configuration]] that enables the Spread transport for a Spread daemon listening on port @4803@ of @localhost@._
39 1 J. Moringen
40 1 J. Moringen
# Replay audio, video and text data from a suitable log file:
41 1 J. Moringen
<pre>
42 1 J. Moringen
$ bag-play -r as-fast-as-possible state_transitions.tide 'spread://localhost:4803'
43 1 J. Moringen
</pre>