Search in sources :

Example 1 with VideoInfo

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

the class Video method toMpeg.

private Pair toMpeg(VideoInput vi) throws PageException, IOException {
    VideoInfo info = getInfo(vi);
    if ("mpeg1video".equals(info.getVideoCodec()))
        return new Pair(vi.getResource(), toStruct(info));
    VideoOutput tmp = new VideoOutputImpl(pageContext.getConfig().getTempDirectory().getRealResource("tmp-" + new Random().nextInt() + ".mpg"));
    try {
        doActionConvert(vi, tmp, null, null, NAMECONFLICT_ERROR);
        return new Pair(tmp.getResource(), toStruct(info));
    } catch (PageException pe) {
        tmp.getResource().delete();
        throw pe;
    } catch (IOException ioe) {
        tmp.getResource().delete();
        throw ioe;
    }
}
Also used : PageException(lucee.runtime.exp.PageException) VideoOutput(lucee.runtime.video.VideoOutput) Random(java.util.Random) VideoOutputImpl(lucee.runtime.video.VideoOutputImpl) VideoInfo(lucee.runtime.video.VideoInfo) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 Random (java.util.Random)1 PageException (lucee.runtime.exp.PageException)1 VideoInfo (lucee.runtime.video.VideoInfo)1 VideoOutput (lucee.runtime.video.VideoOutput)1 VideoOutputImpl (lucee.runtime.video.VideoOutputImpl)1