<video> ‐ A video film
Name | Type | Defaults |
---|---|---|
id | ID | None (required) |
xlink:href | URI | None (required) |
type | STRING | None (required) |
begin | FLOAT | None (required for videoloop) |
end | FLOAT | None (required for videoloop) |
duration | FLOAT | None (required for videoloop) |
period | FLOAT | None (required for videoloop) |
offset_s | FLOAT | 0.0 |
offset_t | FLOAT | 0.0 |
tile_s | FLOAT | 1.0 |
tile_t | FLOAT | 1.0 |
live_video_w | INTEGER | 640 |
live_video_h | INTEGER | 480 |
deinterlace | BOOLEAN | false |
This element defines a video film for the material properties of a node. The video film is read by the ffmpeg library http://ffmpeg.sourceforge.net/. The texture coordinates and attributes (such as offset and coordinate scaling) are used to map the video frames on the geometry.
The external file reference, given by the xlink:href attribute, defines the URI reference (Uniform Resource Identifier) of the video file that is read by the ffmpeg library. The string value of the type attribute is equal to videofinite in the case of a unique video that is only played once and to videoloop in the case of a repeated video.
The float values begin and end of the begin and end attributes define the maximal time interval during which the video is played. Playing starts at begin time and the video source is stopped at end time. In case of a repeated video, the period value of the float attribute period is used to define the intervals at which the video source is restarted. The video source is periodically restarted at begin+n×period for n in 1, 2,...,N. N is the the largest integer smaller than or equal to (end-begin)/period. The duration value of the float attributes duration must be smaller than or equal to period; it defines the video playing time during each period.
The float values of the tile_s and tile_t attributes are used to control how many times the texture is repeated on the surface. If both attributes have the default value 1.0, a single copy of the texture appears on the surface. The float values of the offset_s and offset_t attributes control the values that should be added to the coordinate textures defined on the geometric primitive to obtain the actual texture coordinates used to render the texture. The formula that relates the actual coordinates to the geometrical coordinates is the following
The string value of the video_source attributes represents the source of the video material element. If it is equal to videolive, the video is captured from the live video driver (for exemple a webcam). Otherwise, if the value of the video_source is equal to videofile the video is a prerecorded medium such as a DivX avi film.
In case of live video, the integer value X of the id_video_live attribute refers to the device used to capture the live video: /dev/videoX on Linux or capture devine #X on Windows. In the case of a Linux system, the live video device can also be stated explicitely by providing its id /dev/videoX in the URI reference value of the xlink:href attribute.
The integer values of the live_video_w and live_video_h attributes define the height and width (in pixels) of a live video stream.
None.
The example below defines a video with associated video file ../Video/videos/Sceines-512.9.avi. Since it is a repeated video of duration 10 and period 20, it will be played on the following intervals: [0,10], [20,30], and [40,50]... The video is displayed on a quad. There is no offset for texture coordinates, and second coordinates are inverted for an horizontal symmetry of the image. The video is deinterlaced.
<node id="film.9quad"> <quad id="screen" x1="-7.68" y1="0.0" z1="-10.24" x2="-7.68" y2="0.0" z2="10.24" x3="7.68" y3="0.0" z3="10.24" x4="7.68" y4="0.0" z4="-10.24"> <video xlink:href="../Video/videos/Sceines-512.9.avi" id="Wall" type="videoloop" begin="0.0" end="1000.0" dur="10.0" period="20.0" tile_s="(320/512)" tile_t="(240/256)" deinterlace="true" /> </quad> </node>
The example below defines a live video with associated video device #1. For live video, the type attribute is necessarily videofinite (there is no possible repetion on a live video and videoloop type will be ignored).
<video video_source="videolive" id_live_video="1" id="Wall" type="videofinite" begin="0" end="100000" dur="100000" tile_s="(640/1024)" tile_t="(480/512)"/>