Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
26ac5a3b
Commit
26ac5a3b
authored
Jun 14, 2019
by
fishjam
Committed by
Alexander Alekhin
Aug 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
try to fix VideoCapture different time stamp
parent
cf93a05d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
cap_ffmpeg_impl.hpp
modules/videoio/src/cap_ffmpeg_impl.hpp
+7
-3
No files found.
modules/videoio/src/cap_ffmpeg_impl.hpp
View file @
26ac5a3b
...
...
@@ -496,7 +496,7 @@ struct CvCapture_FFMPEG
double
r2d
(
AVRational
r
)
const
;
int64_t
dts_to_frame_number
(
int64_t
dts
);
double
dts_to_sec
(
int64_t
dts
);
double
dts_to_sec
(
int64_t
dts
)
const
;
AVFormatContext
*
ic
;
AVCodec
*
avcodec
;
...
...
@@ -1167,7 +1167,11 @@ double CvCapture_FFMPEG::getProperty( int property_id ) const
switch
(
property_id
)
{
case
CV_FFMPEG_CAP_PROP_POS_MSEC
:
return
1000.0
*
(
double
)
frame_number
/
get_fps
();
if
(
picture_pts
==
AV_NOPTS_VALUE_
)
{
return
0
;
}
return
(
dts_to_sec
(
picture_pts
)
*
1000
);
case
CV_FFMPEG_CAP_PROP_POS_FRAMES
:
return
(
double
)
frame_number
;
case
CV_FFMPEG_CAP_PROP_POS_AVI_RATIO
:
...
...
@@ -1277,7 +1281,7 @@ int64_t CvCapture_FFMPEG::dts_to_frame_number(int64_t dts)
return
(
int64_t
)(
get_fps
()
*
sec
+
0.5
);
}
double
CvCapture_FFMPEG
::
dts_to_sec
(
int64_t
dts
)
double
CvCapture_FFMPEG
::
dts_to_sec
(
int64_t
dts
)
const
{
return
(
double
)(
dts
-
ic
->
streams
[
video_stream
]
->
start_time
)
*
r2d
(
ic
->
streams
[
video_stream
]
->
time_base
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment