Search Unity

Video AndroidVideoMedia: Error opening extractor: -10000

Discussion in 'Audio & Video' started by Brad-Newman, Jan 10, 2020.

  1. Brad-Newman

    Brad-Newman

    Joined:
    Feb 7, 2013
    Posts:
    185
    I've seen the other threads discussing this error, but none of the solutions have helped, so I'm starting yet another thread for this error.

    My specs are:

    Unity
    - 2019.2.17f1
    - Minimum API Level: Android 7.0
    - Target API: Automatic (highest installed)
    - Asset Bundles are uncompressed.

    Android Device: Pico 4K VR Headset
    - Running Android 8.1.0

    Videos
    - 360 videos playing back on skybox material.
    - Around 3840 x 3840 to 4096 x 4096
    - MP4, H.264 for the most part.
    - Bit Rates around 80 Mbps

    Code
    I'm loading videos from an uncompressed asset bundle in the persistent data folder, like so:
    Code (CSharp):
    1. string persistentDataPath = Path.Combine(Application.persistentDataPath);
    2. AssetBundleCreateRequest assetBundleCreateRequest = AssetBundle.LoadFromFileAsync(path);
    followed by loading a relevant video with:
    Code (CSharp):
    1. AssetBundleRequest loadVideoRequest = videosAssetBundle.LoadAssetAsync<VideoClip>(name);
    I build my asset bundles with:
    Code (CSharp):
    1.  
    2. AssetBundleManifest assetBundlesManifest = BuildPipeline.BuildAssetBundles
    3.         (
    4.             AssetBundleBuildFolder.dirForAndroidAssetBundles,
    5.             BuildAssetBundleOptions.UncompressedAssetBundle | BuildAssetBundleOptions.ForceRebuildAssetBundle,
    6.             BuildTarget.Android
    7.         );
    8.  
    And build my APK with uncompressed settings as well:
    Code (CSharp):
    1. BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions
    2.         {
    3.             scenes = new[] { "Assets/Scenes/Client.unity" },
    4.             locationPathName = dirForAPK + "Client.apk",
    5.             target = BuildTarget.Android,
    6.             targetGroup = BuildTargetGroup.Android
    7.         };
    8.  
    9.         BuildOptions buildOptions = BuildOptions.UncompressedAssetBundle | BuildOptions.ConnectToHost | BuildOptions.AllowDebugging | BuildOptions.AutoRunPlayer | BuildOptions.Development;
    10.         buildPlayerOptions.options = buildOptions;
    11.  
    12.         BuildPipeline.BuildPlayer(buildPlayerOptions);
    13.  
    Everything works fine with bundles below 5 GB, but somewhere around 5 GB, I start seeing this error. The only pattern I've been able to see is that videos lower in the alphabetical list tend to trigger this error.

    Test Case 1
    I build an uncompressed asset bundle that's a little over 4GB with about 6 videos in it. All videos play back just fine on the Android device.

    Test Case 2
    Added a video that pushes asset bundle over 5 GB, and the very last video triggered this error:

    Warn MediaExtractor: FAILED to autodetect media content.
    Error MediaExtractor: Trace connect 0x0 0xbf64fd00
    Error NdkMediaExtractor: sf error code: -1010
    Warn Unity: AndroidVideoMedia: Error opening extractor: -10000
    Warn Unity: (Filename: ./PlatformDependent/AndroidPlayer/Modules/Video/Private/AndroidVideoMedia.cpp Line: 461)


    Test Case 3
    So I removed this last video, and all the videos play back fine.

    Test Case 4
    Then I added a different video that also appears at the end of the list, and all videos played back fine, including this last one. But the second to last video (which played fine in Test Case 2) now doesn't play and triggers this error:
    Error NdkMediaExtractor: sf error code: -1010
    Warn Unity: AndroidVideoMedia: Error opening extractor: -10000
    (Filename: ./PlatformDependent/AndroidPlayer/Modules/Video/Private/AndroidVideoMedia.cpp Line: 461)


    Any ideas how to workaround it? Has anyone used asset store solutions for video playback? I remember AV Pro working well for Windows 360 videos, but haven't tried AV Pro Android: https://assetstore.unity.com/packages/tools/video/avpro-video-android-52745#description
     
  2. Brad-Newman

    Brad-Newman

    Joined:
    Feb 7, 2013
    Posts:
    185
    I restricted my asset bundles to be less than 3GB (maybe you only need to be below 5GB, I wanted to play it safe). I then search through all the asset bundles to find a matching video. Preliminary testing has not reproduced the extractor error, and I can play all the videos! Fingers crossed this solution works while doing further testing and scales with more videos.