<shader_source_video> ‐ A video film used by shader programs
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) |
video_source | STRING | videofile |
id_video_live | INTEGER | 0 |
live_video_w | INTEGER | 640 |
live_video_h | INTEGER | 480 |
This element defines a video film that is used by a shader and defined as a child element of the shader_source element. 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 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/skin.avi. Since it is a repeated video with duration, period, and end values much larger than film duration, the film will be indefinitely repeated.
<shader_source_video index="1" video_source="videofile" xlink:href="Video/skin.avi" type=id="Wall" type="videoloop" begin="0.0" end="1000000.0" dur="1000000.0" period="1000000.0" />
The example below defines a live video with associated video device #0. For live video, the type attribute is necessarily videofinite (there is no possible repetion on a live video and videoloop type will be ignored).
<shader_source_video index="1" video_source="videolive" id_live_video="0" id="Wall" type="videofinite" begin="0" end="100000" dur="100000" tile_s="(640/1024)" tile_t="(480/512)" deinterlace="true"/>