cancel
Showing results for 
Search instead for 
Did you mean: 

Unity android video texture plugin that works?

borutwm
Honored Guest
Maybe a little off topic but I thought there'd be a decent chance someone here might know. I'm trying to play a video on an object in a scene in Unity - since Unity's MovieTexture doesn't work on mobile I've tried the two plugins I know of that support android video textures, but neither seem to work. I've tried MobileMovieTexture and EasyVideotexture but neither work:

MobileMovieTexture: just importing the plugin into the project breaks all our other plugin dlls from loading (including OculusPlugin.dll). I've looked into if it was a dll dependency issue (which would still be odd b/c it breaks loading for perfectly fine dlls). It may be an issue w/this plugin not supporting Unity 4.5 (if one of the asset store reviews is to be believed).

EasyVideoTexture: It won't play the video on device. Digging into logcat I get a bunch of "E/GLConsumer: checkAndUpdateEglState: invalid current EGLDisplay" errors when it's trying to update the texture.

Anybody know on any plugins to do this on android that work?

Thanks,
Borut
16 REPLIES 16

IronMan
Honored Guest
It's in the SDKExamples folder.. in the latest SDK

blazejwojtyla
Honored Guest
Hi,

We've got problem using MoviePlayerSample.cs in Unity.

We've modified the MediaSurface file to work with higher resolution videos, rebuilt vrlib and libOculusPlugin, and the App mostly crashes at startup, (but sometimes, like one in ten tries it runs perfectly).

Any idea where we're wrong?

Logcat shows:
I/ActivityManager(  963): Displayed com.visualise.projectX/com.unity3d.player.UnityPlayerNativeActivity: +1s192ms
D/Unity (26099): GL_AMD_compressed_ATC_texture GL_AMD_performance_monitor GL_AMD_program_binary_Z400 GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_robustness GL_EXT_texture_format_BGRA8888 GL_EXT_texture_type_2_10_10_10_REV GL_NV_fence GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_depth24 GL_OES_EGL_image GL_OES_EGL_sync GL_OES_EGL_image_external GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_fragment_precision_high GL_OES_get_program_binary GL_OES_packed_depth_stencil GL_OES_depth_texture_cube_map GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_vertex_type_10_10_10_2 GL_OES_vertex_array_object GL_QCOM_alpha_test GL_QCOM_binning_control GL_QCOM_driver_control GL_QCOM_perfmon_global_mode GL_QCOM_extended_get GL_QCOM_extended_get2 GL_QCOM_tiled_rendering GL_QCOM_writeonly_rendering GL_KHR_texture_compression_astc_ldr GL_EXT_sR
D/Unity (26099): GB GL_EXT_sRGB_write_control GL_EXT_texture_sRGB_decode GL_EXT_texture_filter_anisotropic GL_EXT_multisampled_render_to_texture GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_EXT_disjoint_timer_query
W/Unity (26099): The referenced script on this Behaviour is missing!
W/Unity (26099):
W/Unity (26099): (Filename: Line: 1783)
W/Unity (26099):
W/Unity (26099): The referenced script on this Behaviour is missing!
W/Unity (26099):
W/Unity (26099): (Filename: Line: 1783)
W/Unity (26099):
I/Unity (26099): Awake
I/Unity (26099):
I/Unity (26099): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
I/Unity (26099):
I/Unity (26099): Movie Texture id: 15
I/Unity (26099):
I/Unity (26099): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
I/Unity (26099):
D/PowerManagerService( 963): [api] acquire WakeLock flags=0x1a tag=Unity-ProjectRequestedWakeLock uid=10249 pid=26099
I/Unity (26099): OnApplicationFocus
I/Unity (26099):
I/Unity (26099): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
I/Unity (26099):
I/Unity (26099): OnApplicationFocus
I/Unity (26099):
I/Unity (26099): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
I/Unity (26099):
D/PowerManagerService( 963): [api] release WakeLock flags=0x1a tag=Unity-StartupWakeLock uid=10249 pid=26099 (0x0)
I/Unity (26099): SetUpVideoPlayer
I/Unity (26099):
I/Unity (26099): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 49)
I/Unity (26099):
F/libc (26099): Fatal signal 6 (SIGABRT) at 0x000065f3 (code=-6), thread 26115 (UnityMain)
I/DEBUG ( 404): pid: 26099, tid: 26115, name: UnityMain >>> com.visualise.projectX <<<
W/ActivityManager( 963): Force finishing activity com.visualise.projectX/com.unity3d.player.UnityPlayerNativeActivity
I/WindowManager( 963): Screenshot: 580x1031 from 21010 to 21015 appToken=Token{436be9f8 ActivityRecord{443b7788 u0 com.visualise.projectX/com.unity3d.player.UnityPlayerNativeActivity t97 f}}
I/WindowManager( 963): Window{44650350 u0 com.visualise.projectX/com.unity3d.player.UnityPlayerNativeActivity}: 21015 animLayer=21015 surfaceLayer=21015
I/WindowManager( 963): Screenshot Window{44650350 u0 com.visualise.projectX/com.unity3d.player.UnityPlayerNativeActivity} was monochrome(ff131313)! mSurfaceLayer=21015 minLayer=21010 maxLayer=21015
W/InputDispatcher( 963): channel '44650350 com.visualise.projectX/com.unity3d.player.UnityPlayerNativeActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
E/InputDispatcher( 963): channel '44650350 com.visualise.projectX/com.unity3d.player.UnityPlayerNativeActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
D/PowerManagerService( 963): [api] handleWakeLockDeath : release WakeLock : FULL_WAKE_LOCK 'Unity-ProjectRequestedWakeLock' (uid=10249, pid=26099, ws=null) (elapsedTime=598)
D/InputDispatcher( 963): Focus left window: Window{44650350 u0 com.visualise.projectX/com.unity3d.player.UnityPlayerNativeActivity}
W/InputDispatcher( 963): Attempted to unregister already unregistered input channel '44650350 com.visualise.projectX/com.unity3d.player.UnityPlayerNativeActivity (server)'
D/InputTransport( 963): Input channel destroyed: name='44650350 com.visualise.projectX/com.unity3d.player.UnityPlayerNativeActivity (server)', fd=428
I/WindowState( 963): WIN DEATH: Window{44650350 u0 com.visualise.projectX/com.unity3d.player.UnityPlayerNativeActivity}
E/WindowManager( 963): The application is died. window:Window{44650350 u0 com.visualise.projectX/com.unity3d.player.UnityPlayerNativeActivity EXITING}
D/CrashAnrDetector( 963): pid: 26099, tid: 26115, name: UnityMain >>> com.visualise.projectX <<<

