Search in sources :

Example 1 with VideoInputImpl

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;
}
Also used : VideoExecuter(lucee.runtime.video.VideoExecuter) ConfigWeb(lucee.runtime.config.ConfigWeb) VideoInputImpl(lucee.runtime.video.VideoInputImpl) PageException(lucee.runtime.exp.PageException)

Example 2 with VideoInputImpl

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();
    }
}
Also used : Random(java.util.Random) VideoInputImpl(lucee.runtime.video.VideoInputImpl) Struct(lucee.runtime.type.Struct)

Example 3 with VideoInputImpl

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);
}
Also used : VideoInput(lucee.runtime.video.VideoInput) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) VideoInputImpl(lucee.runtime.video.VideoInputImpl)

Aggregations

VideoInputImpl (lucee.runtime.video.VideoInputImpl)3 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 Random (java.util.Random)1 ConfigWeb (lucee.runtime.config.ConfigWeb)1 PageException (lucee.runtime.exp.PageException)1 Struct (lucee.runtime.type.Struct)1 VideoExecuter (lucee.runtime.video.VideoExecuter)1 VideoInput (lucee.runtime.video.VideoInput)1