openframeworks / openframeworks/openFrameworks

ofVideoPlayer setFrame behaviour

Open
#5,014 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

I'm a bit in doubt what the intended behaviour is, i'm playing multiple ProRes videos with ofVideoPlayer on oF 0.9.3 on mac, and want to run computer vision on each frame in sync across the videos.

I'm loading the videos with video.load('src') and, in update i set the frame number with the framenum from the app video.setFrame(ofGetFrameNum()), and call video.update() to update the texture.

I'm expecting to get a contineous flow of the frames shown, in sync across the videos, but i'm sometimes getting weird negative times in return when i call video.getCurrentFrame(). Also the first video i load, wont play (keeps returning -inf in video.getCurrentFrame, the workaround is to load a random video before i load the first video.

If I, after i've loaded the videos, call video.play() immediately, the weird timing error disappers, and the first video works fine, but performance drops considerablt (I assume because the internal run loop tries to load frames, and I all the time overwrite the time).

I expect that i can call setFrame on videos without calling play (assume play only starts an "internal timer"). Is this a correct expectations, and therefore a bug?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ofVideoPlayer calls described here: load, setFrame, update, play, and getCurrentFrame. Reproduce the ProRes case on oF 0.9.3/mac with multiple videos, checking the first video's -inf and negative frame times. Done means the setFrame-without-play behavior is clarified or corrected and synchronized frame retrieval is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.