mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
Merge pull request #20591 from fortemSteve:ffmpeg_get_stream_open_time
Add CAP_PROP_STREAM_OPEN_TIME * Added CAP_PROP_STREAM_OPEN_TIME to videoio module - can be used to query the time at which the stream was opened, in seconds since Jan 1 1970 (midnight, UTC). Useful for RTSP and other live video where absolute timestamps are needed. Only applicable to ffmpeg backends * use nanoseconds instead of seconds to mark the stream open time, and change the cap prop name to CAP_PROP_STREAM_OPEN_TIME_NSEC * use microseconds for CAP_PROP_STREAM_OPEN_TIME (nanoseconds rolls over too soon, and milliseconds/seconds requires a division) * fix whitespace issue
This commit is contained in:
parent
c703f1eed6
commit
c7e0888982
@ -188,6 +188,7 @@ enum VideoCaptureProperties {
|
||||
CAP_PROP_HW_ACCELERATION_USE_OPENCL=52, //!< (**open-only**) If non-zero, create new OpenCL context and bind it to current thread. The OpenCL context created with Video Acceleration context attached it (if not attached yet) for optimized GPU data copy between HW accelerated decoder and cv::UMat.
|
||||
CAP_PROP_OPEN_TIMEOUT_MSEC=53, //!< (**open-only**) timeout in milliseconds for opening a video capture (applicable for FFmpeg back-end only)
|
||||
CAP_PROP_READ_TIMEOUT_MSEC=54, //!< (**open-only**) timeout in milliseconds for reading from a video capture (applicable for FFmpeg back-end only)
|
||||
CAP_PROP_STREAM_OPEN_TIME_USEC =55, //<! (read-only) time in microseconds since Jan 1 1970 when stream was opened. Applicable for FFmpeg backend only. Useful for RTSP and other live streams
|
||||
#ifndef CV_DOXYGEN
|
||||
CV__CAP_PROP_LATEST
|
||||
#endif
|
||||
|
@ -1591,6 +1591,9 @@ double CvCapture_FFMPEG::getProperty( int property_id ) const
|
||||
case CAP_PROP_HW_ACCELERATION_USE_OPENCL:
|
||||
return static_cast<double>(use_opencl);
|
||||
#endif // USE_AV_HW_CODECS
|
||||
case CAP_PROP_STREAM_OPEN_TIME_USEC:
|
||||
//ic->start_time_realtime is in microseconds
|
||||
return ((double)ic->start_time_realtime);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user