Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Black frame after playing video / before reloading new video

$
0
0

@Claartje wrote:

Hi there,

I am new to OF and C++, so this is a very beginner question.

I want to show some (~ 4) randomly chosen videos at once and reload new ones when they are finished. I manage to pick them at random, play them and also reload new ones when they are finished, but I can’t get rid of black frames in between two videos. I have tried two approaches and both show problems:

Approach 1:
Draw the ‘ofVideoPlayer’ directly in the ‘draw’ function and in ‘update’ check ‘getIsMovieDone’ in ‘update’. If that evaluates to true, I ‘close’ the current, ‘load’ a new video, and set it to ‘play’. Between the two videos there short is a blank (dark grey of the window) period.

Approach 2 (which I thought should fix it):
Retrieve the pixels of the ofVideoPlayer and convert it to an image and save that in a variable and draw the variable. It checks if there is a new frame and if there isn’t it draws the last saved image in the variable. I thought this would fix it since when no new frame is available it should just draw the previous one. But I am still seeing a black frame in between videos. A bit different from the previous approach this is completely black.

How can I smoothly switch between videos without losing screen?

Cheers,

Claartje

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles