Video acquisition using frame-grabber hardware

How to enable this feature

Please see the links below for the pre-requisites and pip install options needed to enable support for the corresponding frame-grabber hardware:

Example with explanation

In this example we will see how we can capture the video stream from an external device using an Epiphan DVI2PCIe Duo. First we obtain the GIFT-Grab video source factory singleton:

from pygiftgrab import VideoSourceFactory
sfac = VideoSourceFactory.get_instance()

Then we request the device using the obtained factory:

from pygiftgrab import Device, ColourSpace
epiphan = sfac.get_device(
    Device.DVI2PCIeDuo_DVI, ColourSpace.I420 )

The first argument above specifies the device type. In this particular case Device.DVI2PCIeDuo_DVI indicates the DVI port of an Epiphan DVI2PCIe Duo. The second argument specifies that we would like to get the video frames in the I420 colour space.

For processing video frames obtained from the epiphan object, please see the Processing obtained video frames section. Within all the source code pertaining to that discussion, you can simply replace all occurences of file_reader with the epiphan object we’ve created above. The polymorphism achieved by returning a GIFT-Grab video source from the GIFT-Grab video source factory methods get_device() and create_file_reader() allows video consumers to be agnostic of the actual type of the GIFT-Grab video source object.