简体   繁体   English

使用VLCJ遍历视频文件的一部分

[英]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. 基本上,我需要使用vlcj库遍历一段视频文件(一分钟左右)。

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 在第一次迭代中,选定的片段(从文件的100秒开始)正在播放,但是随后它只是从视频文件的开头开始播放,这当然不是我需要的

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? vlcj如何实现?

That looks like a bug in vlcj, the auto-repeat functionality is not honouring the previously set media options. 这看起来像vlcj中的错误,自动重复功能不支持先前设置的媒体选项。

This has now been fixed in vlcj and will be included in version 3.11.0 when it is released. 现在vlcj中已修复此问题,并且在发行时将包含在3.11.0版中。

What may work in the meantime is to use "standard" media options: 同时可能起作用的是使用“标准”媒体选项:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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