How do I extract information from a video when uploading with FileUpload?

0

On the system I'm doing, I need to prevent a video from being uploaded for more than 1 minute and let the user know. Any way to do that? Thank you.

    
asked by anonymous 04.02.2018 / 15:30

1 answer

0

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

Code sample:

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 full example of this code can be seen here > and a video manipulation tutorial with Xuggler can be viewed here .     

04.02.2018 / 18:56