[][src]Function opencv::cudacodec::create_video_writer_3

pub fn create_video_writer_3(
    encoder_callback: &Ptr<dyn EncoderCallBack>,
    frame_size: Size,
    fps: f64,
    params: &EncoderParams,
    format: SurfaceFormat
) -> Result<Ptr<dyn VideoWriter>>

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 .

Overloaded 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.

C++ default parameters

  • format: SF_BGR