Search code examples
vlcj

VLCj get Snapshot at the last millisecond


I'm using VLCj 2.4.1 and want to take screenshot at the last millisecond of the video. Usually I just do

getMediaPlayer().setTime(someTime);
getMediaPlayer().getSnapshot();

and it works. But if someTime is >= getMediaPlayer().getLength()-120 (I get to 120ms through experimentation) VLCj doesn't respond (video position stays the same).

If however someTime is in range 0-getMediaPlayer().getLength()-120 everything works as expected.

Where is the problem? Why are those ~120ms "missing"?


Solution

  • I "solved" the problem with completely different program/library - Xuggle for Java. It works flawlessly - see DecodeAndCaptureFrames.java