Coder Social home page Coder Social logo

03050903 / 360-video-player-for-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fbsamples/360-video-player-for-android

0.0 2.0 0.0 47.35 MB

Sample code for creating a 360 video player on Android. Creates an OpenGL ES scene that renders a sphere textured with video frames from MediaPlayer playback. Does not use the NDK. This is a simple example of the core elements of 360 video rendering and is not intended to be production quality code. The code may be unstable. This is won't be maintained.

License: Other

Java 98.73% GLSL 1.27%

360-video-player-for-android's Introduction

360 Video Player for Android

360 video is the new hotness in interactive media. Imagine teleporting yourself to the most interesting places in the world, training with Lebron James, or speeding across the Jakku desert from Star Wars. These are the kinds of immersive experiences that 360 video enables.

Enclosed you'll find a sample Android application that demonstrates how to playback 360 video, specifically equirectangular video, using MediaPlayer, TextureView, and OpenGL ES. Touch and drag is supported to adjust the yaw and the pitch to see more of the 360 video.

The launch activity will load a sample 360 video included in: res/raw/sample360.mp4

Today's 360 cameras generally either output directly in equirectangular format or provide software to convert to equirectangular. Facebook ingests 360 videos in equirectangular format.

Visit:

Disclaimer

  • This code is intended as an example and is by no means production quality.
  • It may not be entirely stable.
  • It has been tested on limited high end Android devices
    • Works on Genymotion with Nexus 5 (5.1.0).
    • Didn't work on the new Android Studio 2.1 Preview 1 emulator (Nexus 5X AVD with HAX enabled).
  • It's not intended as a demonstration of "the right way" to do things.
  • It will not be supported.

Requirements

Requires Android OS version KitKat (4.0) or higher.

To build you'll need the Android SDK with build tools.

Note: the gradle project was created with Android Studio Preview 2.1 Preview 1

The included sample video is 4k 30fps so be sure to use an Android device that can handle that video decode.

GearVR compatible devices such as the Note4, Note5, S6, S7, should have no issues with video decode performance.

Usage

Android Studio

Open the directory in Android Studio and the gradle project should be imported. Run & Debug options should allow you to build the project.

Command Line

Assure you have a local.properties file in the top level directory with: sdk.dir=/path/to/your/Android/sdk

$ gradlew installDebug
$ adb shell am start -n com.oculus.sample/.SphericalPlayerActivity

360-video-player-for-android's People

Contributors

03lafaye avatar jamesgpearce avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.