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.
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.
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 .