sannies / mp4parser

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

Generate lots of huge size tmp MediaDataBox files after cutting and appending MP4 clips #315

Closed evanQD closed 5 years ago

evanQD commented 6 years ago

Hi,

I found lots of huge size tmp files after cutting and appending MP4 clips: Any solution I can apply?

isoparser and muxer version is 1.9.34.

[root@localhost temp]# du -h * 11M MediaDataBox3353323537304459708org.mp4parser.boxes.iso14496.part12.MediaDataBox@648dabab 38M MediaDataBox4936790949145394189org.mp4parser.boxes.iso14496.part12.MediaDataBox@2d9239fc 5.8M MediaDataBox533456596869457275org.mp4parser.boxes.iso14496.part12.MediaDataBox@334394a1 3.1G MediaDataBox8634033729187507380org.mp4parser.boxes.iso14496.part12.MediaDataBox@2f5cd9a4

Thanks Evan

avanibhatnagar commented 6 years ago

Hey sorry this is another question and not an answer.. I added the muxer dependency in pom.xml, but it still says can't resolve 'muxer', and I get the following errors:

image

I was hoping you could help me?

lonely-lockley commented 5 years ago

Met this problem too. I've run out of /tmp space when just wanted to list and display video and audio streams metadata. I expected that /tmp will be cleared when i call .close() on an IsoFile instance, but it does not. Is it really necessary to unpack the full media into /tmp when i'm just reading content?

thomasburguiere commented 5 years ago

Hello

Thanks a lot for this fix (https://github.com/sannies/mp4parser/commit/7bc0bbb638fba8bfa078172b07fb6b4a60d3894c), but I think it will not solve the issue on server-side applications. Since the process never exists, the files will not be deleted, and that leads to running out of disk space (which can cause the application to crash).

I think mp4parser should provide a way to free up resources such as disk space.

best regards

neorevx commented 4 years ago

I have same problem. Any one know where I can access MediaDataBox to change source files and delete tmp file?

scooter1556 commented 4 years ago

I am using this library as part of a server-side media transcoding solution and have realised today that my /tmp directory is consuming 150GB and contains hundreds of MediaDataBox* files. The application isn't designed to be restarted frequently and can run for weeks/months/years which makes this a big issue. Is there an alternative way to ensure temp files get cleaned up on closing of an IsoFile? The only other thing I can think to do is add a routine to frequently check for temp files and delete them but this isn't ideal and seems hacky.