當前位置: 首頁>>代碼示例>>Java>>正文


Java FrameFilter類代碼示例

本文整理匯總了Java中org.bytedeco.javacv.FrameFilter的典型用法代碼示例。如果您正苦於以下問題:Java FrameFilter類的具體用法?Java FrameFilter怎麽用?Java FrameFilter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FrameFilter類屬於org.bytedeco.javacv包,在下文中一共展示了FrameFilter類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: FilterImageTransform

import org.bytedeco.javacv.FrameFilter; //導入依賴的package包/類
/**
 * Constructs a filtergraph out of the filter specification.
 *
 * @param filters  to use
 * @param width    of the input images
 * @param height   of the input images
 * @param channels of the input images
 */
public FilterImageTransform(@JsonProperty("filters") String filters, @JsonProperty("width") int width,
                @JsonProperty("height") int height, @JsonProperty("channels") int channels) {
    super(null);

    this.filters = filters;
    this.width = width;
    this.height = height;
    this.channels = channels;

    int pixelFormat = channels == 1 ? AV_PIX_FMT_GRAY8
                    : channels == 3 ? AV_PIX_FMT_BGR24 : channels == 4 ? AV_PIX_FMT_RGBA : AV_PIX_FMT_NONE;
    if (pixelFormat == AV_PIX_FMT_NONE) {
        throw new IllegalArgumentException("Unsupported number of channels: " + channels);
    }
    try {
        filter = new FFmpegFrameFilter(filters, width, height);
        filter.setPixelFormat(pixelFormat);
        filter.start();
    } catch (FrameFilter.Exception e) {
        throw new RuntimeException(e);
    }
}
 
開發者ID:deeplearning4j,項目名稱:DataVec,代碼行數:31,代碼來源:FilterImageTransform.java

示例2: releaseFrameFilter

import org.bytedeco.javacv.FrameFilter; //導入依賴的package包/類
private void releaseFrameFilter()
{
    if (frameFilter != null)
    {
        try
        {
            frameFilter.release();
        }
        catch (FrameFilter.Exception e)
        {
            e.printStackTrace();
        }
    }
    frameFilter = null;
}
 
開發者ID:a3349384,項目名稱:AndroidVideoRecordEx,代碼行數:16,代碼來源:VideoRecorderEx.java

示例3: releaseFrameFilter

import org.bytedeco.javacv.FrameFilter; //導入依賴的package包/類
/**
 * 釋放幀過濾器
 */
private void releaseFrameFilter() {
    if (null != mFrameFilter) {
        try {
            mFrameFilter.release();
        } catch (FrameFilter.Exception e) {
            e.printStackTrace();
        }
    }
    mFrameFilter = null;
}
 
開發者ID:Grrsun,項目名稱:meipaiAll,代碼行數:14,代碼來源:WXLikeVideoRecorder.java

示例4: recordFrame

import org.bytedeco.javacv.FrameFilter; //導入依賴的package包/類
/**
 * 錄製幀
 * @throws FrameRecorder.Exception
 */
private void recordFrame(Frame frame) throws FrameRecorder.Exception, FrameFilter.Exception {
    mFrameFilter.push(frame);
    Frame filteredFrame;
    while ((filteredFrame = mFrameFilter.pull()) != null) {
        recorder.record(filteredFrame);
    }
}
 
開發者ID:Grrsun,項目名稱:meipaiAll,代碼行數:12,代碼來源:WXLikeVideoRecorder.java


注:本文中的org.bytedeco.javacv.FrameFilter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。