Skip to content

Inaccuracies with seek #242

@yakir12

Description

@yakir12

I've had really bizarre behavior from the seek function.
In the following MWE :

using VideoIO
function get3rd(f) # get the time stamp of the 3rd frame from the current state
    i = 1
    while !eof(f)
        t = VideoIO.gettime(f)
        read(f) # move one frame forward, this is the only way I know of how to do that btw
        i == 3 && return t
        i += 1
    end
end
file = "a.mp4"
f = VideoIO.openvideo(file)
t = get3rd(f)
for i in 1:5 # some random reads
    read(f)
end
seek(f, t) # ok, let's go to a known time stamp, the one in `t`
t2 = VideoIO.gettime(f) # t2 ≠ t

t2 is not at all equal to t. I've got really weird results in similar situations. Is this behavior expected? If so, I'll try and work around it, but it seems very fickle at times.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions