簡體   English   中英

用Java壓縮視頻文件

[英]Compressing video file with Java

是否可以對視頻文件進行霍夫曼編碼? 另外,為了用 Java 對視頻文件進行編碼,我是否需要任何 API 來讀取視頻文件的字節,還是應該使用簡單的BufferedReader完成這項工作?

對於 Java 中的視頻處理,您可以使用Java Media Framework

這是快速的Java 媒體框架基礎知識

在java中壓縮視頻你可以使用IVCompressor
有關更多詳細信息,請訪問https://techgnious.github.io/IVCompressor/

簡單的代碼

    <dependency>
        <groupId>io.github.techgnious</groupId>
        <artifactId>IVCompressor</artifactId>
        <version>1.0.1</version>
    </dependency>

public static void main(String[] args) throws VideoException, IOException {
    IVCompressor compressor = new IVCompressor();
    IVSize customRes = new IVSize();
    customRes.setWidth(400);
    customRes.setHeight(300);
    File file = new File("D:/Testing/20.mp4");
        compressor.reduceVideoSizeAndSaveToAPath(file,VideoFormats.MP4,ResizeResolution.R480P,"D:/Testing/Custome");
    }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM