titansgroup / k4l-video-trimmer

A library with UI and mechanisms to trim local videos on Android applications.
MIT License
784 stars 221 forks source link

Out Of Memory Error on Android #35

Open gmrm opened 7 years ago

gmrm commented 7 years ago
Include the following:
Reproduction Steps

1.pick a video from gallery Note: selected video must be large movie of type .mkv OR .TS

  1. Select some duration and trim
  2. It will reproduce the error and app will be crashed
Expected Result
Actual Result

I am pasting the logs of the error here //***

09-14 13:38:24.406 27003-27378/com.app.hotspot4beauty E/UncaughtException: java.lang.OutOfMemoryError: Failed to allocate a 1195376660 byte allocation with 13769380 free bytes and 108MB until OOM at java.nio.ByteBuffer.allocate(ByteBuffer.java:56) at com.googlecode.mp4parser.AbstractBox.parse(AbstractBox.java:110) at com.coremedia.iso.AbstractBoxParser.parseBox(AbstractBoxParser.java:107) at com.googlecode.mp4parser.BasicContainer.next(BasicContainer.java:185) at com.googlecode.mp4parser.BasicContainer.hasNext(BasicContainer.java:161) at com.googlecode.mp4parser.util.LazyList$1.hasNext(LazyList.java:55) at com.coremedia.iso.IsoFile.getMovieBox(IsoFile.java:102) at com.googlecode.mp4parser.authoring.container.mp4.MovieCreator.build(MovieCreator.java:51) at life.knowledge4.videotrimmer.utils.TrimVideoUtils.genVideoUsingMp4Parser(TrimVideoUtils.java:71) at life.knowledge4.videotrimmer.utils.TrimVideoUtils.startTrim(TrimVideoUtils.java:65) at life.knowledge4.videotrimmer.K4LVideoTrimmer$11.execute(K4LVideoTrimmer.java:293) at life.knowledge4.videotrimmer.utils.BackgroundExecutor$Task.run(BackgroundExecutor.java:212) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:154) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818) //**

Tell us what could be improved:

ameenmaheen commented 6 years ago

any update on this one

Nakuls426 commented 3 years ago

Call your method inside the AsyncTask.