0

我正在尝试使用 Unity 中的视频播放器为 iOS 设备制作 4K 360 视频播放器。我构建和安装应用程序没有问题,但帧不断下降,而且我的视频非常不稳定。我导入了选中“Override for iPhone”和“Transcode”的视频,并且编解码器设置为 VP8。视频位于 Unity Assets 文件夹中。质量设置设置为“非常低”,我正在使用 videoPlayer.Prepare() 预加载视频,我尝试使用 MP4 和 OGV 的视频格式,但仍然得到断断续续的视频....

有人知道在 iOS 上播放 4K 360 视频的最佳设置是什么吗?

    private void Start()
    {
        LoadNewScene(firstDestination);
    }

    public void LoadNewScene(jumpPointData data)
    {
        DeleteAllJumpPoint();
        ChangeVideoClip(data.destinationVideoClip);
        SetRotation(data);
        GenerateJumpPoints(data);
        StartCoroutine(DisableFaderIfVideoStartPlaying());
    }

    private void ChangeVideoClip(VideoClip destination)
    {
        this.transform.GetComponent<VideoPlayer>().Stop();
        this.transform.GetComponent<VideoPlayer>().clip = destination;

        StartCoroutine(PlayIfLoaded());
    }

    private void SetRotation(jumpPointData data)
    {
        this.transform.rotation = Quaternion.Euler(-90, data.direction, 0);
    }

    public IEnumerator PlayIfLoaded(){
        VideoPlayer mainVideoPlayer = this.GetComponent<VideoPlayer>();
        while(!mainVideoPlayer.isPrepared){
            Debug.Log("Prepareing");
            yield return 0;
        }
        mainVideoPlayer.Play();
    }

    private IEnumerator DisableFaderIfVideoStartPlaying(){
        VideoPlayer mainVideoPlayer = this.GetComponent<VideoPlayer>();
        while (mainVideoPlayer.frame < mainVideoPlayer.frameRate * 1){
            yield return 0;
        }
        faderSphere.GetComponent<faderControl>().faderEnabled = false;
        yield break;
    }
4

1 回答 1

0

对于在 Unity 中播放视频,我建议查看以下插件:

在您的情况下,我建议您使用 Easy Movie Texture :)

hth。

于 2017-12-01T00:41:29.407 回答