Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 419
Deewy Avatar asked Jun 14 '18 07:06

Deewy


1 Answers

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
}
like image 118
Samantha Jones Avatar answered Oct 26 '22 23:10

Samantha Jones