视频编码/解码 CUDA 加速的计算机视觉


class   cv::cudacodec::EncoderCallBack
  Callbacks for CUDA video encoder. 更多...
 
struct   cv::cudacodec::EncoderParams
  Different parameters for CUDA video encoder. 更多...
 
struct   cv::cudacodec::FormatInfo
  Struct providing information about video file format. : 更多...
 
class   cv::cudacodec::RawVideoSource
  Interface for video demultiplexing. : 更多...
 
class   cv::cudacodec::VideoReader
  Video reader interface. 更多...
 
class   cv::cudacodec::VideoWriter
  Video writer interface. 更多...
 

枚举

enum   cv::cudacodec::ChromaFormat {
   cv::cudacodec::Monochrome = 0,
   cv::cudacodec::YUV420 ,
   cv::cudacodec::YUV422 ,
   cv::cudacodec::YUV444 ,
   cv::cudacodec::NumFormats
}
  Chroma formats supported by cudacodec::VideoReader . 更多...
 
enum   cv::cudacodec::Codec {
   cv::cudacodec::MPEG1 = 0,
   cv::cudacodec::MPEG2 ,
   cv::cudacodec::MPEG4 ,
   cv::cudacodec::VC1 ,
   cv::cudacodec::H264 ,
   cv::cudacodec::JPEG ,
   cv::cudacodec::H264_SVC ,
   cv::cudacodec::H264_MVC ,
   cv::cudacodec::HEVC ,
   cv::cudacodec::VP8 ,
   cv::cudacodec::VP9 ,
   cv::cudacodec::NumCodecs ,
   cv::cudacodec::Uncompressed_YUV420 = (('I'<<24)|('Y'<<16)|('U'<<8)|('V')),
   cv::cudacodec::Uncompressed_YV12 = (('Y'<<24)|('V'<<16)|('1'<<8)|('2')),
   cv::cudacodec::Uncompressed_NV12 = (('N'<<24)|('V'<<16)|('1'<<8)|('2')),
   cv::cudacodec::Uncompressed_YUYV = (('Y'<<24)|('U'<<16)|('Y'<<8)|('V')),
   cv::cudacodec::Uncompressed_UYVY = (('U'<<24)|('Y'<<16)|('V'<<8)|('Y'))
}
  Video codecs supported by cudacodec::VideoReader . 更多...
 
enum   cv::cudacodec::SurfaceFormat {
   cv::cudacodec::SF_UYVY = 0,
   cv::cudacodec::SF_YUY2 ,
   cv::cudacodec::SF_YV12 ,
   cv::cudacodec::SF_NV12 ,
   cv::cudacodec::SF_IYUV ,
   cv::cudacodec::SF_BGR ,
   cv::cudacodec::SF_GRAY = SF_BGR
}
 

函数

Ptr < VideoReader cv::cudacodec::createVideoReader (const String &filename)
  Creates video reader. 更多...
 
Ptr < VideoReader cv::cudacodec::createVideoReader (const Ptr < RawVideoSource > &source)
 
Ptr < cudacodec::VideoWriter cv::cudacodec::createVideoWriter (const String &fileName, Size frameSize, double fps, SurfaceFormat format= SF_BGR )
  Creates video writer. 更多...
 
Ptr < cudacodec::VideoWriter cv::cudacodec::createVideoWriter (const String &fileName, Size frameSize, double fps, const EncoderParams &params, SurfaceFormat format= SF_BGR )
 
Ptr < cudacodec::VideoWriter cv::cudacodec::createVideoWriter (const Ptr < EncoderCallBack > &encoderCallback, Size frameSize, double fps, SurfaceFormat format= SF_BGR )
 
Ptr < cudacodec::VideoWriter cv::cudacodec::createVideoWriter (const Ptr < EncoderCallBack > &encoderCallback, Size frameSize, double fps, const EncoderParams &params, SurfaceFormat format= SF_BGR )
 

详细描述

枚举类型文档编制

◆  ChromaFormat

#include < opencv2/cudacodec.hpp >

Chroma formats supported by cudacodec::VideoReader .

枚举器
Monochrome 
YUV420 
YUV422 
YUV444 
NumFormats 

◆  Codec

#include < opencv2/cudacodec.hpp >

Video codecs supported by cudacodec::VideoReader .

枚举器
MPEG1 
MPEG2 
MPEG4 
VC1 
H264 
JPEG 
H264_SVC 
H264_MVC 
HEVC 
VP8 
VP9 
NumCodecs 
Uncompressed_YUV420 

