You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some videos have a start time that is larger than zero. So after reading the first frame, gettime returns a number that is much larger than expected (>>1/fps). This is very common when the recording camera split the file into ~2GB segments. In such cases, a video file will have a starting time equal to the total amount of time all the previous segments had.
It becomes a problem because most video players show the current playing time relative to the beginning of the video, i.e. zero. So if a user wants to inspect an event in the video, the time they make a note of is "wrong" and needs to be adjusted to the starting time of the video.
Is there a way to retrieve that information?
Currently I do this:
vid = VideoIO.openvideo(file)
read(vid);
t0 =gettime(vid) # now equals to the real time stamp
After some careful thought, I think that there are two distinct cases here:
a user has a video that s/he knows little about, tries to seek(vid, t) where t is smaller than the starting time of the video, and gets the same first frame from the video regardless of t (as long as t is smaller than the starting time).
a user has a video that has been segmented into n video-files, and wants to seek into the video, either in "glabal" video-time, or in "individual" file time. This user is looking for a convenient way to do this.
Case number 1 can/should be addressed with a simple warning/info box in the documentation/FAQ.
Case number 2 warrants a more careful approach/API. Perhaps in a separate package even.
Some videos have a start time that is larger than zero. So after reading the first frame,
gettime
returns a number that is much larger than expected (>>1/fps). This is very common when the recording camera split the file into ~2GB segments. In such cases, a video file will have a starting time equal to the total amount of time all the previous segments had.It becomes a problem because most video players show the current playing time relative to the beginning of the video, i.e. zero. So if a user wants to inspect an event in the video, the time they make a note of is "wrong" and needs to be adjusted to the starting time of the video.
Is there a way to retrieve that information?
Currently I do this:
I can use cli
ffprobe
to get to that data:The text was updated successfully, but these errors were encountered: