Search Unity

How to disable Caching.compressionEnabled when caching a Videoclip-included addressable bundle?

Discussion in 'Addressables' started by luoyu510183, Sep 6, 2019.

  1. luoyu510183

    luoyu510183

    Joined:
    Dec 25, 2018
    Posts:
    18
    In the beginning, I got this error message when failing to load a video clip in an addressable bundle:

    AndroidVideoMedia::OpenExtractor could not translate archive:/CAB-5b4cd0a92d354858f98b1392dd686137/CAB-5b4cd0a92d354858f98b1392dd686137.resource to local file. Make sure file exists, is on disk (not in memory) and not compressed.
    AndroidVideoMedia: Error opening extractor: -10004

    By disabling Caching.compressionEnabled and selecting 'Uncompressed' in the Videoclip-included addressable group's BundledAssetGroupSchema, I finally loaded the video clips from the addressable bundle successfully.
    But there comes another problem, it's that disabling Caching.compressionEnabled in global scope will increase a lot of memory for caching textures, eg. the size of a 1080p texture will be 5.9M.

    So is there a solution that it only disables Caching.compressionEnabled when caching a Videoclip-included addressable bundle?
     
    phobos2077 likes this.
  2. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464
    Thanks for sharing the tips on Caching.compressionEnabled. You also digged into these threads shows it's a known and unsolved issue.
    https://forum.unity.com/threads/how-to-play-video-from-adressable-assetbundle-on-android.685261/
    https://forum.unity.com/threads/addressable-videos-not-working-on-android.588832/#post-4472347

    So you either serving the video out of addressables.
    Or you can try toggling the flag of Caching.compressionEnabled before/after downloading a video included asset bundle. As the documentation of comrpessionEnabled says 'This property affects only further downloads. It doesn't compress or decompress existing content in the cache.'. However it's ugly as it sounds...
     
  3. luoyu510183

    luoyu510183

    Joined:
    Dec 25, 2018
    Posts:
    18
    Thanks for your reply!
    One more tip. For .mov and .mp4 files I tested, it's okay to select 'LZ4' for Compression in their addressable group's BundledAssetGroupSchema. It seems that only Caching.compressionEnabled matters in my project.