How to get 360 VR video in the correct format for Android VR View

I think I realized that I came across my original question here . When I uploaded 360 videos, they look like a regular video file:

Regular video

But for the VR View to work properly, you need to split the video as follows:

VR video

Is there a way to convert downloaded 360 videos to VR format (two-screen) or can I programmatically configure the application to receive a 360 mp4 file and display it without over-enlarging or decreasing in certain areas of the video?

Extract from my xml file:

<com.google.vr.sdk.widgets.video.VrVideoView
    android:id="@id/video_view"
    android:layout_width="match_parent"
    android:layout_height="250dip"
    android:scrollbars="null" /> 
+4
source share
1 answer

, , , VrVideoView , . , , , .

VR, Google VR SDK: . , , . , (/ /) , . Google VR / .

, , 360 ( ), VR SDK :

VrVideoView vrVideoView;

// initialize the view here

Options options = new Options();

// This tells the player that the video is a monoscopic 360 video
options.inputType = Options.TYPE_MONO;

// This tells the player that it should play using HLS or progressive video play
// If you are linking to a single video file, use default.
options.inputFormat = Options.FORMAT_DEFAULT;

// Assuming you've downloaded the video...
vrVideoView.loadVideoFromAssets("my-video.mp4", options);
vrVideoView.playVideo();

, / 360, , :

VrVideoView vrVideoView;

// initialize the view here

Options options = new Options();

// This tells the player that the video is a stereoscopic top/bottom 360 video
options.inputType = Options.TYPE_STEREO_OVER_UNDER;

// This tells the player that it should play using HLS or progressive video play
// If you are linking to a single video file, use default.
options.inputFormat = Options.FORMAT_DEFAULT;

// Assuming you've downloaded the video...
vrVideoView.loadVideoFromAssets("my-video.mp4", options);
vrVideoView.playVideo();

, , . VR. - , 360- , . , , . , , VR. ( : VrVideoView ):

// This displays the video as inside the normal bounds for viewing without the VR goggles.
vrVideoView.setDisplayMode(DisplayMode.EMBEDDED);

// If you want to go full-screen without goggles...
vrVideoView.setDisplayMode(DisplayMode.FULLSCREEN_MONO);

// If you want to go full-screen and use goggles...
vrVideoView.setDisplayMode(DisplayMode.FULLSCREEN_STEREO);

, Options DisplayMode. Options , , . DisplayMode . , , . , , , , , .

, . , .

+5

Source: https://habr.com/ru/post/1667780/


All Articles