How to make thumbnails in jpg format of Videos in Java code examples

Make  thumbnails in jpg format of  Videos :-
Point to Note:- There is need to install ffmpeg in your system.

public int compressVideioToJpg(String inputVideo, String outputJpg) {
    int returnCode = 0;
    Process process;
    try {
        System.out.println("compressVideioToJpg called");
        System.out.println("inputVideo:"+inputVideo);
        System.out.println("outputVidio:"+outputJpg);

        String[] command = { "ffmpeg", "-i", inputVideo , "-an", "-r", ".1", "-y","-s","236x148", outputJpg};
        System.out.println("22:");
        process = Runtime.getRuntime().exec(command);
        System.out.println("after process JPG");
        returnCode = process.waitFor();
        System.out.println("returnCode JPG:"+returnCode);

    } catch (IOException e) {
        e.printStackTrace();
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    return returnCode;

}

Comments

Recent Post

Recent Posts Widget

Popular posts from this blog

Capture image from webcam java code, examples

Shallow Copy Deep Copy Java example

Database Connection using NODE JS example