How to display a 360 video frame by frame, for a desktop VR app in Unity?
Asked Answered
W

1

6

Is it possible to control a 360 degrees video to move forward or backward in time (frame +/- 1) by the means of an event, like pressing a controller button?

The idea here is to have an environment extracted from a video. The video should not play. When pressing a button, we can go to the next/previous frame.

Is there some documentation on this? I only found the Skybox-PanoramicBeta.shader.

Wifely answered 14/6, 2018 at 7:15 Comment(1)
What have you tried? If you have a video player you should be able to pause it and skip ahead or backwards by 1/60th of a second.Enchanting
W
2

Have you tried doing so by pausing the video and setting the frame?

https://docs.unity3d.com/ScriptReference/Video.VideoPlayer-frame.html

VideoPlayer.frame 
public long frame;

The frame index currently being displayed by the VideoPlayer. This will be 0 for the first frame of the clip, 1 for the second and so on.

https://docs.unity3d.com/ScriptReference/Video.VideoPlayer.html

Could you try something along the lines of;

public long currentFrame; // something to hold the frame that's currently paused
VideoPlayer.Pause(); // pause the video
currentFrame = VideoPlayer.frame; //set the current frame to the current frame
// then when you want to move to the next frame
void PlayNext()
{
    VideoPlayer.frame = currentFrame + 1; //set the frame being played to one more than the one saved
}
Wil answered 17/7, 2018 at 10:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.