Hi Mudassir,
When we add multiple high quality videos to powerpoint, it generate OutOFMemoryexception.
We have videos of size as big as 2-3 GB and we plan to add them into the PPT files in the coming releases.But Aspose throws exception when videos greater than around 500 mb generates this error.Can you replicate this error on you end ?
Regards
Mohit Garg
Hi Mohit Grag,
Hi Mudassir,
I have tested the pptx with even smaller videos.I got the same heap error when I used a video of size only 100 MB.
FYI I am using Aspose 7.3.0 and My JVM heap setting is max 1024 MB
I would like to emphasize to please check on your side this heap issue.
Linked Videos are not part of requirement.So we have to live with embedded videos in power-point.
Regards
Mohit Garg
Hi Mohit Garg,
Hi Mudassir,
Thanks for your prompt replies always
Application can’t be shared as it is confidential but you can easily replicate the issue at your end by the video link I am providing below.Its a 137 MB video and even with single slide PPT file, I get OutOfMemoryError.
Regarding platform details we are getting this error on every platform be it Mac or Windows(XP or 7). It seems to be a buffer related issue.
You can download the Video file from the link below : http://switchcontrolindia.com/Sample.mp4
Hi Mohit,
Hi Mudassir,
We are getting heap error even on linked videos(In case the video > 150 MB). Earlier we thought its just the embedded videos on which addVideo method throws OutOfMemoryError but with latest library 7.4.0 we are experiencing the same Error with linked videos.Are you reading the whole file in memory even for linked files ?
This is highly unexpected and disappointing.
Can we get this resolved as soon as possible ?
Hi Mohit,
//Instantiate PrseetationEx class that represents the PPTXPresentationEx pres = new PresentationEx();//Get the first slideSlideEx sld = pres.getSlides().get_Item(0);//Add Video FrameVideoFrameEx vf = sld.getShapes().addVideoFrame(50, 150, 300, 350, “D:\Movies\Dead Man Down.avi”);//Set Play Mode and Volume of the Videovf.setPlayMode(VideoPlayModePresetEx.Auto);vf.setVolume(AudioVolumeModeEx.Loud);////Creating a Buffered Image object to hold the image fileBufferedImage image=null;//Loading imagetry {image = ImageIO.read(new File(“C:\Users\Public\Pictures\Sample Pictures\Desert.jpg”));} catch (IOException e) {}//Adding image in collectionImageEx imgx = pres.getImages().addImage(image);//Set the fill type to Picturevf.getFillFormat().setFillType(FillTypeEx.Picture);//setting image to vide framevf.setImage(imgx);//Write the PPTX file to diskpres.write(“D:\Aspose Data\VideoFrame.pptx”);
Hi Mudassir,
I used this code for linked videos.
vf = sld.getShapes().addVideoFrame(50, 75, 350 * AR, 350, null);
videoStream = new FileInputStream(vidiLink.getAbsolutePath());
VideoEx vid = ppt.getVideos().addVideo(videoStream); // adding VideoEx from stream
// vf.setEmbeddedVideo(vid);
Please note that last line is commented.
It is working for linked videos as well(although crashing for big size videos)
As per your suggestion I tried setting the last parameter of addVideFrame and it works that way as well(without heap error for big videos).
vf = sld.getShapes().addVideoFrame(50, 75, 350 * AR, 350, vidiLink.getAbsolutePath());
Sort of same effect with two approaches.
Anyways Can you please tell by when you can resolve the heap error issue on Embedded videos ? We really need that feature.
Thanks and Regards
Mohit Garg
Hi Mohit Garg,
//Add Video FrameVideoFrameEx vf = sld.getShapes().addVideoFrame(50, 150, 300, 350, “D:\Movies\Dead Man Down.avi”);
// vf.setEmbeddedVideo(vid);
VideoEx vid = ppt.getVideos().addVideo(videoStream);
Thanks for detailed explanation Mudassir about Aspose Policy and I understand your point.
For your information we have purchased Aspose " Developer OEM license" almost a month back if that can help.
We have already incorporated Aspose in our product but unable to release due to heap error in big size videos.
Thanks for detailed explanation Mudassir about Aspose Policy and I understand your point.
For your information we have purchased Aspose " Developer OEM license" almost a month back if that can help.
We have already incorporated Aspose in our product but unable to release due to heap error in big size videos.
P.S : Sorry for double post.
Hi Mohit Grag,
Hi Mudassir,
We have same issue with latest release aspose.slides-7.5.
OutOfMemoryError.for files above 130 mb files.
Is there any chance to get its resolution without special support option ?
This bug blocked our power point feature in main application.
Hi Jatinder,
Thanks for inquiring Aspose.Slides.
I like to share that the concerned issue has been added in our issue tracking system with maximum priority level of High that can be assigned to normal support forum issues. However, there are already pending Enterprise and Priority support issues waiting for resolution in queue and as per policy the first preference is given to them. I can understand the inconvenience on your end but I can only request you to kindly wait till the issue is selected for investigation and resolution. I have also requested our development team to kindly schedule the issue for investigation and resolution if there is any empty slot available for scheduling it.
We are sorry for your inconvenience,
The issues you have found earlier (filed as SLIDESJAVA-33948) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
(1)
Hi Mudassir,
Hi Jatinder,
I am sorry for the inconvenience. Our development team has investigated
the issue on their end. Actually, the size of inserted video depends on
amount of memory (RAM), because we store the video in form of a byte
array (used copy operation).
Our
developer used test video file = 777mb. When amount of Heap = 3GB he
got an OutOfMemoryException bwhen Heap = 4GB I got the file.
FileInputStream fstream=new FileInputStream(“big.avi”);ByteArrayOutputStream buffer = new ByteArrayOutputStream();int nRead;byte[] data = new byte[2048];while ((nRead = fstream.read(data, 0, data.length)) != -1) {buffer.write(data, 0, nRead);}buffer.flush();buffer.close();fstream.close();
development team was able to slightly reduce amount of required memory,
but size of inserted video is still depends on the size of Java heap
space. We recommend using the following code for adding large size video (This code is a little helping the Garbage Collector):
Please share, if I may help you further in this regard.PresentationEx pres=new PresentationEx();FileInputStream fstream=new FileInputStream(“big.avi”);ByteArrayOutputStream buffer = new ByteArrayOutputStream();int nRead;byte[] data = new byte[2048];while ((nRead = fstream.read(data, 0, data.length)) != -1) {buffer.write(data, 0, nRead);}buffer.flush();byte[] vidByte = buffer.toByteArray();buffer.close();fstream.close();VideoEx video=pres.getVideos().addVideo(vidByte);SlideEx slide=pres.getSlides().get_Item(0);VideoFrameEx vid=slide.getShapes().addVideoFrame(20f, 20f, 300f, 300f, null);vid.setEmbeddedVideo(video);pres.write(“presWithVideo.pptx”);
Hi Mudassir,
Hi Jatinder,
I have observed the feedback shared by you and like I have shared in my previous post here that size of inserted video is still depends on the size of Java heap
space and Ram size. When you are adding presentation programatically using Aspose.Slides, you are in fact adding a presentation in Document Object Model (DOM) of Aspose.Slides. The DOM is an extracted form of presentation that is loaded in memory. I agree that you may have successfully added a 30 GB presentation using PowerPoint. I have also share that feedback that when our development team tried adding a 777 MB file, they have to set the heap size of 4 GB for that. Likewise, for video file greater than 4 GB you may have some additional Ram and Heap size requirements.
Many Thanks,