Movie recorder for writing video files to disk.
More...
#include <cvb/movie2/recorder.hpp>
Movie recorder for writing video files to disk.
- Example:
Cvb::String path(Cvb::ExpandPath(CVB_LIT(
"%CVB%Tutorial\\ClassicSwitch.emu")));
auto stream = device->Stream();
stream->Start();
for (int i = 0; i < 100; ++i)
{
recorder->Write(*waitResult.Image);
}
recorder.reset();
stream->Stop();
static std::shared_ptr< T > Open(const String &provider, AcquisitionStack acquisitionStack=AcquisitionStack::PreferVin)
Opens a device with the given provider with its default board and port (if applicable).
Definition: decl_device_factory.hpp:50
static std::unique_ptr< Recorder > Create(const String &path, Size2D< int > size, RecorderPixelFormat pixelFormat, const RecordingSettings &settings)
Creates a recorder object writing video streams with the given pixel format and recording engine.
Definition: recorder.hpp:96
@ Mono
Recorder writes single-plane monochrome data.
@ Timeout
A timeout occurred, no image buffer has been returned.
◆ Create() [1/2]
Creates a recorder object writing video streams with the given pixel format. Uses the DirectShowEngine per default.
- Parameters
-
[in] | path | Path to write avi container to. |
[in] | size | Size of the video frames in pixels. |
[in] | pixelFormat | Defines whether mono or color images are written. |
- Returns
- Pointer to recorder object.
- Exceptions
-
◆ Create() [2/2]
Creates a recorder object writing video streams with the given pixel format and recording engine.
- Parameters
-
[in] | path | Path to write avi container to. |
[in] | size | Size of the video frames in pixels. |
[in] | pixelFormat | Defines whether mono or color images are written. |
[in] | settings | Recorder settings to use for the recording engine. |
- Returns
- Pointer to recorder object.
- Exceptions
-
- Examples
- Movie2/QtMovie2.
◆ FromHandle()
Creates a recorder from a classic API handle.
- Parameters
-
[in] | guard | Life time guard for C-API handle. |
- Returns
- The classifier created from the classic API handle.
- Exceptions
-
The classifier takes ownership of the handle, so you must share it before using this function.
◆ Handle()
Classic API classifier handle.
- Returns
- Classic API handle.
- Exceptions
-
Does | not throw any exception. |
It is normally not necessary to work with this handle.
◆ Write()
Writes the given image into the stream.
- Parameters
-
[in] | image | Image to write into the stream. |
[in] | metaData | Metadata text to write into the stream (must be ASCII). |
- Exceptions
-