1

I am developing a Qt application which will have a video playing in the center of the screen. This video is included locally for the application. I am new to Qt development, and thus far I have only seen examples of including resources in the .qrc file.

When I add the video (which is about 2 minutes long), compilation takes approximately 8-10 minutes. Normally it takes between 1-3 seconds to compile.

Is there a way to include a large file (such as a video) to be packaged and distributed with the application?

1 Answers1

1

Adding a large resource like a video to the qrc file carries some overhead, so it's best to avoid using it there. What I would personally do differs from each platform, so I've broken it down:

  1. Windows: ship a .exe installer package with the video file in a folder, so when it's installed the video file is in a specific path relative to the application binary, then load the video file from there.
  2. OS X: ship a .dmg containing the .app bundle, use the QMAKE_BUNDLE_DATA build command to copy the video file into .app bundle, so it's in a specific path relative to the application binary.
  3. Linux: this entirely depends on how you want to distribute, if you're distributing as an installable package (for apt, or yum) then add the video file into the install package, if it's as a .tar.gz then add the video to that.
Nicholas Smith
  • 11,642
  • 6
  • 37
  • 55
  • Thanks, I am testing this on MAC OS X, but it will be distributed on Linux. If I am trying access this video file from qml, is it possible? – lechlitnerd Dec 03 '15 at 17:04
  • I found the answer in this question: http://stackoverflow.com/questions/27549708/qml-how-to-specify-image-file-path-relative-to-application-folder – lechlitnerd Dec 03 '15 at 17:26