General purpose replay
Complementing visionx::record
, this MR introduces the VisionX core functionality of replaying any image sequences (chunked image sequences, legacy or primitive image sequences, video files) in visionx::playback
.
This MR also introduces a new component utilising the new core functionality, the PlaybackImageProvider
, which is able to replay single or multi-channel recordings with the aim of eventually deprecating the ImageSequenceImageProvider
or the VideoFileImageProvider
. It was designed to minimise configuration efforts and does therefore not offer as much configuration options as the other two.
-
To playback a video file, for example
/path/to/vid.avi
, it is enough to set therecording_files
property to/path/to/vid.avi
. -
If you want to playback a stereo image sequence recording, for example
/path/to/vid/frame_right_*.jpg
and/path/to/vid/frame_left_*.jpg
, you can setrecording_files
to/path/to/vid/frame_right_*.jpg;/path/to/vid/frame_left_*.jpg
, or/path/to/vid/frame_right*jpg;/path/to/vid/frame_left*jpg
, or/path/to/vid/frame_right_*;/path/to/vid/frame_left_*
, or anything else uniquely identifying the frames of the left and right camera. The ";" character is used to separate the channels. -
If the frames are split into distinct directories, like:
/path/to/vid/right/frame_*.jpg
and/path/to/vid/left/frame_*.jpg
: Setrecording_files
to/path/to/vid/right/frame_*.jpg;/path/to/vid/left/frame_*.jpg
. You can also set thebase_path
property, so that the paths inrecording_files
will be interpreted relative to that path:base_path
=/path/to/vid/
andrecording_files
=left;right
-
The number of channels is not limited - paths are separated by ";" =>
recording_files
=source1;source2;source3;...;source_n
. -
The order of
recording_files
is considered, so changingrecording_files
=source1;source2
tosource2;source1
will swap the channels. -
Other options are:
loop
(set to true to loop the playback, false otherwise),fps_lock
(lock the FPS to that amount, ignoring what was derived from metadata or guessed),fps_multiplier
(speed up (value > 1) or slow down (value < 1) the recording)
Please note: The ImageMonitor
GUI plugin is not designed with changing amounts of image sources in mind, and I also do not think it is worth the effort to make it aware of that (I cannot even think of a use case). This just means that if you have an ImageMonitor connected, and you change the number of channels, the ImageMonitor may segfault.
Other changes:
- Use
boost::filesystem
instead of POSIX (boost::filesystem
is API-compatible to C++17std::filesystem
(and C++14std::experimental::filesystem
) (this implies breaking API changes invisionx::record
, even though they are trivially resolved and no one depends on it yet anyway) - Add default constructors for
visionx::record
strategies - Remove padding from chunked image sequences for recording (no reason to do so, and it just restricts the recording because the number of frames is not known in advance)