-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add alternate timestamp functionality (#170)
* Add property to pull position_ms (presentation time) from input stream. * Add use-pts option to directly use timestamps for event times. The previous default behavior of calculating time from frame numbers should be preserved. The switch kind of smears alternate timekeeping through the scanner to fetch position_ms from the video source and stuff it into MotionEvent so the rest of the code should still behave the same. Might need more testing; was unsure about some of the frame_skip bits. Fixes #168 * Fix end-of-stream problem when using opencv timestamps. position_ms seems to return 0 after reading past the end of a stream. * Revert "Fix end-of-stream problem when using opencv timestamps." This reverts commit 99cf723. * Move (most) position_ms calls to _decode_thread. * Cleanup code formatting and extraneous print * Use exact PTS for events at end-of-file, comparable to frame_num behavior * Add test for use_pts. PTS uses a slightly different time than the frame_num which is shifted by 1, causing a slight slide in the expected events. --------- Co-authored-by: goatzilla <[email protected]>
- Loading branch information
1 parent
386208c
commit 78a24ff
Showing
6 changed files
with
83 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters