cancel
Showing results for 
Search instead for 
Did you mean: 

Expansion File Bundled Scene Not Loading Video (Go)

Anonymous
Not applicable
Hello,
I recently used this tutorial from Gabor to attempt to get around size limitations for apks by creating an asset bundle and turning it into an expansion file. My app is essentially an interactive video player, with a 3.65GB video, in a single scene. I removed the scene from the build list, turned it into an asset bundle obb and created a new scene that loads the asset bundle and starts the loaded scene, it works in loading the scene and the interface, except the video doesn't play. Using Unity 2018.3.6f1 and Oculus SDK 1.34.

Any help would be greatly appreciated, thanks!
10 REPLIES 10

Anonymous
Not applicable
You might have to pass the video file name to the player again.  Before it was an asset bundle, it might have had a reference to the video.  The switch to the asset bundle might have changed when things are compiled or referenced.  I would try a null check at the start of the run video script to make sure it has the name of the file to play.  Just a thought/ guess though.

ivan_martinieto
Honored Guest
Hi!

I'm working in a similar app and I'm doing the same tutorial but I have a lot o doubts becouse it's my first "asset bundle":
I have 4 scenes, first scene (0) go in the apk and the another 3 go in the asset bundle .obb with the video files.

 I'm using "Oculus Alpha channel" to upload the apk and asset bundle .obb. I need to use the command "BuildAssetBundles or AssetBundle.LoadFromFile("/sdcard/Android/obb/main.1.com.oculus.demo.obb");" to load de .obb file, or the "Oculus alpha channel" decompress automatically the asset bundle in the same folder?

Anonymous
Not applicable
Found the solution, videos in a compressed asset bundle won't work, apparently something to do with interfering with the video's own compression. Solution is to change your bundle build script, so where the Oculus-suggested code says:
BuildPipeline.BuildAssetBundles("AssetBundles", BuildAssetBundleOptions.ChunkBasedCompression, BuildTarget.Android);
You want to change to:
BuildPipeline.BuildAssetBundles("AssetBundles", BuildAssetBundleOptions.UncompressedAssetBundle | BuildAssetBundleOptions.ForceRebuildAssetBundle, BuildTarget.Android);
This way you can have a small (in my case 50mb) apk, and an obb that contains a large video (in my case 3.65gb).

Hope this helps anyone with a similar problem!

Hi
I am having trouble with Out of Memory issues when trying to load.extract  a 1GB movie (.byte file) from an asset bundle.
I'm interested in the solution here of adding the entire scene to the asset bundle and not just the movie.
If you don't mind me asking are you using the standard Unity VideoPlayer or something else like Easy Movie Texture?

Anonymous
Not applicable
I'm using the native Unity VideoPlayer, but I think AVPro Video might be better all round, I haven't made the switch for this particular project but in another I found AVPro performed much better. As far as I'm aware as long as you're not compressing the assetbundle, any video player will work.

Thanks for the quick reply. 
Creating the asset bundle with the mp4 flagged as a video clip worked perfectly.
Cheers

robertcoomber
Expert Protege
@BDHVR process worked for me as well. 


SamElTerrible
Honored Guest
Hi!
I'm also working with my first asset bundle, but I'm struggling to figure out how to play a video from the asset bundle on AV pro

I can load the bundle normally using AssetBundle.LoadFromFileAsync(). However, AV pro requires you to pass in an absolute path or URI to play a video.

I can do assetBundle.LoadAsset to load the .mp4, but this still doesn't give me a URI to feed into AV pro.

Does anyone know how I could get this working?

Thanks!

SamElTerrible
Honored Guest
Update: Av pro can also play a video from a byte[], so the other option is to convert the .mp4 into a byte[] and play it. I still need to figure out how to do this...