opencv4.1里面CV_FOURCC找不到标识符

§ VideoWriter() [2/3]

cv::VideoWriter::VideoWriter(const String & filename,
  int fourcc,
  double fps,
  Size frameSize,
  bool isColor = true 
 )  


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

filenameName of the output video file.
fourcc4-character code of codec used to compress the frames. For example, VideoWriter::fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter::fourcc('M','J','P','G') is a motion-jpeg codec etc. List of codes can be obtained at Video Codecs by FOURCC page. FFMPEG backend with MP4 container natively uses other values as fourcc code: see ObjectType, so you may receive a warning message from OpenCV about fourcc code conversion.
fpsFramerate of the created video stream.
frameSizeSize of the video frames.
isColorIf it is not zero, the encoder will expect and encode color frames, otherwise it will work with grayscale frames (the flag is currently supported on Windows only).

Tips:

  • With some backends fourcc=-1 pops up the codec selection dialog from the system.
  • To save image sequence use a proper filename (eg. img_%02d.jpg) and fourcc=0 OR fps=0. Use uncompressed image format (eg. img_%02d.BMP) to save raw frames.
  • Most codecs are lossy. If you want lossless video file you need to use a lossless codecs (eg. FFMPEG FFV1, Huffman HFYU, Lagarith LAGS, etc...)
  • If FFMPEG is enabled, using codec=0; fps=0; you can create an uncompressed (raw) video file.
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值