こんにちは。いつもお世話になっております。UnityでiOS向けの360VR動画を再生するアプリを作っているのですが、どうも動作が重くフレームが落ちてしまい困っています。ビルドとインストールには全く問題はありません。すでにやってみたことは、動画のインポート設定の「Override for iPhone」, 「Transcode」にチェックをし、コーデックはVP8に変更、動画自体はUnityのAssetsフォルダに入れています。Quality SettingはVery Lowに、videoPlayer.Prepare()
を使いプリロードをして、動画のフォーマットはMP4とOGVを試してみましたが、やはり治らず。。。
どなたか4Kの360をiOSで再生することに成功した方おられませんか?どうかご教授ください。よろしくお願いいたします。
c#
1 private void Start() 2 { 3 LoadNewScene(firstDestination); 4 } 5 6 public void LoadNewScene(jumpPointData data) 7 { 8 DeleteAllJumpPoint(); 9 ChangeVideoClip(data.destinationVideoClip); 10 SetRotation(data); 11 GenerateJumpPoints(data); 12 StartCoroutine(DisableFaderIfVideoStartPlaying()); 13 } 14 15 private void ChangeVideoClip(VideoClip destination) 16 { 17 this.transform.GetComponent<VideoPlayer>().Stop(); 18 this.transform.GetComponent<VideoPlayer>().clip = destination; 19 20 StartCoroutine(PlayIfLoaded()); 21 } 22 23 private void SetRotation(jumpPointData data) 24 { 25 this.transform.rotation = Quaternion.Euler(-90, data.direction, 0); 26 } 27 28 public IEnumerator PlayIfLoaded(){ 29 VideoPlayer mainVideoPlayer = this.GetComponent<VideoPlayer>(); 30 while(!mainVideoPlayer.isPrepared){ 31 Debug.Log("Prepareing"); 32 yield return 0; 33 } 34 mainVideoPlayer.Play(); 35 } 36 37 private IEnumerator DisableFaderIfVideoStartPlaying(){ 38 VideoPlayer mainVideoPlayer = this.GetComponent<VideoPlayer>(); 39 while (mainVideoPlayer.frame < mainVideoPlayer.frameRate * 1){ 40 yield return 0; 41 } 42 faderSphere.GetComponent<faderControl>().faderEnabled = false; 43 yield break; 44 }
