SCE Video

   Print  Previous  Next

Functions Provided By SCE Video

The following table provides an overview over all functions the effect provides.
Please note: Certain functions may not work due to restrictions and limitations of the video codec. (E.g. the Forward Backward Loop is only available for the QuickTime codec format.)

 

Function

Description

void SetDirection(int)

Sets the movement direction. Allowed are all directions described by the DIR_ constants. Set DIR_NONE to stop the movement.

int GetDirection()

Gets the current movement direction. Returns DIR_NONE if the movement has been stopped.

int GetPixelImagePositionX()

Returns the current absolute x pixel coordinate of the video.

int GetPixelImagePositionY()

Returns the current absolute y pixel coordinate of the video.

float GetVectorImagePositionX()

Returns the current relative x coordinate of the video.

float GetVectorImagePositionY()

Returns the current relative y coordinate of the video.

void SetPixelImagePosition(int x, int y)

Sets the position of the video in absolute pixel coordinates.

void SetVectorImagePosition(float x, float y)

Sets the position of the video using relative coordinates.

int GetPixelImageWidth()

Returns the width of the current displayed video as absolute pixel value.

int GetPixelImageHeight()

Returns the height of the current displayed video as absolute pixel value.

float GetVectorImageWidth()

Returns the width of the currently displayed video relative to the settings of the current matrix.

float GetVectorImageHeight()

Returns the height of the currently displayed video relative to the settings of the current matrix.

void SetStretch(int enable)

If enable is false, stretch will be disabled. Otherwise, it will be enabled.

int GetStretch()

Returns true if stretch is currently enabled, otherwise false.

void SetTile(int enable)

Disables tile mode of the bitmap effect if enable is set to false. Otherwise, tile mode will be enabled.

int GetTile()

Returns true if the tile mode of the bitmap effect is currently enabled, otherwise false.

void SetGrey(int enable)

Disables grayscale mode if enable is set to false. Otherwise, it will be enabled.

int GetGrey()

Returns true if grayscale mode is currently active, otherwise false.

void SetRgbToRgbw(int enable)

Disables the RGB-to-RGBW mode if enable is set to false. Otherwise, it will be enabled.

int GetRgbToRgbw()

Returns true if the RGB-to-RGBW mode is enabled, otherwise false.

void SetBpm(int bpm)

Sets the speed for the image movement. bpm must be within a range of 0 to 9999 BPM. E.g. a value of 60 means that it is moved one pixel per second into the given direction.

int GetBpm()

Returns the speed for the image movement in BPM.

void SetFilterColor(color col)

Sets the filter color for the effect. Please note that the alpha value of the color structure is not used by this effect.

color GetFilterColor()

Returns the current filter color. Please note that the alpha value is not used and should be ignored.

void SetAutostart(int enable)

Disables auto start if enable is set to false. Otherwise, auto start is enabled.

int GetAutostart()

Returns true if auto start is enabled, otherwise false.

void SetLoop(int mode)

Sets the video playback mode. Valid values are: NO_LOOP (for no loop), F_LOOP (for forward loop), and FB_LOOP (for forward and backward loop).

int GetLoop()

Returns true if loop mode is enabled.

int GetVideoLoaded()

Returns true if a video is already loaded.

int GetCapturing()

Returns true if a capture device, e.g. a web-cam, has been selected for capturing.

int GetVideoRunning()

Returns true if video or capture playback is active, otherwise false.

void StartVideo()

Starts video playback. If a capture device has been selected, capturing is started.

void StopVideo()

Stops video playing. If a capture device has been selected, capturing is stopped.

void SeekVideo(int secs)

Skips some seconds of the current video. secs may be a negative value in order to go back.

time GetVideoLength()

Returns the length of the video as time structure. The structure is filled up with the hours, minutes, and seconds. If no video is loaded or capturing is active, 0 is returned.

void SetVideoTime(time t)

Sets the current time position of the video playback. If no video is loaded, nothing happens. See below for further details.

time GetVideoTime()

Returns the current time of the video playback.

void SetRotation(int angle)

Rotates the video output by multiples of 90°. Valid values for angle are 0, 90, 180, and 270.

int GetRotation()

Returns the current rotation of the video output.

void StartVideoBackward()

Starts playing the video backwards. Only available with QuickTime video files. If a capture device has been selected, this function has no effect.

void SetVideoStartTime(time t)

Sets the start time of the video. The video starts playing from this position.

time GetVideoStartTime()

Returns the position at which the video starts playing.

void SetVideoEndTime(time t)

Sets the end time of the video. The video ends playing at this position.

time GetVideoEndTime()

Returns the position at which the video stops playing.

void SetVideoPlaySpeed(float speed)

Sets the playback speed of the video. Values between 0.1 and 2.0 are allowed. E.g. the value 2.0 means that the video will be running 2x faster than the original speed.

float GetVideoPlaySpeed()

Returns the current video playback speed.

void SetVideoAspectRatio(int mode)

Sets the video aspect ratio. Valid values for mode are: ASPECT_ORIG (for the video original aspect ratio), ASPECT_MATRIX (for the current matrix aspect ratio), ASPECT_4_3 (for 4:3), and ASPECT_16_9 (for an aspect ratio of 16:9).

 

This Effect uses the Color Picker. Learn more about Using Colors.

 

Deprecated Functions
Deprecated functions are outdated functions and should not be used anymore.

Function

Description

void SetMoveSpeed(float speed)

Sets the speed for the video movement. The speed must be given in frames per second. E.g. 2 means that the video will be moved 2 pixels per second. The range is 0 to 166. Please note: This function is deprecated and may be removed in one of the next releases. Use SetBpm instead.

float GetMoveSpeed()

Returns the speed for the video movement in frames per second. Please note: This function is deprecated and may be removed in one of the next releases. Use GetBpm instead.

 

Setting the Time for Video Playback

If a video is loaded that has a length of 2:45:00 the following source code would set the playback position to 1:25:30.

time t = {1, 25, 30};

SetVideoTime(t);

 

Please note: If the given time is higher than the length of the video, the time is set to the end of the video.

(Description)
 

Full Example

The following example moves the video side to side on the matrix.

void InitEffect()

{

 

}

 

void PreRenderEffect()

{

    if(GetDirection() == DIR_LEFT)

    {

        if(GetVectorImagePositionX() <= 0.0)

        {

            SetVectorImagePosition(0.0, GetVectorImagePositionY());

            SetDirection(DIR_RIGHT);

        }

    }

    else if(GetDirection() == DIR_RIGHT)

    {

        if(GetVectorImagePositionX() + GetVectorImageWidth() >= 1.0)

        {

            SetVectorImagePosition(1.0 - GetVectorImageWidth(), GetVectorImagePositionY());

            SetDirection(DIR_LEFT);

        }

    }

    else

    {

        SetDirection(DIR_LEFT);

    }

 

}

 

void PostRenderEffect()

{

 

}