1

I want to use a Qt external resource file as an expansion file for my Android app. The total size of the resource to be bundled in the resource file is 700+ MB. I have experienced that the resource compiler (rcc) can not handle more than about 500MB before it hangs and crash on my computer. I would really want to make on big file as this makes it a lot easier when uploading expansion files for Android.

I run the rcc tool from the commandline with the following arguments:

rcc -binary -no-compression myQrcFile.qrc -o myOutputFile

I need to use no compression to be able to play video files bundled in the resource file directly, but this is not a problem here.

I have two questions, but the first one is the primary one:

  1. Is there some way to bundle files with a total file size of more than 500MB in one file?
  2. Does the size of an external Qt resource file have an impact on the performance of the application? Larger file = slow load or similar?
uniquenamehere
  • 1,869
  • 3
  • 31
  • 60
  • Interesting use-case. Is the data maps or s-th? Is it possible to split the data? – Valentin H Aug 17 '15 at 05:47
  • @ValentinHeinitz: The data is video and images. It is possible to split the data, but then I would have to compress it to one file and decompress it on the target (Android device). This increases the complexity and I want to avoid it if possible. I personally believe that the RCC tool should be able to have more than 500 MB per file. – uniquenamehere Aug 17 '15 at 21:06

2 Answers2

0

For creating a smaller resource data, you may try to change the compression (s, -compress)

For the faster loading, there seems to be two possibilities to embedd the resources in Qt.

Unless you specify explicitly to create the resources-data as an external library, the resource data is embedded in the executable and will be loaded at the application start (make sense for app-icons, fonts, etc)

If you compile the data with the -binary option

rcc -binary myresource.qrc -o myresource.rcc

you'll build the data into a dynamic library, which you may load at a later point than the application-start with the call

QResource::registerResource("/path/to/myresource.rcc");

Here is a similar quistion on SO, which however is focused on dynamic loading of resources, no on the size: How can I embed a Qt resource into a .dll file?

These links should be helpful:

Community
  • 1
  • 1
Valentin H
  • 7,240
  • 12
  • 61
  • 111
  • Compression is not an option as video can not be played properly if the resource file is compressed. It also does not help as it is the original file size before compression that seems to be the limiting factor. I specified *external* binary resource file in the question title as I am not adding it to the executable. I am using the QResource class. The problem in this question is that the resource compiler (rcc) tool can not package more than 500MB in one file. – uniquenamehere Aug 17 '15 at 21:09
  • I am agree. in some situation compression is not good or helpful. – S.M.Mousavi Oct 31 '16 at 18:18
0

I used MinGW which is a 32-bit compiler. I changed to MSVC 64-bit compiler and I could create large external resource files.

uniquenamehere
  • 1,869
  • 3
  • 31
  • 60