0

I'm using this library to read movies inside a java opengl application. It works nice and it is fast BUT it can allow to seek the video only with percentage, accepting a double parameter:

double d = ...
myMovie.setPlaybackPercentage(d);

this works, but the problem is that sometimes (depending on the video) the percentage parameter is between 2 frames and when I display the video it flickers between 2 frames.

For example with the actual video I'm using, 0.84 make everything unstable. I don't know how to resolve this problem..

I think one solution could be using only even seeking number and videos with even frames.. sounds realistic?

ps. I'm actually cast the double to float, but I'm using only 0.2 multiple:

float mySeeks[] = {0, 0.2f, 0.4f, 0.6f, 0.8f, 1}
nkint
  • 11,513
  • 31
  • 103
  • 174

1 Answers1

0

I think one solution could be using only even seeking number and videos with even frames.. sounds realistic?

The more realistic solution would be to have the library round up fractional frame values because they do not make sense. Using percentages is also a very unfitting way for precise seeks in movies – if the movie is sufficiently long enough, and the float type is sufficiently coarse, it won't be possible to do express certain seeks. Better would be to have something based on timecode, frame number, or approximate file position.

qmp
  • 101
  • yes. this is exactly the problem.. in the documentation ( http://www.mat.ucsb.edu/~a.forbes/PROCESSING/jmcvideo/javadoc/ ) there is nothing based on frame number. It is exactly for this that I'm asking it : ) – nkint Jul 08 '13 at 11:57