简体   繁体   中英

Looping through a segment of a video file using VLCJ

I've spent a massive amount of time on this, but just can't crack it.

Basically, I need to loop through a segment of a video file (like a minute or so over and over again) using vlcj library.

On the first iteration the selected segment (from 100's second of the file) is being played just fine, but then it just plays from the very beginning of the video file, which is not what I need of course

Media media = new SimpleMedia("C://video.avi", ":start-time=100", ":stop-time=200");
mediaPlayer.playMedia(media);
mediaPlayer.setRepeat(true);
mediaPlayer.setPlaySubItems(true);

How can this be achieved with vlcj?

That looks like a bug in vlcj, the auto-repeat functionality is not honouring the previously set media options.

This has now been fixed in vlcj and will be included in version 3.11.0 when it is released.

What may work in the meantime is to use "standard" media options:

mediaPlayer.setStandardMediaOptions(":start-time=100", ":stop-time=200");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM