Search in sources :

Example 1 with VideoInput

use of lucee.runtime.video.VideoInput in project Lucee by lucee.

the class Video method doActionCutImage.

private void doActionCutImage() throws PageException, IOException {
    // precheck settings
    checkFile(source, "source", true, true, false);
    if (!checkDestination(source, destination, name, nameconflict))
        return;
    // input
    if (profile == null)
        profile = new VideoProfileImpl();
    // settings
    settings(destination, profile);
    destination.setMaxFrames(1);
    destination.setFormat("image2");
    // execute
    Struct info = toStruct(getVideoExecuter().convert(pageContext.getConfig(), new VideoInput[] { source }, destination, profile));
    // write cfvideo
    debug(source);
    pageContext.setVariable(result, info);
// setResult(raw,false);
}
Also used : VideoInput(lucee.runtime.video.VideoInput) VideoProfileImpl(lucee.runtime.video.VideoProfileImpl) Struct(lucee.runtime.type.Struct)

Example 2 with VideoInput

use of lucee.runtime.video.VideoInput in project Lucee by lucee.

the class Video method doActionConvert.

private Struct doActionConvert(VideoInput source, VideoOutput destination, VideoProfile quality, String name, int nameconflict) throws PageException, IOException {
    // precheck settings
    checkFile(source, "source", true, true, false);
    if (!checkDestination(source, destination, name, nameconflict))
        return new StructImpl();
    // input
    if (quality == null)
        quality = new VideoProfileImpl();
    // settings
    settings(destination, quality);
    // execute
    Struct info = toStruct(getVideoExecuter().convert(pageContext.getConfig(), new VideoInput[] { source }, destination, quality));
    // write cfvideo
    debug(source);
    pageContext.setVariable(result, info);
    return info;
// return setResult(raw,false);
}
Also used : StructImpl(lucee.runtime.type.StructImpl) VideoInput(lucee.runtime.video.VideoInput) VideoProfileImpl(lucee.runtime.video.VideoProfileImpl) Struct(lucee.runtime.type.Struct)

Example 3 with VideoInput

use of lucee.runtime.video.VideoInput 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

VideoInput (lucee.runtime.video.VideoInput)3 Struct (lucee.runtime.type.Struct)2 VideoProfileImpl (lucee.runtime.video.VideoProfileImpl)2 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 StructImpl (lucee.runtime.type.StructImpl)1 VideoInputImpl (lucee.runtime.video.VideoInputImpl)1