Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Video: Support for reading videos from AssetBundles on Android.

Discussion in '2018.1 Beta' started by Algorythma, Jan 24, 2018.

  1. Algorythma

    Algorythma

    Joined:
    Jun 12, 2017
    Posts:
    4
    it is still not working in new beta
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619
    Unity staff is probably going to ask you to submit a bug-report, following the advice given in this document. If you want to speed things up, it's probably a good idea to submit that bug-report already and post its case number here for UT to pick up.

    Using the bug-reporter seems to be an important step, because it makes sure the report is in Unity Technologies bug-tracking pipeline, has to be processed at some point. Using the forum is often used to add to a little more attention to a bug-report, but does not replace submitting the bug-report.

    It's from advantage to attach a project to the bug-report that UT can use to reproduce the issue and test their fix against. Attaching a video to the bug-report that shows how to reproduce the issue and the issue itself, has been proven useful too.

    The easier an issue can be reproduced by QA, the more likely it is to get forwarded to a developer, who might or might not work on a bug-fix for that at some point.

    After you submitted the bug-report, you receive a confirmation email with a Case number. UT often asks us to post the Case number in the forum thread, which allows them to find that bug-report if they look at your post.

    Following these steps will increase the chance that UT is looking at your issue tremendously.
     
  3. Algorythma

    Algorythma

    Joined:
    Jun 12, 2017
    Posts:
    4
    AndroidVideoMedia::OpenExtractor could not translate archive:/CAB-97aa053788635746910fc29e0aef14a3/CAB-97aa053788635746910fc29e0aef14a3.resource to local file. Make sure file exists, is on disk (not in memory) and not compressed.

    This is the error i get in Android Studio
     
  4. Algorythma

    Algorythma

    Joined:
    Jun 12, 2017
    Posts:
    4
    still same issue with beta 7

    AndroidVideoMedia::OpenExtractor could not translate archive:/CAB-97aa053788635746910fc29e0aef14a3/CAB-97aa053788635746910fc29e0aef14a3.resource to local file. Make sure file exists, is on disk (not in memory) and not compressed.

    AndroidVideoMedia: Error opening extractor: -10004
     
    allen_fang likes this.
  5. DominiqueLrx

    DominiqueLrx

    Unity Technologies

    Joined:
    Dec 14, 2016
    Posts:
    260
    Hey Alrorythma!

    Sorry to hear you're having trouble with videos in Android asset bundles. One limitation in there is that the asset bundle must be uncompressed for the videos in there to be usable by the Android video system. Future refinements to asset bundles may make the compression settable on a per-entry basis in the asset bundle, but for now the whole bundle has to be uncompressed.

    This is the basic script I used to create asset bundles while implementing support for this:

    Code (CSharp):
    1. using System.IO;
    2. using UnityEditor;
    3.  
    4. public class CreateAssetBundles
    5. {
    6.     [MenuItem("Assets/Build AssetBundles")]
    7.     static void BuildAllAssetBundles()
    8.     {
    9.         string assetBundleDirectory = "Assets/StreamingAssets";
    10.  
    11.         if (!Directory.Exists(assetBundleDirectory))
    12.             Directory.CreateDirectory(assetBundleDirectory);
    13.  
    14.         BuildPipeline.BuildAssetBundles(
    15.             assetBundleDirectory,
    16.             BuildAssetBundleOptions.UncompressedAssetBundle | BuildAssetBundleOptions.ForceRebuildAssetBundle,
    17.             BuildTarget.Android
    18.         );
    19.     }
    20. }
    One thing to note is that, when I was working on this, the gradle build system made it difficult (although not impossible) to add an asset bundle into an apk without the asset bundle being compressed. The legacy build system made it easier, but gradle requires that you name your asset bundle with an extension that will be picked up by the gradle aaptOptions noCompress template option. For example:

    Code (CSharp):
    1.     aaptOptions {
    2.         noCompress '.unity3d', '.ress', '.resource', '.obb', '.abd'
    3.     }
    In this example, the ".abd" extension is a made-up extension that I was using to name my bundles (for Asset BunDle...). So naming my asset bundles "my_test_asset_bundle.abd" - in the asset bundle name text field- , the .abd extension would end up disabling compression for asset bundles included in apks when picked up by the gradle build system. Note that you can gain control of the gradle build system options using the method described here: https://docs.unity3d.com/2018.1/Documentation/Manual/android-gradle-overview.html

    Let us know if this is helping in any way!

    Dominique
    A/V developer at Unity
     
    fbigger, ankushsngh93 and IM_prove like this.
  6. Algorythma

    Algorythma

    Joined:
    Jun 12, 2017
    Posts:
    4
    ok
    I was trying to download the bundle from server and trying to access video while it was in memory
    but when i save the bundle at a local destination , i can access the video

    So it works if the bundle is saved , but doesn't works if the bundle is in memory or in cache
     
  7. JessicaLee88

    JessicaLee88

    Joined:
    Feb 14, 2018
    Posts:
    13
    Does anyone know if Unity Patch Release 2017.3.1p3 has the same level of video support as 2018.1 Beta for Android - if we use uncompressed asset bundles in 2017.3.1p3, can video playback work properly?
     
  8. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Please check the release notes.
     
  9. nilsdr

    nilsdr

    Joined:
    Oct 24, 2017
    Posts:
    374
    Is this still the case? It can not work in conjunction with asset bundle caching?