简体   繁体   中英

Compressing video file with Java

Is it possible to Huffman Encode video files? Also in order to encode the video file in Java will I require any API for reading the bytes of the video file or should a simple BufferedReader do the job?

For video processing in Java you can use Java Media Framework .

Here is quick Java Media Framework basics

Compressing video in java you can use IVCompressor
for more details go https://techgnious.github.io/IVCompressor/

simple code

    <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");
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM