Polybench® Reference
Enables the replay of videos that are stored with the Video Storage.

Video Replay

Overview

Use this operator to replay video sequences in real-time, or at higher or lower speed.

Operator ports

Output Video out: Video frames

Properties

Find more information about changing properties here: link

Alias (stream name)
type: See description
The alias of the video file that is to be re-played. Example: 'Video' (max. 25 characters). The alias may contain variables and/or wildcards.

For more information about stream aliases, please refer to link.
If you select a stream alias here, then AbsolutePath will become empty, because you use either a variable stream alias, or a fixed file path.

AbsolutePath
type: See description
The absolute path to the data file that is to be re-played (press the button to open a file).

This property should contain a valid path to a file, or nothing. If only a directory is specified, '*.*' is added to it.

LoopPlaying
type: True or False
Set to true to indicate that the video should re-start playing after its end has been reached.
Select one of those presets:
True or False
True may also be read like 'yes' and false like 'no'


SyncRate
type: See description
Replay timing synchronization updates per second. The video that is being replayed runs at its own speed, but is synchronized to the Polybench timing at a rate determined by this property.

The ofter the video timing is synchronized with the Polybench timing (which is also the timing of signals that are being replayed), the more precize the video is timed in relation to other signals or videos, but also the less smooth the video may run.

The maximum value you can enter here, depends on the processing power of your PC and the video codecs that are used. Set to a lower frequency (for example 0.5 Hz) for older PCs. Real movie quality frame rate is 25 Hz, any higher values won't make sense, because your eye will never be able to see the difference. This property should not be higher than the video frame rate, because that would not make sense and is inefficient.

If your play speed is less than 100%, then small sections of the video will still be played at its orginal speed, but repeated in order to keep the timing in sync. A similar case occurs when the play speed is greater than 100%. So, video replay works smoothest at 100% play speed.

SyncID
type: See description
If you require the Video Replay to start or stop separately from other objects, you should refer to the Storage with a SyncID. This is a word or number you can think out yourself.

For example, if you require the Video Replay to start on a special command, you would issue a START action with a Value which is the SyncID of the Video Replay operator.
If you have specified a SyncID, and a START Action is issued with another SyncID, then replaying will not start for this operator.
For more information about the behavior of the START, STOP and RESET actions in relation to the SyncID setting, please read more here: link.

FileInformation
type: Undefined [this value cannot be changed]
Shows information about the file itself.


Caption
type: Word or phrase
The name of the object in the project. This name must not contain '.' or '$' characters.

Every object has the Caption property. This property is very important, because it is the name by which Polybench recognizes this object.
It is allowed to give multiple objects the same name, as long as the objects are of the same type. In that case, a reference to this caption includes all the objects with the same caption.
In Polybench, every object can be addressed by an Address specifier, which starts with the dollar sign, for example: $My Page.My Object. 'My Page' would be the Caption of a page, and 'My Object' the Caption of an object on that page.

Documentation
type: See description
Optional documentation of this object.

It is good practice to write in short notes why you have used this object, and why its properties are set the way they are set. If this object is an operator, the Documentation text is displayed below the operator symbol.

Variable Parameters

Find more information about Variable Parameters here: link

StreamAlias
type: See description
The alias of the data stream that is to be re-played. Example: 'ECG' (max. 25 characters). This is the same item as the Alias property.

For more information about stream aliases, please refer to link.
If you select a stream alias here, then AbsolutePath will become empty, because you use either a variable stream alias, or a fixed file path.

StreamAliasSelect
type: Parameter list (see link)
The alias of the data stream that is to be re-played. Use this parameter as address in a Drop-Down box.

If you select a stream alias here, then AbsolutePath will become empty, because you use either a variable stream alias, or a fixed file path.

AbsolutePath
type: See description
The absolute path to the data file that is to be re-played.

This property should contain a valid path to a file, or nothing.
If you select a file here, then StreamAlias will become empty, because you use either a variable stream alias, or a fixed file path.

TimeOffset
type: See description
Number of seconds that the time of video frames should differ from other signals. This adds a negative or positive time offset to the video frames at the output, compared to other data sources.

From a live video source, the time difference between the video and another data display cannot be adjusted. But if the video is then replayed using the Video Replay, the time difference can be changed using this property.

A time difference relative to other data sources in replay mode, may have come to exist while recording the live data. Different devices have different start-up times and transmission delays. Those delays are also stored to the measurement file, so that when replayed, the time differences still exist.

It is not possible for Polybench to tell exactly which video frame belongs to a sample of another data source. The user has to set this time difference himself, by changing this property.

FileCaption
type: See description
The caption or friendly name of the file. Sometimes this is equal to the path or file name. It depends on the file format if the file has a friendly name at all.


FileDate
type: See description
The date of the recording (or the file).

Some file formats explicitly record the file start date and time. In that case, this date is returned here.
If a file format does not record this information (for example a CSV file does not), then the date and time of the file as known to Windows is taken.

StartTime
type: See description
The time the recording was started, or the time the file was created.

Some file formats explicitly record the file start date and time. In that case, this time is returned here.
If a file format does not record this information (for example a CSV file does not), then the date and time of the file as known to Windows is taken.

FileLength
type: See description
The length of the current file in a time format.


FileLengthSeconds
type: See description
The length of the current file in seconds.


ChannelCount
type: See description
The number of signal channels in the current file.


FileType
type: See description
The type of the current file. Polybench automatically finds the correct file format of the file, which is indicated by this description.


FileName
type: See description
The name of the current file without extensions.


FileExtension
type: See description
The extension of the current file.


FileSecondExtension
type: See description
The second extension of the current file, if the file name has a double extension. Polybench commonly interprets the second extension of a file name as the 'alias', which is a identifier for the same kind of recordings (see link).

Functions

Find more information about Functions here: link

Pause
Pauses play back.

Continue
Continues play back after calling the Pause function.

Details

The Video Replay operator is typically used in applications that do post-processing of video data. The Video Replay is able to re-play video files at their original speed or - with limitations - at a higher or lower speed.

The Video Replay is also able to provide video reviewers with stored video frames, like the Video Storage operator (link) can do. This means that you can connect a live video viewer as well as a stored video reviewer at the same output. Note that if you intend to do video frame reviews, that you should not start the Video Replay, otherwise the video will be played (also in a video reviewer).

A video file can be replayed at another rate as it was originally stored. To change the replay speed (make it play slower or faster), change the Speed setting in the Polybench designer (see the Play/Stop bar on top of the screen) or use the SPEED action (link). The video itself will also be played in its original speed, so if you change the play speed in Polybench, the video replay will not be as smooth as at 100% play speed. Use the SyncRate property to adjust time synchronization updates.

Video Replay can halted and continued shortly by using the Pause and Continue functions. Use the FUNCTION action to control those functions.

How to specify the file to replay

The Video Replay can play videos from a file that is specified with an absolute path to a disk location, or it can play a video file by using a Stream Alias (link) that is recognized by the Data Manager. The first method is more appropriate for demo purposes, the second is the prefered choice for post-processing applications.

Which video formats the Video Replay operator is able to replay, depends on the file interpreters that are installed on your Polybench system. The Video Replay does not suggest any file types. If you select a file, then the Video Replay tries to interpret the file using all the installed file interpreters. If that fails, the Video Replay shows nothing at its output or a warning pops up if you try to play the file.

Load a video at start-up of Polybench

It is possible to load a video file into the Video Replay immediately after an application is started up. For this functionality, you should specify in AbsolutePath a global variable that is set by an argument of Polybench.exe. Here are the steps to follow:

- make an application that uses a Video Replay.
- in the Video Replay property 'AbsolutePath' specify a global variable, for example the reserved variable $data$ (see also link).
- Save the project and close Polybench.
- Now open Polybench.exe with at least two arguments: one to open the project and one to specify the file in $data$. You can do this in a batch file, if you like, or you can also do this in the Data Manager, by specifying the project in the Application Start-up dialog (link). In that case the project is specified automatically.

In a batchfile, the start command could look like this:
Polybench.exe /program:"C:\Apps\My Replay Test App.xmc" /data:"C:\Data\MyRecording1.csv".

Now, the $data$ variable contains the path "C:\Data\MyRecording1.csv". The File Replay replaces the $data$ variable with its value, so that the AbsolutePath property now contains this path - the file is loaded!