Author Topic: AVIMux unexpected crash on a large file  (Read 1677 times)

Zalerinian

  • Noob
  • *
  • Posts: 5
AVIMux unexpected crash on a large file
« on: April 24, 2014, 06:49:54 am »
Environment Data: pastebin
File Size: 50GB (51,832,717 KB)
Used Codec: DXtory Codec (xtor)
Number of audio streams: 2

Now, what happens is that if I try to use AVIMux to put all the audio streams into one (doing audio separately), or trying to change the codec into something other software is more familiar with, I get an error saying that it crashed around the beginning of the file. Canceling before this point works fine. I believe the issue would be that AVIMux reads the file and keeps everything it reads in memory, even if it only is working with the audio stream (which explains why it happens when just doing audio). The file is compiled as a 32-bit application, which means that the memory space is is allowed to use is not very high in comparison to the filesize. Because it never unloads parts of the file that are read, it would need to consume significantly more memory. Therefore, it crashes upon not being able to load anymore of the file. This explains why it works fine if I cancel it earlier, it will just save what it has already read without memory issues and as the selected format. This occurs when the memory allocated to AVIMux reaches around 1,500 MB (According to the Windows 8 task manager).

Additionally, when trying to use AVIMux on the same file or any other file while not restarting DXtory, AVIMux will give a Builder.Init error of 0x8000FFFF. The file that was going to be written with the codec-changed data will still be written to the disk, however, VLC is unable to play it if it crashes. This is likely because AVIMux crashed and was not able to properly close the file wit the needed data.

TL;DR
AVIMux crashes when loading a big file because it has limited memory space and tries to load the entire file it is converting into memory. This causes it to crash from not having enough memory space (32-bit applications get very little memory compared to 64-bit).

Recommended Action:
Rebuild AVIMux (and possibly all of DXtory) as 64-bit applications so they can access more memory space, and change AVIMux to release file data from memory after it has been converted. Once the original data has been read and converted, start sending it to a temporary file so that it doesn't need to sit in memory, thereby reducing the amount of memory AVIMux uses, and avoiding further crashes of this nature.

Another TL;DR
Please change AVIMux to not keep the whole file it's changing / converted file in memory. I believe it'd be better to use temp files and not limited memory

:) Thank you for reading my long and hopefully informative bug report.

RobiePAX

  • Monster
  • ****
  • Posts: 274
Re: AVIMux unexpected crash on a large file
« Reply #1 on: April 24, 2014, 08:09:46 am »
This is Help & Support section. For Bug Reports you should have posted here. I'm sure your report will be useful and hopefully admin will read it.

As for possible workarounds you can always extract audio tracks from the video by right clicking and selecting extract audio streams if that is the only reason you used AVIMux. As for codec both Adobe Premiere Pro/Elements and Sony Vegas Pro/Movie Studio work perfectly fine with either Dxtory Codec or Lagarith Codec. Same can be said about CyberLink PowerDirector, Pinnacle Studio and Windows Movie Maker.

Zalerinian

  • Noob
  • *
  • Posts: 5
Re: AVIMux unexpected crash on a large file
« Reply #2 on: April 24, 2014, 10:45:48 am »
Well it isn't really so much a bug rather than an oversight, I suppose. I was hoping there'd be some other workaround though, as you mentioned with Premiere Pro and Sony Vegas. I do need the video as well, so I guess I'll install a trial and export it or something. Thank you, and I hope this can get fixed soon :)