How to extract information from a video when uploading with Fileupload?

Asked

Viewed 24 times

0

in the systems I am doing need to prevent the upload of a video with more than 1 minute and inform the user. Any way to do that? Thank you.

1 answer

0


This can be done with the Xuggler, which is an open source video manipulation library.

Code example:

public long getVideoDuration(String path){    
    private static final String filename = path; //EX.: "/home/videos/myvideo.mp4"
    IContainer container = IContainer.make();
    int result = container.open(filename, IContainer.Type.READ, null);
    return container.getDuration();
}

The complete example of this code can be seen here and a tutorial on video manipulation with Xuggler can be viewed here.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.