use of lucee.runtime.video.VideoInputImpl in project Lucee by lucee.
the class IsVideoFile method call.
public static boolean call(PageContext pc, String path) throws PageException {
try {
ConfigWeb config = pc.getConfig();
VideoExecuter ve = VideoUtilImpl.createVideoExecuter(config);
ve.info(config, new VideoInputImpl(Caster.toResource(pc, path, true)));
} catch (Exception e) {
if (StringUtil.contains(e.getMessage(), "missing ffmpeg installation"))
throw Caster.toPageException(e);
return false;
}
return true;
}
use of lucee.runtime.video.VideoInputImpl in project Lucee by lucee.
the class Video method doActionConcat.
private void doActionConcat() throws PageException, IOException {
// precheck settings
checkFile(source1, "source1", true, true, false);
checkFile(source2, "source2", true, true, false);
if (!checkDestination(source1, destination, name, nameconflict))
return;
Pair s1 = toMpeg(source1);
Pair s2 = toMpeg(source2);
source = new VideoInputImpl(pageContext.getConfig().getTempDirectory().getRealResource("tmp-" + new Random().nextInt() + ".mpg"));
try {
merge(s1.res, s2.res, source.getResource());
Struct sct = doActionConvert();
sct.setEL(SOURCE1, s1.sct);
sct.setEL(SOURCE2, s2.sct);
sct.removeEL(SOURCE);
} finally {
source.getResource().delete();
if (!s1.res.equals(source1.getResource()))
s1.res.delete();
if (!s2.res.equals(source2.getResource()))
s2.res.delete();
}
}
use of lucee.runtime.video.VideoInputImpl in project Lucee by lucee.
the class VideoPlayerJW method calculateDimension.
private static int[] calculateDimension(PageContext pc, List params, int width, String strWidth, int height, String strHeight) throws PageException {
Iterator it = params.iterator();
ArrayList sources = new ArrayList();
// Resource[] sources=new Resource[params.size()];
VideoPlayerParamBean param;
while (it.hasNext()) {
param = (VideoPlayerParamBean) it.next();
if (param.getVideo() != null)
sources.add(new VideoInputImpl(param.getVideo()));
}
return VideoUtilImpl.getInstance().calculateDimension(pc, (VideoInput[]) sources.toArray(new VideoInput[sources.size()]), width, strWidth, height, strHeight);
}
Aggregations