How to embed Video files in my application?



  • I was wondering if there is any way to embed Big Video files into my application without getting "Compiler Out Of Heap Space" errors???


  • Lifetime Qt Champion

    Hi,

    Using rcc ? AFAIK no, it's not meant to be used for that and you really don't want to have to load an exec that weighs several gigs only because of embedded videos. You should rather follow the video game pattern: have this kind of stuff as external dependencies.



  • Thanks SGaist.
    Actually it's not some gigabytes but rather something around 25 megabytes that I'm trying to embed here without any luck. So, I didn't mean that much big files. Do you have any idea how can I get past this error?
    By the way the reason I want to do this is just a matter of protecting some animation video that I don't want my customer to copy it.



  • Hi amahta,

    I don't thinks that's even possible. Why not modify the video file by adding some binary strings on it that way the video can't be opened by your customers and when you needed the video just remove those binary strings on the video file so you could play it.



  • Thanks minds, but I think I still have some hope :) cause I've seen executables like that but I'm not sure how they're embedding those. As for encrypting my video file, you're right that is also a solution.



  • [EDIT]
    Create a class library in VS and embed your video there then compile the dll. You can then use the dll into your project and read the video there. I haven't tried this though. But I believe the project would definitely compile.


  • Moderators

    bq. By the way the reason I want to do this is just a matter of protecting some animation video that I don’t want my customer to copy it.

    I guess even if you embed the video as is in the rcc and compile it to an exe, the video can be extracted. There are tools available,
    E.g
    "resources_extract":http://www.nirsoft.net/utils/resources_extract.html

    So the best way would be to encrypt the video before putting it into the rcc.



  • [quote author="p3c0" date="1384249611"] I guess even if you embed the video as is in the rcc and compile it to an exe, the video can be extracted. There are tools available,
    E.g
    "resources_extract":http://www.nirsoft.net/utils/resources_extract.html

    So the best way would be to encrypt the video before putting it into the rcc.
    [/quote]
    Thanks but let's say my customer won't go that far looking for tools to extract it. :) And the problem here is that I can't embed it into my program. (You can read my first post)


  • Moderators

    Since the video file is too large the compiled cpp code will be also too large and hence the “Compiler Out Of Heap Space” errors. If you split your video file in parts and add those splitted parts in separate qrc files i guess it may work. But then you will need to find a way to merge those files again.



  • [quote author="p3c0" date="1384252348"]Since the video file is too large the compiled cpp code will be also too large and hence the “Compiler Out Of Heap Space” errors. [/quote]

    The "Compiler Out Of Heap Space" error will occur during compilation thus no compiled code is produced so your conclusion is wrong, it is not because the compiled cpp code is too large. Now that you mention it I think I have encountered this before on a compiler that I have developed and as far as I remember this is due to lack of memory of the pc running the program I might be wrong though it's been two years.
    Anyways, amahta I've edited my post above and why don't you give it a try.



  • Not so sure about what "compiled cpp code is too large" means.
    Lack of memory is also out of question.
    I think it's just a matter of configuring compiler. I'll share the result if I find a solution.


  • Moderators

    bq. The “Compiler Out Of Heap Space” error will occur during compilation thus no compiled code is produced so your conclusion is wrong, it is not because the compiled cpp code is too large.

    @minds, i meant the resource file to cpp file which is converted by the rcc tool. As this converted cpp file will be too large to compile the virtual memory may be exhausted.



  • maybe the compiler has a memory limit that might be configurable.

    @p3c0, just wanted to be clear


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.