View Source Evision.CUDACodec (Evision v0.1.37)

Summary

Types

t()

Type that represents an CUDACodec struct.

Functions

Variant 1:

createVideoReader

Variant 1:

createVideoReader

Utility function demonstrating how to map the luma histogram when FormatInfo::videoFullRangeFlag == false

Utility function demonstrating how to map the luma histogram when FormatInfo::videoFullRangeFlag == false

Types

@type t() :: %Evision.CUDACodec{ref: reference()}

Type that represents an CUDACodec struct.

  • ref. reference()

    The underlying erlang resource variable.

Functions

Link to this function

createVideoReader(source)

View Source
@spec createVideoReader(Evision.CUDACodec.RawVideoSource.t()) ::
  Evision.CUDACodec.VideoReader.t() | {:error, String.t()}
@spec createVideoReader(binary()) ::
  Evision.CUDACodec.VideoReader.t() | {:error, String.t()}

Variant 1:

createVideoReader

Positional Arguments
  • source: RawVideoSource.

    RAW video source implemented by user.

Keyword Arguments
  • params: VideoReaderInitParams.

    Initializaton parameters. See cv::cudacodec::VideoReaderInitParams.

Return
  • retval: VideoReader

Has overloading in C++

Python prototype (for reference only):

createVideoReader(source[, params]) -> retval

Variant 2:

Creates video reader.

Positional Arguments
  • filename: String.

    Name of the input video file.

Keyword Arguments
  • sourceParams: [int].

    Pass through parameters for VideoCapure. VideoCapture with the FFMpeg back end (CAP_FFMPEG) is used to parse the video input. The sourceParams parameter allows to specify extra parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ...). See cv::VideoCaptureProperties e.g. when streaming from an RTSP source CAP_PROP_OPEN_TIMEOUT_MSEC may need to be set.

  • params: VideoReaderInitParams.

    Initializaton parameters. See cv::cudacodec::VideoReaderInitParams.

Return
  • retval: VideoReader

FFMPEG is used to read videos. User can implement own demultiplexing with cudacodec::RawVideoSource

Python prototype (for reference only):

createVideoReader(filename[, sourceParams[, params]]) -> retval
Link to this function

createVideoReader(source, opts)

View Source
@spec createVideoReader(
  Evision.CUDACodec.RawVideoSource.t(),
  [{atom(), term()}, ...] | nil
) ::
  Evision.CUDACodec.VideoReader.t() | {:error, String.t()}
@spec createVideoReader(binary(), [{atom(), term()}, ...] | nil) ::
  Evision.CUDACodec.VideoReader.t() | {:error, String.t()}

Variant 1:

createVideoReader

Positional Arguments
  • source: RawVideoSource.

    RAW video source implemented by user.

Keyword Arguments
  • params: VideoReaderInitParams.

    Initializaton parameters. See cv::cudacodec::VideoReaderInitParams.

Return
  • retval: VideoReader

Has overloading in C++

Python prototype (for reference only):

createVideoReader(source[, params]) -> retval

Variant 2:

Creates video reader.

Positional Arguments
  • filename: String.

    Name of the input video file.

Keyword Arguments
  • sourceParams: [int].

    Pass through parameters for VideoCapure. VideoCapture with the FFMpeg back end (CAP_FFMPEG) is used to parse the video input. The sourceParams parameter allows to specify extra parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ...). See cv::VideoCaptureProperties e.g. when streaming from an RTSP source CAP_PROP_OPEN_TIMEOUT_MSEC may need to be set.

  • params: VideoReaderInitParams.

    Initializaton parameters. See cv::cudacodec::VideoReaderInitParams.

Return
  • retval: VideoReader

FFMPEG is used to read videos. User can implement own demultiplexing with cudacodec::RawVideoSource

Python prototype (for reference only):

createVideoReader(filename[, sourceParams[, params]]) -> retval
Link to this function

createVideoWriter(fileName, frameSize)

View Source
@spec createVideoWriter(
  binary(),
  {number(), number()}
) :: Evision.CUDACodec.VideoWriter.t() | {:error, String.t()}

Creates video writer.

Positional Arguments
  • fileName: String.

    Name of the output video file.

  • frameSize: Size.

    Size of the input video frames.

Keyword Arguments
  • codec: Codec.

    Supports Codec::H264 and Codec::HEVC.

  • fps: double.

    Framerate of the created video stream.

  • colorFormat: ColorFormat.

    OpenCv color format of the frames to be encoded.

  • encoderCallback: EncoderCallback.

    Callbacks for video encoder. See cudacodec::EncoderCallback. Required for working with the encoded video stream.

  • stream: cuda_Stream.

    Stream for frame pre-processing.

Return
  • retval: Evision.CUDACodec.VideoWriter.t()

Python prototype (for reference only):

createVideoWriter(fileName, frameSize[, codec[, fps[, colorFormat[, encoderCallback[, stream]]]]]) -> retval
Link to this function

createVideoWriter(fileName, frameSize, opts)

View Source
@spec createVideoWriter(binary(), {number(), number()}, [{atom(), term()}, ...] | nil) ::
  Evision.CUDACodec.VideoWriter.t() | {:error, String.t()}

Creates video writer.

