Merge pull request #22163 from philipphutterer:vcap-frame-type

pull/22135/head
Alexander Alekhin 2 years ago
commit 66567933d7
  1. 1
      modules/videoio/include/opencv2/videoio.hpp
  2. 2
      modules/videoio/src/cap_ffmpeg_impl.hpp

@ -202,6 +202,7 @@ enum VideoCaptureProperties {
CAP_PROP_AUDIO_SYNCHRONIZE = 66, //!< (open, read) Enables audio synchronization.
CAP_PROP_LRF_HAS_KEY_FRAME = 67, //!< FFmpeg back-end only - Indicates whether the Last Raw Frame (LRF), output from VideoCapture::read() when VideoCapture is initialized with VideoCapture::open(CAP_FFMPEG, {CAP_PROP_FORMAT, -1}) or VideoCapture::set(CAP_PROP_FORMAT,-1) is called before the first call to VideoCapture::read(), contains encoded data for a key frame.
CAP_PROP_CODEC_EXTRADATA_INDEX = 68, //!< Positive index indicates that returning extra data is supported by the video back end. This can be retrieved as cap.retrieve(data, <returned index>). E.g. When reading from a h264 encoded RTSP stream, the FFmpeg backend could return the SPS and/or PPS if available (if sent in reply to a DESCRIBE request), from calls to cap.retrieve(data, <returned index>).
CAP_PROP_FRAME_TYPE = 69, //!< (read-only) FFmpeg back-end only - Frame type ascii code (73 = 'I', 80 = 'P', 66 = 'B' or 63 = '?' if unknown) of the most recently read frame.
#ifndef CV_DOXYGEN
CV__CAP_PROP_LATEST
#endif

@ -1695,6 +1695,8 @@ double CvCapture_FFMPEG::getProperty( int property_id ) const
return (double)((rotation_auto && ((rotation_angle%180) != 0)) ? frame.height : frame.width);
case CAP_PROP_FRAME_HEIGHT:
return (double)((rotation_auto && ((rotation_angle%180) != 0)) ? frame.width : frame.height);
case CAP_PROP_FRAME_TYPE:
return (double)av_get_picture_type_char(picture->pict_type);
case CAP_PROP_FPS:
return get_fps();
case CAP_PROP_FOURCC:

Loading…
Cancel
Save