Read mp4/mov video files as inputstream and cut them into shorter files

50 views
Skip to first unread message

pst

unread,
May 27, 2020, 3:11:56 PM5/27/20
to xuggler-users
Hello,

I am new to Xuggler. I've a need to read mp4, mov files as an inputstream and then to be able to generate a shortened version of the video files like say first 20 seconds. I've mainly been trying to use the following code, but unable to proceed.

                     IContainer container = IContainer.make();
InputStream input = null;
try {
input = new FileInputStream(filename);
IContainerFormat inputFormat = IContainerFormat.make();
inputFormat.setInputFormat("mp4");
if (containerVideo.open(input, inputFormat) < 0) {
throw new IllegalArgumentException("Can't open the file ");
}
} catch (FileNotFoundException e) {
throw new IllegalArgumentException("Can't find the file ");
}



Is there a way I could use the library to achieve what I am looking for? Thanks so much for any advice.

Reply all
Reply to author
Forward
0 new messages