Positional Arguments
  • fileName: String.

    Name of the output video file.

  • frameSize: Size.

    Size of the input video frames.

Keyword Arguments
  • codec: Codec.

    Supports Codec::H264 and Codec::HEVC.

  • fps: double.

    Framerate of the created video stream.

  • colorFormat: ColorFormat.

    OpenCv color format of the frames to be encoded.

  • encoderCallback: EncoderCallback.

    Callbacks for video encoder. See cudacodec::EncoderCallback. Required for working with the encoded video stream.

  • stream: cuda_Stream.

    Stream for frame pre-processing.

Return
  • retval: Evision.CUDACodec.VideoWriter.t()

Python prototype (for reference only):

createVideoWriter(fileName, frameSize[, codec[, fps[, colorFormat[, encoderCallback[, stream]]]]]) -> retval
Link to this function

createVideoWriter(fileName, frameSize, codec, fps, colorFormat, params)

View Source
@spec createVideoWriter(
  binary(),
  {number(), number()},
  Evision.CUDACodec.Codec.t(),
  number(),
  Evision.CUDACodec.ColorFormat.t(),
  Evision.CUDACodec.EncoderParams.t()
) :: Evision.CUDACodec.VideoWriter.t() | {:error, String.t()}

Creates video writer.

Positional Arguments
  • fileName: String.

    Name of the output video file.

  • frameSize: Size.

    Size of the input video frames.

  • codec: Codec.

    Supports Codec::H264 and Codec::HEVC.

  • fps: double.

    Framerate of the created video stream.

  • colorFormat: ColorFormat.

    OpenCv color format of the frames to be encoded.

  • params: EncoderParams.

    Additional encoding parameters.

Keyword Arguments
  • encoderCallback: EncoderCallback.

    Callbacks for video encoder. See cudacodec::EncoderCallback. Required for working with the encoded video stream.

  • stream: cuda_Stream.

    Stream for frame pre-processing.

Return
  • retval: Evision.CUDACodec.VideoWriter.t()

Python prototype (for reference only):

createVideoWriter(fileName, frameSize, codec, fps, colorFormat, params[, encoderCallback[, stream]]) -> retval
Link to this function

createVideoWriter(fileName, frameSize, codec, fps, colorFormat, params, opts)

View Source
@spec createVideoWriter(
  binary(),
  {number(), number()},
  Evision.CUDACodec.Codec.t(),
  number(),
  Evision.CUDACodec.ColorFormat.t(),
  Evision.CUDACodec.EncoderParams.t(),
  [{atom(), term()}, ...] | nil
) :: Evision.CUDACodec.VideoWriter.t() | {:error, String.t()}

Creates video writer.

Positional Arguments
  • fileName: String.

    Name of the output video file.

  • frameSize: Size.

    Size of the input video frames.

  • codec: Codec.

    Supports Codec::H264 and Codec::HEVC.

  • fps: double.

    Framerate of the created video stream.

  • colorFormat: ColorFormat.

    OpenCv color format of the frames to be encoded.

  • params: EncoderParams.

    Additional encoding parameters.

Keyword Arguments
  • encoderCallback: EncoderCallback.

    Callbacks for video encoder. See cudacodec::EncoderCallback. Required for working with the encoded video stream.

  • stream: cuda_Stream.

    Stream for frame pre-processing.

Return
  • retval: Evision.CUDACodec.VideoWriter.t()

Python prototype (for reference only):

createVideoWriter(fileName, frameSize, codec, fps, colorFormat, params[, encoderCallback[, stream]]) -> retval
@spec mapHist(Evision.CUDA.GpuMat.t()) :: Evision.Mat.t() | {:error, String.t()}

Utility function demonstrating how to map the luma histogram when FormatInfo::videoFullRangeFlag == false

Positional Arguments
  • hist: Evision.CUDA.GpuMat.t().

    Luma histogram \a hist returned from VideoReader::nextFrame(GpuMat& frame, GpuMat& hist, Stream& stream).

Return
  • histFull: Evision.Mat.t().

    Host histogram equivelent to downloading \a hist after calling cuda::calcHist(InputArray frame, OutputArray hist, Stream& stream).

Note:

  • This function demonstrates how to map the luma histogram back so that it is equivalent to the result obtained from cuda::calcHist() if the returned frame was colorFormat::GRAY.

Python prototype (for reference only):

MapHist(hist[, histFull]) -> histFull
@spec mapHist(Evision.CUDA.GpuMat.t(), [{atom(), term()}, ...] | nil) ::
  Evision.Mat.t() | {:error, String.t()}

Utility function demonstrating how to map the luma histogram when FormatInfo::videoFullRangeFlag == false

Positional Arguments
  • hist: Evision.CUDA.GpuMat.t().

    Luma histogram \a hist returned from VideoReader::nextFrame(GpuMat& frame, GpuMat& hist, Stream& stream).

Return
  • histFull: Evision.Mat.t().

    Host histogram equivelent to downloading \a hist after calling cuda::calcHist(InputArray frame, OutputArray hist, Stream& stream).

Note:

  • This function demonstrates how to map the luma histogram back so that it is equivalent to the result obtained from cuda::calcHist() if the returned frame was colorFormat::GRAY.

Python prototype (for reference only):

MapHist(hist[, histFull]) -> histFull