IronMan
Honored Guest

blazejwojtyla
Honored Guest
Yes,

Everything is very stable and works fine, when we're using 960x540 videos (and unmodified plugin), problem starts with 2k videos and modified plugin.

borutwm
Honored Guest
The delayed playback did the trick for me - thanks!

polygonwindow
Honored Guest
"IronMan" wrote:
I was going to mention.. if you have specific requests for video player features with this.. Let us know. It's not a high priority item right now but would be good to be thinking about if we find the time to make revisions.


A wee bit off topic but Im curious if you guys are going to integrate movieplayersample or something simmilar into the desktop SDK for DK2/CV1? That would be really helpful for us because we're also developing our moonlight video based apps for PC. thnx

haraldini
Honored Guest
Can someone point me in the right direction on how to get decent image quality out of the PanoVideo sample video file?. It looks nice and crips in the VR360 demo. I used the MoviePlayer Unity sample project as a base to map the video to the inside of a sphere, but the image quality is not as good as in the VR360 demo.

As mentioned here before, the resolution in the MediaSurface.cpp is currently hardcoded, so I increased it to match the video file (2880x1440). Now I'm not sure if I'm doing it right from here.

I opened the VRLib project in Eclipse and Eclipse automatically creates a new vrlib.jar in the VRLib/bin folder and I copied that across into my Unity project (Assets\Plugins\Android). Is this enough?

However, running ndk-build on the command line in the VRLib folder throws me an error message:

In file included from jni/../../VRLib/jni/App.h:33:0,
from jni/../../VRLib/jni/Integrations/PureJava/PureJava.cpp:30:
jni/../../VRLib/jni/GlUtils.h:146:8: error: 'PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG' does not name a type
extern PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG glRenderbufferStorageMultisampleIMG_;
^
jni/../../VRLib/jni/GlUtils.h:147:8: error: 'PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG' does not name a type
extern PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG glFramebufferTexture2DMultisampleIMG_;
^
In file included from jni/../../VRLib/jni/GlUtils.h:36:0,
from jni/../../VRLib/jni/App.h:33,
from jni/../../VRLib/jni/Integrations/PureJava/PureJava.cpp:30:
C:/Android/android-ndk-r10/platforms/android-L/arch-arm/usr/include/GLES2/gl2ext.h:1047:43: error: expected unqualified-id before numeric constant
#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9
^
jni/../../VRLib/jni/GlUtils.h:227:18: note: in expansion of macro 'GL_FRAMEBUFFER_SRGB_EXT'
static const int GL_FRAMEBUFFER_SRGB_EXT = 0x8DB9;
^
make.exe: *** [obj/local/armeabi-v7a/objs/JavaVr/__/__/VRLib/jni/Integrations/PureJava/PureJava.o] Error 1


What am I missing?

I'm also not sure what the correct dimensions or distance from the camera the sphere in Unity should be for a good result. Are there any recommendations available?