Y,U,V (4:2:0)

Uncompressed_YV12 

Y,V,U (4:2:0)

Uncompressed_NV12 

Y,UV (4:2:0)

Uncompressed_YUYV 

YUYV/YUY2 (4:2:2)

Uncompressed_UYVY 

UYVY (4:2:2)

◆  SurfaceFormat

#include < opencv2/cudacodec.hpp >

枚举器
SF_UYVY 
SF_YUY2 
SF_YV12 
SF_NV12 
SF_IYUV 
SF_BGR 
SF_GRAY 

函数文档编制

◆  createVideoReader() [1/2]

Ptr < VideoReader > cv::cudacodec::createVideoReader ( const String filename )

#include < opencv2/cudacodec.hpp >

Creates video reader.

Parameters
filename Name of the input video file.

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

◆  createVideoReader() [2/2]

Ptr < VideoReader > cv::cudacodec::createVideoReader ( const Ptr < RawVideoSource > &  source )

#include < opencv2/cudacodec.hpp >

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
source RAW video source implemented by user.

◆  createVideoWriter() [1/4]

Ptr < cudacodec::VideoWriter > cv::cudacodec::createVideoWriter ( const String fileName ,
Size   frameSize ,
double  fps ,
SurfaceFormat   format = SF_BGR  
)

#include < opencv2/cudacodec.hpp >

Creates video writer.

Parameters
fileName Name of the output video file. Only AVI file format is supported.
frameSize Size of the input video frames.
fps Framerate of the created video stream.
format Surface format of input frames ( SF_UYVY , SF_YUY2 , SF_YV12 , SF_NV12 , SF_IYUV , SF_BGR or SF_GRAY). BGR or gray frames will be converted to YV12 format before encoding, frames with other formats will be used as is.

The constructors initialize video writer. FFMPEG is used to write videos. User can implement own multiplexing with cudacodec::EncoderCallBack .

◆  createVideoWriter() [2/4]

Ptr < cudacodec::VideoWriter > cv::cudacodec::createVideoWriter ( const String fileName ,
Size   frameSize ,
double  fps ,
const EncoderParams params ,
SurfaceFormat   format = SF_BGR  
)

#include < opencv2/cudacodec.hpp >

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
fileName Name of the output video file. Only AVI file format is supported.
frameSize Size of the input video frames.
fps Framerate of the created video stream.
params Encoder parameters. See cudacodec::EncoderParams .
format Surface format of input frames ( SF_UYVY , SF_YUY2 , SF_YV12 , SF_NV12 , SF_IYUV , SF_BGR or SF_GRAY). BGR or gray frames will be converted to YV12 format before encoding, frames with other formats will be used as is.

◆  createVideoWriter() [3/4]

Ptr < cudacodec::VideoWriter > cv::cudacodec::createVideoWriter ( const Ptr < EncoderCallBack > &  encoderCallback ,
Size   frameSize ,
double  fps ,
SurfaceFormat   format = SF_BGR  
)

#include < opencv2/cudacodec.hpp >

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
encoderCallback Callbacks for video encoder. See cudacodec::EncoderCallBack . Use it if you want to work with raw video stream.
frameSize Size of the input video frames.
fps Framerate of the created video stream.
format Surface format of input frames ( SF_UYVY , SF_YUY2 , SF_YV12 , SF_NV12 , SF_IYUV , SF_BGR or SF_GRAY). BGR or gray frames will be converted to YV12 format before encoding, frames with other formats will be used as is.

◆  createVideoWriter() [4/4]

Ptr < cudacodec::VideoWriter > cv::cudacodec::createVideoWriter ( const Ptr < EncoderCallBack > &  encoderCallback ,
Size   frameSize ,
double  fps ,
const EncoderParams params ,
SurfaceFormat   format = SF_BGR  
)

#include < opencv2/cudacodec.hpp >

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
encoderCallback Callbacks for video encoder. See cudacodec::EncoderCallBack . Use it if you want to work with raw video stream.
frameSize Size of the input video frames.
fps Framerate of the created video stream.
params Encoder parameters. See cudacodec::EncoderParams .
format Surface format of input frames ( SF_UYVY , SF_YUY2 , SF_YV12 , SF_NV12 , SF_IYUV , SF_BGR or SF_GRAY). BGR or gray frames will be converted to YV12 format before encoding, frames with other formats will be used as is.