Impact Acquire SDK Python
|
A class to create compressed video stream from images captured or loaded using the Impact Acquire API. More...
Public Member Functions | |
__init__ (self, *args) | |
Creates a new video stream file. | |
getCodec (self) | |
Returns the codec used by this video stream. | |
getCodecAsString (self, *args) | |
Returns the a string representation for a video codec. | |
getFileName (self) | |
Returns the file name of this video stream. | |
isPaused (self) | |
Checks is this video stream is currently paused. | |
pause (self) | |
Pauses this video stream. | |
resume (self) | |
Resumes this video stream. | |
saveImage (self, *args) | |
Stores an image into the video stream. | |
Static Public Member Functions | |
isAPIAvailable () | |
Checks if the video stream API is available. | |
Properties | |
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") | |
A class to create compressed video stream from images captured or loaded using the Impact Acquire API.
This class heavily depends on the FFmpeg project (see FFmpeg). Without the libraries belonging to this project being present on the target system video streams cannot be created.
Because of what is stated in the above section Impact Acquire is NOT shipped with the FFmpeg binaries required to use this class!
On Windows the FFmpeg-share package matching the platform the application shall run with (32- or 64-bit) is needed. This can either be extracted into the installation folder of Impact Acquire e.g. into $(MVIMPACT_ACQUIRE_DIR)/Toolkits/ffmpeg-4.2.2-win64-shared or $(MVIMPACT_ACQUIRE_DIR)/Toolkits/ffmpeg-4.2.2-win32-shared (Works only for this versions) OR at the location pointed to by MVIMPACT_ACQUIRE_FFMPEG_DIR (see below) OR anywhere into the systems search path.
On Linux the package ffmpeg must be installed and if e.g. H.264 support is needed the libavcodec-extra package as well.
Impact Acquire is capable of communicating with FFmpeg 4.x right now. This means that the following libraries will be recognized:
In order to load the FFmpeg libraries from a custom location the environment variable MVIMPACT_ACQUIRE_FFMPEG_DIR can be defined before creating the first mvIMPACT.acquire.labs.VideoStream instance after loading the mvDeviceManager library into the current processes address space. Without this environment variable only the systems default search path will be used to locate it and (Windows only) the Toolkits folder of the installation directory. This is how the search algorithm will operate:
__init__ | ( | self, | |
* | args ) |
Creates a new video stream file.
OVERLOAD 1:
fileName | [in] The name or full path of the file to create. The recommended file extensions for files can be found where the mvIMPACT.acquire.TVideoCodec enumeration is documented |
pBuffer | [in] An image buffer containing the layout of the images that are about to get stored in the stream. This structure can be extracted from a real mvIMPACT.acquire.Request object captured previously but NOT by calling the mvIMPACT.acquire.FunctionInterface.getCurrentCaptureBufferLayout function after setting up the device completely.The latter one will not contain all the information needed for a successful stream creation. You could even create a stream from a list of files e.g. on a hard-disk using the mvIMPACT.acquire.ImageBufferDesc constructor accepting a file name. If you want to use the mvIMPACT.acquire.Request object obtained from a call to mvIMPACT.acquire.FunctionInterface.getCurrentCaptureBufferLayout use the constructor accepting a mvIMPACT.acquire.Request pointer! |
codec | [in] The codec that shall be used while encoding the images into the stream. |
quality_pc | [in] The quality of the resulting video stream in percent. The higher this value the larger the file will get. This value is only taken into account for the following codecs: mvIMPACT.acquire.vcH264, mvIMPACT.acquire.vcH265. |
bitrate | [in] The bitrate of the resulting video stream in kBit/s. The higher this value the larger the file will get. This value is only taken into account for the following codecs: mvIMPACT.acquire.vcMPEG2. |
OVERLOAD 2: Creates a new video stream file.
fileName | [in] The name or full path of the file to create. The recommended file extensions for files can be found where the mvIMPACT.acquire.TVideoCodec enumeration is documented |
imageWidth | [in] The input image width in pixels |
imageHeight | [in] The input image height in pixels |
codec | [in] The codec that shall be used while encoding the images into the stream. |
quality_pc | [in] The quality of the resulting video stream in percent. The higher this value the larger the file will get. This value is only taken into account for the following codecs: mvIMPACT.acquire.vcH264, mvIMPACT.acquire.vcH265. |
bitrate | [in] The bitrate of the resulting video stream in kBit/s. The higher this value the larger the file will get. This value is only taken into account for the following codecs: mvIMPACT.acquire.vcMPEG2. |
OVERLOAD 3: Creates a new video stream file.
fileName | [in] The name or full path of the file to create. The recommended file extensions for files can be found where the mvIMPACT.acquire.TVideoCodec enumeration is documented |
imageWidth | [in] The input image width in pixels |
imageHeight | [in] The input image height in pixels |
codec | [in] The codec that shall be used while encoding the images into the stream. |
quality_pc | [in] The quality of the resulting video stream in percent. The higher this value the larger the file will get. This value is only taken into account for the following codecs: mvIMPACT.acquire.vcH264, mvIMPACT.acquire.vcH265. |
bitrate | [in] The bitrate of the resulting video stream in kBit/s. The higher this value the larger the file will get. This value is only taken into account for the following codecs: mvIMPACT.acquire.vcMPEG2. |
OVERLOAD 4: Creates a new video stream file.
fileName | [in] The name or full path of the file to create. The recommended file extensions for files can be found where the mvIMPACT.acquire.TVideoCodec enumeration is documented |
imageWidth | [in] The input image width in pixels |
imageHeight | [in] The input image height in pixels |
codec | [in] The codec that shall be used while encoding the images into the stream. |
quality_pc | [in] The quality of the resulting video stream in percent. The higher this value the larger the file will get. This value is only taken into account for the following codecs: mvIMPACT.acquire.vcH264, mvIMPACT.acquire.vcH265. |
bitrate | [in] The bitrate of the resulting video stream in kBit/s. The higher this value the larger the file will get. This value is only taken into account for the following codecs: mvIMPACT.acquire.vcMPEG2. |
OVERLOAD 5: Creates a new video stream file.
fileName | [in] The name or full path of the file to create. The recommended file extensions for files can be found where the mvIMPACT.acquire.TVideoCodec enumeration is documented |
imageWidth | [in] The input image width in pixels |
imageHeight | [in] The input image height in pixels |
codec | [in] The codec that shall be used while encoding the images into the stream. |
quality_pc | [in] The quality of the resulting video stream in percent. The higher this value the larger the file will get. This value is only taken into account for the following codecs: mvIMPACT.acquire.vcH264, mvIMPACT.acquire.vcH265. |
bitrate | [in] The bitrate of the resulting video stream in kBit/s. The higher this value the larger the file will get. This value is only taken into account for the following codecs: mvIMPACT.acquire.vcMPEG2. |
OVERLOAD 6: Creates a new video stream file.
fileName | [in] The name or full path of the file to create. The recommended file extensions for files can be found where the mvIMPACT.acquire.TVideoCodec enumeration is documented. |
pRequest | [in] A mvIMPACT.acquire.Request object carrying the image related information that are about to get stored in the stream. This can either be extracted from a real mvIMPACT.acquire.Request object captured previously or by calling the mvIMPACT.acquire.FunctionInterface.getCurrentCaptureBufferLayout function after setting up the device completely. To create a stream from a list of files e.g. on a hard-disk use the mvIMPACT.acquire.labs.VideoStream constructor accepting a mvIMPACT.acquire.ImageBufferDesc instead! Create instances of b mvIMPACT.acquire.ImageBufferDesc objects from files call the mvIMPACT.acquire.ImageBufferDesc constructor accepting a file name. |
codec | [in] The codec that shall be used while encoding the images into the stream. |
quality_pc | [in] The quality of the resulting video stream in percent. The higher this value the larger the file will get. This value is only taken into account for the following codecs: mvIMPACT.acquire.vcH264, mvIMPACT.acquire.vcH265. |
bitrate | [in] The bitrate of the resulting video stream in kBit/s. The higher this value the larger the file will get. This value is only taken into account for the following codecs: mvIMPACT.acquire.vcMPEG2. |
OVERLOAD 7: Creates a new video stream file.
fileName | [in] The name or full path of the file to create. The recommended file extensions for files can be found where the mvIMPACT.acquire.TVideoCodec enumeration is documented. |
pRequest | [in] A mvIMPACT.acquire.Request object carrying the image related information that are about to get stored in the stream. This can either be extracted from a real mvIMPACT.acquire.Request object captured previously or by calling the mvIMPACT.acquire.FunctionInterface.getCurrentCaptureBufferLayout function after setting up the device completely. To create a stream from a list of files e.g. on a hard-disk use the mvIMPACT.acquire.labs.VideoStream constructor accepting a mvIMPACT.acquire.ImageBufferDesc instead! Create instances of b mvIMPACT.acquire.ImageBufferDesc objects from files call the mvIMPACT.acquire.ImageBufferDesc constructor accepting a file name. |
codec | [in] The codec that shall be used while encoding the images into the stream. |
quality_pc | [in] The quality of the resulting video stream in percent. The higher this value the larger the file will get. This value is only taken into account for the following codecs: mvIMPACT.acquire.vcH264, mvIMPACT.acquire.vcH265. |
bitrate | [in] The bitrate of the resulting video stream in kBit/s. The higher this value the larger the file will get. This value is only taken into account for the following codecs: mvIMPACT.acquire.vcMPEG2. |
OVERLOAD 8: Creates a new video stream file.
fileName | [in] The name or full path of the file to create. The recommended file extensions for files can be found where the mvIMPACT.acquire.TVideoCodec enumeration is documented. |
pRequest | [in] A mvIMPACT.acquire.Request object carrying the image related information that are about to get stored in the stream. This can either be extracted from a real mvIMPACT.acquire.Request object captured previously or by calling the mvIMPACT.acquire.FunctionInterface.getCurrentCaptureBufferLayout function after setting up the device completely. To create a stream from a list of files e.g. on a hard-disk use the mvIMPACT.acquire.labs.VideoStream constructor accepting a mvIMPACT.acquire.ImageBufferDesc instead! Create instances of b mvIMPACT.acquire.ImageBufferDesc objects from files call the mvIMPACT.acquire.ImageBufferDesc constructor accepting a file name. |
codec | [in] The codec that shall be used while encoding the images into the stream. |
quality_pc | [in] The quality of the resulting video stream in percent. The higher this value the larger the file will get. This value is only taken into account for the following codecs: mvIMPACT.acquire.vcH264, mvIMPACT.acquire.vcH265. |
bitrate | [in] The bitrate of the resulting video stream in kBit/s. The higher this value the larger the file will get. This value is only taken into account for the following codecs: mvIMPACT.acquire.vcMPEG2. |
OVERLOAD 9: Creates a new video stream file.
fileName | [in] The name or full path of the file to create. The recommended file extensions for files can be found where the mvIMPACT.acquire.TVideoCodec enumeration is documented. |
pRequest | [in] A mvIMPACT.acquire.Request object carrying the image related information that are about to get stored in the stream. This can either be extracted from a real mvIMPACT.acquire.Request object captured previously or by calling the mvIMPACT.acquire.FunctionInterface.getCurrentCaptureBufferLayout function after setting up the device completely. To create a stream from a list of files e.g. on a hard-disk use the mvIMPACT.acquire.labs.VideoStream constructor accepting a mvIMPACT.acquire.ImageBufferDesc instead! Create instances of b mvIMPACT.acquire.ImageBufferDesc objects from files call the mvIMPACT.acquire.ImageBufferDesc constructor accepting a file name. |
codec | [in] The codec that shall be used while encoding the images into the stream. |
quality_pc | [in] The quality of the resulting video stream in percent. The higher this value the larger the file will get. This value is only taken into account for the following codecs: mvIMPACT.acquire.vcH264, mvIMPACT.acquire.vcH265. |
bitrate | [in] The bitrate of the resulting video stream in kBit/s. The higher this value the larger the file will get. This value is only taken into account for the following codecs: mvIMPACT.acquire.vcMPEG2. |
getCodec | ( | self | ) |
Returns the codec used by this video stream.
This function returns the codec used by this video stream.
getCodecAsString | ( | self, | |
* | args ) |
Returns the a string representation for a video codec.
OVERLOAD 1:
This function returns a string representation for a video codec.
OVERLOAD 2: Returns the codec used by this video stream as a string.
This function returns the codec used by this video stream as a string.
getFileName | ( | self | ) |
Returns the file name of this video stream.
This function returns the file name of this video stream.
|
static |
Checks if the video stream API is available.
This function checks if the video stream API is available.
isPaused | ( | self | ) |
Checks is this video stream is currently paused.
pause | ( | self | ) |
Pauses this video stream.
This function pauses this video stream. While paused no images can be written into the stream. Pausing internally simply starts a timer and all accumulated pause times will be subtracted from images that will be written into the stream after the pause has been ended effectively allowing to remove inactive sections from the video stream.
resume | ( | self | ) |
Resumes this video stream.
This function resumes this previously paused video stream. While paused no images can be written into the stream. Pausing internally simply starts a timer and all accumulated pause times will be subtracted from images that will be written into the stream after the pause has been ended effectively allowing to remove inactive sections from the video stream.
saveImage | ( | self, | |
* | args ) |
Stores an image into the video stream.
OVERLOAD 1:
This function stores an image into the video stream.
pBuffer | [in] The image to encode and store. |
timestamp_us | [in] A timestamp(in us) to associate this image with. This can be 0 if no timestamp is available. |
OVERLOAD 2: Encodes and stores the image associated with the mvIMPACT.acquire.Request object into the stream.
This function stores the image associated with an mvIMPACT.acquire.Request object into the video stream.
pDev | [in] A pointer to a mvIMPACT.acquire.Device object obtained from a mvIMPACT.acquire.DeviceManager object. |
pRequest | [in] A pointer to the mvIMPACT.acquire.Request object carrying the image to encode and store. |
|
static |