sannies / mp4parser

A Java API to read, write and create MP4 files
Apache License 2.0
2.74k stars 563 forks source link

java.lang.OutOfMemoryError: Direct buffer memory #457

Open JakeWoki opened 1 year ago

JakeWoki commented 1 year ago
java.lang.OutOfMemoryError: Direct buffer memory
    at java.nio.Bits.reserveMemory(Bits.java:695)
    at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:123)
    at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:311)
    at org.mp4parser.support.AbstractBox.parse(AbstractBox.java:95)
    at org.mp4parser.AbstractBoxParser.parseBox(AbstractBoxParser.java:107)
    at org.mp4parser.BasicContainer.initContainer(BasicContainer.java:107)
    at org.mp4parser.IsoFile.<init>(IsoFile.java:55)
    at org.mp4parser.IsoFile.<init>(IsoFile.java:38)
    at com.xxx.controller.LiveController.update(LiveController.kt:84)
    at com.xxx.controller.LiveController.dvr$lambda-0(LiveController.kt:74)
    at java.lang.Thread.run(Thread.java:748)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
val fileName = "xxx.flv"
val file = File(fileName)
println("${fileName}======>>${file.length()}")
val isoFile = IsoFile(fileName)
println("${isoFile.movieBox.movieHeaderBox.duration}============")