Search Unity

Mobile Movie Texture

Discussion in 'Assets and Asset Store' started by DanTreble, Dec 17, 2011.

  1. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Hey alvaroull, thanks for the interest. I am not presently working on it. So I can't give you any estimation. Sorry
     
  2. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Hey Balazs, sorry to hear you are having problems

    I don't have a mac with an android license to test it on I'm afraid. My guess would be that you are in opengl 1.1 mode and all of my shaders require open gl 2.0. You can change this in Edit->Project Settings->Player->Graphics Level
     
  3. exoszajzbuk

    exoszajzbuk

    Joined:
    Apr 11, 2012
    Posts:
    10
    Thanks, it works!
     
  4. netatti

    netatti

    Joined:
    Feb 22, 2011
    Posts:
    5
    hi DTreble,

    first, thanks for you awesome work! We're having a client, who is interested in streaming support and we have some qualified coders around. If you're interested in a collaboration to get things working, please contact me.
     
  5. kovacsd

    kovacsd

    Joined:
    May 24, 2012
    Posts:
    3
    Hi!

    I have an interesting crash. I'm using MMT in different scenes. After loading the scene 2-4 times it crashes with the following stack trace:

    #0 0x30d543aa in twiddle32x32_8 ()
    #1 0x30d2d0d8 in BlockTwiddleAddress8bpp ()
    #2 0x30d200d4 in _ZL23sgxLoadTextureLevelFastP12GLDSharedRecP20SGXLoadTextureParamsb ()
    #3 0x30d20376 in glrWriteTextureData ()
    #4 0x335eac08 in gldModifyTexSubImage ()
    #5 0x36b8e0b4 in glTexSubImage2D_Exec ()
    #6 0x023e0140 in tex_sub_image2D ()
    #7 0x31533282 in glTexSubImage2D ()
    #8 0x00b030f0 in PlaybackState::surface_upload(PlaybackState*, th_img_plane*, int, int) at /Users/dan/synserver/depot/VideoDemo/plugins/theorarm/jni/theorawrapper/iPhone/../theorawrapper.cpp:211
    #9 0x00afddbe in th_decode_packetin at /Users/dan/synserver/depot/VideoDemo/plugins/theorarm/jni/theorawrapper/iPhone/../../theora/lib/decode.c:2269
    #10 0x00b02ee0 in PlaybackState::DecodeFrame() at /Users/dan/synserver/depot/VideoDemo/plugins/theorarm/jni/theorawrapper/iPhone/../theorawrapper.cpp:458
    #11 0x00b02a40 in DecodeAndUpload at /Users/dan/synserver/depot/VideoDemo/plugins/theorarm/jni/theorawrapper/iPhone/../theorawrapper.cpp:635
    #12 0x00028998 in wrapper_managed_to_native_MobileMovieTexture_DecodeAndUpload_intptr_int_int_int at /Users/kovacsd/devel/toplamax_ios/Toplamax/Libraries/Assembly-CSharp.dll.s:16562
    #13 0x00007328 in MobileMovieTexture_Decode at /Users/kovacsd/devel/toplamax_ios/Toplamax/Libraries/Assembly-CSharp.dll.s:542
    #14 0x00007208 in MobileMovieTexture_Update at /Users/kovacsd/devel/toplamax_ios/Toplamax/Libraries/Assembly-CSharp.dll.s:510
    #15 0x006e8f88 in wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr at /Users/kovacsd/devel/toplamax_ios/Toplamax/Libraries/mscorlib.dll.s:338411
    #16 0x00ee74d0 in mono_jit_runtime_invoke ()
    #17 0x00f77e38 in mono_runtime_invoke ()
    #18 0x00c5bb4c in mono_runtime_invoke_profiled_fast(MonoMethod*, MonoObject* (*)(void*, MonoException**), void*, MonoException**, MonoClass*) at /Applications/buildAgent/work/842f9557127e852/./Runtime/Mono/MonoUtility.h:398

    Do you have any idea what could go wrong?

    Thanks, David
     
  6. kovacsd

    kovacsd

    Joined:
    May 24, 2012
    Posts:
    3
    Ok, I've found it:) When I modified the path of the video, accidentally I've copied the one that was meant for the UNITY_EDITOR and the last param was true.
    m_nativeContext = OpenStreamDemo(GetiPhoneDocumentsPath() + "/" + PlayerPrefs.GetString("VideoFileName"), 0, 0, m_loop, true);

    The correct is:
    m_nativeContext = OpenStreamDemo(GetiPhoneDocumentsPath() + "/" + PlayerPrefs.GetString("VideoFileName"), 0, 0, m_loop, false);

     
  7. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Phew, am I glad you found it, cause I had NFI!
     
  8. skateborden

    skateborden

    Joined:
    Apr 1, 2009
    Posts:
    35
    I just bought the Mobile Movie Texture plugin a few days ago, and so far I'm very impressed. It seems to work nicely on the old Android phone I use for testing (Motorola Droid), and on Windows standalone builds. I haven't had the opportunity to test an iOS build yet, but I'm looking forward to it.

    However, Mac standalone builds don't seem to be working. I even tried creating a new project and just importing the package and building the test scenes, but they just give me a big magenta missing Material plane, while building the same project and scenes works fine on WIndows and Android. I'm even developing on a Mac and it works fine in the Unity editor. Has anyone else had a problem with Mac standalone builds?
     
  9. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Hey skateborden, thanks for buying and supporting Mobile Movie Texture!

    To be honest, I didn't really make the plugin to solve movies on mac standalone, they can use a MovieTexture. You can probably get it working by looking at the UNITY_EDITOR defines and adding a || UNITY_STANDALONE_OSX.

    Let me know how you go.

    Thanks

    Dan
     
  10. skateborden

    skateborden

    Joined:
    Apr 1, 2009
    Posts:
    35
    I realize it's designed to work on mobile and I can use Unity's MovieTexture implementation on Mac. It would just be nice to have one implementation across all platforms. I'll play around with the platform preprocessor directives and see if I can get it to work.
     
  11. skateborden

    skateborden

    Joined:
    Apr 1, 2009
    Posts:
    35
    I figured it out. The StreamingAssets directory gets put inside a directory named "Data" inside Application.dataPath on Mac. Adding this in at line 268 does the trick.

    Code (csharp):
    1.  
    2. #elif UNITY_STANDALONE_OSX
    3.         m_nativeContext = OpenStream(Application.dataPath + "/Data/StreamingAssets/" + m_path, 0, 0, m_loop, true);
     
  12. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
  13. aciang

    aciang

    Joined:
    May 29, 2012
    Posts:
    15
  14. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    No sorry :-( I believe prime31's plugin can stream
     
  15. aciang

    aciang

    Joined:
    May 29, 2012
    Posts:
    15
    prime31 only work with ios :(
     
  16. kovacsd

    kovacsd

    Joined:
    May 24, 2012
    Posts:
    3
    if DestroyTextures() is called before Open() gets called then m_ChannelTextures is null and it crashes when Destroy() called. I think there should be a check for null there.
     
  17. falkonragno

    falkonragno

    Joined:
    May 31, 2010
    Posts:
    29
    Hello DTreble,

    Can you give me your advise about how to improve the play rate or speed, I'm using a plane to play the movie material, everything is working fine, even the chroma transparency is ok running from my ipad2, but the video seen slower that it is.

    Please some advise about how to improve this.

    Thanks in advance.
     
  18. aciang

    aciang

    Joined:
    May 29, 2012
    Posts:
    15
    Have any hint or example how to use MobileMovieTexture with assetBundle?
     
  19. aciang

    aciang

    Joined:
    May 29, 2012
    Posts:
    15
    I have downloaded the video with WWW to persistentDataPath, and play it from there..

    to make it work.. have to make some changes in MobileMovieTexture.cs that get my concern.

    have to remark line "AssetStream.GetFileOffsetLengt" as it returns error:
    Code (csharp):
    1.  IOException: /mnt/sdcard/Android/data/com.aciang.test19/files/spiderman.ogg not found
    2. I/Unity   (20107):   at AssetStream.GetFileOffsetLength (System.String fileName, System.Int64 offset, System.Int64 length) [0x00000] in <filename unknown>:0
    3. I/Unity   (20107):   at MobileMovieTexture.Open () [0x00000] in <filename unknown>:0
    4. I/Unity   (20107):   at MobileMovieTexture.Play () [0x00000] in <filename unknown>:0
    5. I/Unity   (20107):   at TestMobileTexture.OnGUI () [0x00000] in <filename unknown>:0
    already checked the folder and file exist in android device.

    and change m_nativeContext to
    m_nativeContext = OpenStream(objDownloadVideo.VideoFilePath, 0, 0, m_loop, pot );


    Code (csharp):
    1.    
    2. private void Open()
    3.     {
    4.         Debug.Log("=BEGIN============================================================");
    5.         Debug.Log("Debug FILE PATH (MobileMovieTexture): " + objDownloadVideo.VideoFilePath);
    6.        
    7. #if UNITY_ANDROID  !UNITY_EDITOR
    8.  
    9.         long offset;
    10.         long length;
    11.  
    12.         //AssetStream.GetFileOffsetLength(m_path,out offset, out length);
    13.         //AssetStream.GetFileOffsetLength(objDownloadVideo.VideoFilePath, out offset, out length);
    14.  
    15.         bool pot = false; //Power of 2 YCrCB buffers
    16.  
    17.         // Seems to eventually crash on the Adreno 200 whatever I do :-(
    18.         //if (SystemInfo.graphicsDeviceName == "Adreno 200")
    19.         //{
    20.         //    pot = true; //it crashes deep within the Areno driver in my call to glTexSubImage2D, in rb_texture_find_eviction_candidate in __memcmp16
    21.         //}
    22.        
    23.         Debug.Log("Debug AssetStream.GetApkPath(): " + AssetStream.GetApkPath());
    24.         //m_nativeContext = OpenStream(AssetStream.GetApkPath(), (int)offset, (int)length, m_loop, pot );
    25.         m_nativeContext = OpenStream(objDownloadVideo.VideoFilePath, 0, 0, m_loop, pot );
    26.  
    27.         Debug.Log("=END==============================================================");
    28.  

    My question is.. are above codes ok?
     
  20. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    aciang - those changes look fine. The AssetStream class is specifically for reading within a apk/zip, so you are right to remove that for a raw file.
     
  21. iossif

    iossif

    Joined:
    Mar 4, 2011
    Posts:
    332
    ignore this post, it was just a question about crashing non-looping videos.

    i just write down the solution in case i look for it again :p

    in the MobileMovieTexture.cs just add

    Code (csharp):
    1.  
    2. if(m_hasFinished) {
    3. break; 
    4. }
    right after

    Code (csharp):
    1.  
    2. while (m_elapsedTime > m_nextFrameTime)
    3. {
    4.  
     
    Last edited: Jun 6, 2012
  22. android_dev

    android_dev

    Joined:
    Jul 9, 2011
    Posts:
    19
    Can I change the video at runtime? When I try to access the path value it says its read-only. Or do I have to make multiple objects with different mobilemovietexture.cs scriptes attachted to them?
     
  23. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Easier to have multiple objects
     
  24. netatti

    netatti

    Joined:
    Feb 22, 2011
    Posts:
    5
    I asked prime31 about it. They responded it's not supported. Could you give streaming another thought?
     
  25. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @DTreble,

    We're running into an issue on Android devices (not seeing it as much on iOS, or maybe its just not as apparent) that happens when a video is set to loop. Essentially the app stalls for a SIGNIFICANT amount of time... nothing like a little hiccup or anything but stalls. The videos are relatively small so i can't imagine thats the issue (we do have some larger videos that play for, albeit a little slower). Is there anything that would cause that? Does the compression on the actual video asset matter (aka the compression levels or whatnot, and is there a preferred compression level?).

    Cheers
    Bryan
     
  26. darkmax

    darkmax

    Joined:
    Feb 21, 2012
    Posts:
    83
    hi, i'm interested in your plugin, but i have a question can i use this plugin for all plataforms?, windows, mac, ios, and android?

    And also i want to use a video with chroma (transparency) in all these platforms if this can do the trick?.

    Also i saw that doesn't support audio, if i play the audio at the same time, will have a problem for synchronization?
     
    Last edited: Jun 18, 2012
  27. Deleted User

    Deleted User

    Guest

    Hi, I am interested in the Mobile Movie Texture plugin.

    Does anyone know where I can get the latest demo version?

    Thanks!
     
  28. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    First page of this thread at the top.
     
  29. Deleted User

    Deleted User

    Guest

    The latest version is 1.1.4, while the demo version at the top of the first page is 1.1.1. Also, v1.1.1 doesn't work with later versions of iOS SDK.
     
  30. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Really? First I've heard. If you can be a little more specific I'll take a look at it ASAP
     
  31. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Sorry to hear you are having trouble. Can you send me a video I can try and repro the problem with please? Also which android device are you seeing the problem on?
     
  32. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Yes it works on all platforms (with a small modification for mac standalone). Although it is optimised specifically for mobile.

    Chroma key works on all platforms :)

    Audio synchronisation is still a mine field. I've not had any reports of great success syncing them :-(
     
  33. sonhy1

    sonhy1

    Joined:
    Jun 21, 2012
    Posts:
    3
    Hi, I use this plugin. But there's a problem.
    Some Android devices will be torn from the Image(Movie Texture Rendering Image).

    Device: Galaxy Note (SHV-E160S) or LG Optimus LTE
    GPU: adreno 220
    Android API Version: 4.0.3

    What's the problem?
     
  34. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Can you grab a screen/picture to give me an idea what you mean by torn please?

    Fragmentation! You can run the same code on 2 different androids and get 2 different results!

    There might be a workaround...
     
  35. sonhy1

    sonhy1

    Joined:
    Jun 21, 2012
    Posts:
    3
    http://youtu.be/m5olVWyb9Ds

    I have uploaded to Youtube.
    Please confirm.
     
  36. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    That's weird. Can you try setting power of 2 textures on please?

    Code (csharp):
    1. bool pot = true; //Power of 2 YCrCB buffers
     
  37. sonhy1

    sonhy1

    Joined:
    Jun 21, 2012
    Posts:
    3
    Already tried.
    Same Youtube Movie...t_t
     
  38. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Oh no, I'm so sorry, I don't know why that device doesn't work.

    I don't know what else to try really. The plugin doesn't do anything odd internally. It just uploads textures...

    Code (csharp):
    1. glBindTexture(GL_TEXTURE_2D, state->yHandle);
    2. glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE,state->yStride, state->yHeight, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, _src[0].data );
     
  39. Deleted User

    Deleted User

    Guest

    Perhaps it's just the emulator - my MobileMovieTexture app built for iOS 4.3 (also tried 5.1) crashed when I tried running it in the emulator, and I am still waiting for my Apple developer account to be setup to try it on the real device. Is the plugin supposed to work in the emulator?
     
  40. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Woah, never stated anywhere that it works in the simulator. It most definitely doesn't!
     
  41. patch24

    patch24

    Joined:
    Mar 29, 2009
    Posts:
    120
    Where does this .a file actually go? I'm having the same issue but in my case I had started a fresh Unity project and brought in packages from other projects. Then, all of a sudden this issue started popping up. When xcode builds the project, it selects armv6, armv7 and I get the same linker errors. If I manually change the xcode project to armv7 Standard, I can build it. Any advice?

    Thanks!
    -p
     
  42. Deleted User

    Deleted User

    Guest

    OK, good to know, thanks for clarification.
     
  43. patch24

    patch24

    Joined:
    Mar 29, 2009
    Posts:
    120
    Hi, I'm having the same exact problem as below. Does anyone know how to fix this exactly? I tried following the link and doing some of the suggestions, but still have the problem.
    thanks,
    -p

     
  44. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Hey patch, looks like it has failed to link in the QCAR or Vuforia as it is now. All the missing functions are from Vuforia. I'd double check that you have their plugin installed correctly.

    Let me know how you go.

    Thanks

    Dan
     
  45. Deleted User

    Deleted User

    Guest

    DTreble,

    Both iPhone 3GS and iPhone 4 have an arm7, but Theora videos do not play for me on 3GS, is it supported?

    Thanks!
     
  46. Boss

    Boss

    Joined:
    Jun 27, 2012
    Posts:
    133
  47. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    3GS is supported. Can you send me a repro please?
     
  48. patch24

    patch24

    Joined:
    Mar 29, 2009
    Posts:
    120
    Hi I was curious if you could help me modify your mobilemovietexture.cs script to look for downloaded ogv files on various devices? (the default is set up to check in StreamingAssets but I can't include the huge ogv files with the build)

    Currently I have a script that downloads the video file and caches it in the iphone persistentDataPath area. I know someone else using your cool movie player has done this and was talking about modifying your code. I'm just not sure of the details. I'll have to get it working the same way for Android as well. Anyways, back to it! Thanks again for everything.
     
  49. Swearsoft

    Swearsoft

    Joined:
    Mar 19, 2009
    Posts:
    1,632
    I also had the issue with the Libtheorawrapper.a file not being recognized, thus having linking issues. From what I understand it was creating a shortcut (that's what it's called in Windows), instead of copying the file. Anyway, duplicating file to the Librarties folder of the XCode project solved the issue.

    K.
     
  50. android_dev

    android_dev

    Joined:
    Jul 9, 2011
    Posts:
    19
    I have the following problem:

    the colors are shifted.

    ogg was created with ffmpeg 0.29 (tested windows and mac).

    It looks right in the preview but on an ipad its wrong