PDA

View Full Version : Adding videos to .qrc file



SeN
13th November 2010, 10:22
Hi - I'm working on a Qt application for symbian, Qt 4.6.3 and Qt mobility 1.0.2.

My application will play a video using QMediaPlayer and QVideoWidget classes. I'd like the video file to be embedded in the application, not to be stored somewhere else in the phone memory or on a remote server. The video file isabout 10Mb mp4 file. So I'm trying to add the video to a .qrc file, but as soon as I add it to the .qrc file, I'm getting build errors like:

- out of memory allocating 65536 bytes
or, if I add a smaller .mp4 file
- error: section .data [00400000 -> 00400003] overlaps section .rodata [00012180 -> 007bd5c3]

I'm assuming I'm getting the errors due to the size of my mp4 file ... Is there a limitation for the size of the files? Also, I couldn't find information about what other video formats are supported by QMediaPlayer to play videos.

Thanks!

ardvark
26th November 2010, 15:38
The 'resource compile' converts your file into a 'C' array in a source file. If the array is gigantic, your compile and/or target CPU may have issues. You don't say what platform (CE, Symbian, Linux) or CPU (Arm, MIPS, PowerPC, x86, x86_64, ...). Also, you didn't say which command failed. Was it the 'rcc', your compiler or linker?

Typically the 'resource' was meant for picutures on bitmaps, stylesheets, etc.; a movie is a bit of an abuse. I have just created a 1MB resource file on Embedded QT Linux, so at least that is possible. You might try to re-code your video. What is your screen depth and length of the video? If you just grab the video from somewhere, it might be encoded at a resolution greater than your display, so that is just a waste.

Also, the resources will end up as part of a code section versus a file which the OS will load on demand. If you don't have swap, it is much better to keep the video as a file.