Infolinks In Text Ads

Jun 24, 2010

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;

}

No comments:

Post a Comment

LinkWithin

Related Posts Plugin for WordPress, Blogger...