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 Diego, sorry about that, I could well believe I have a threaded race condition in there.

    I'll try and reproduce it.
     
  2. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    The current retail version doesn't work without Pro either :-/
     
  3. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Thanks Pedro, I just found the problem.

    As a work around, can you add a MobileMovieManager component to any active game object in your scene please? I'm just working on a proper fix
     
  4. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    No native support for audio, sorry.

    Nothing stops you playing a sound at the same time though. People have had varying success with it.
     
  5. e3di

    e3di

    Joined:
    Nov 15, 2013
    Posts:
    14
    Hi Dan, thanks for the reply, no worries.
     
  6. trimf

    trimf

    Joined:
    May 4, 2014
    Posts:
    6
    Version 2.0.4 01/05/2014
    iOS/Android: Fix 'green textures' problem.

    Have green screen on android in demo version. Is it the same version as FULL version?
     
  7. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    As a workaround, add a MobileMovieManager component to any active object in your scene. Sorry, I'll fix the demo version properly soon.
     
  8. trimf

    trimf

    Joined:
    May 4, 2014
    Posts:
    6
    MobileMovieManager script is already on the scene. I will be waiting for fixed demo version.
     
  9. trimf

    trimf

    Joined:
    May 4, 2014
    Posts:
    6
    By the way you can put .apk as an example, where all works.
     
  10. dm_reflekt

    dm_reflekt

    Joined:
    Mar 20, 2013
    Posts:
    8
    Any look reproducing the (possible threaded race condition) bug?

    A scene with a lot of complex content and more than one movie reproducing at a time helps...

    Really hope we can find a solution, it's kinda urgent..
     
  11. moproductions

    moproductions

    Joined:
    Sep 28, 2010
    Posts:
    88
    I saw a blurb about this, but I wanted to confirm that this tool will allow us to play video files that are NOT, repeat NOT, in the /Streaming Assets folder. The fact that that folder is read only is what's causing our project to stall, so if your tool does this, audio or not, it's a good thing to know.
     
  12. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Great idea. I'll do it next week. Currently on the road without a android pro licence :-/
     
  13. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Haven't had a chance yet. Sorry :-( If you don't need the seeking, you can always go back to 1.1.7... I can pm you a link
     
  14. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    You can do this with the demo version, just check the "Absolute path" bool in the MMT component. Sorry if it wasn't obvious :-/
     
  15. dm_reflekt

    dm_reflekt

    Joined:
    Mar 20, 2013
    Posts:
    8
    I don't need seeking, but changing the speed of the video while reproducing it without interruptions is important (I'm using 2.0.0 and it does that just fine).

    Please, send me a link to the 1.1.7!
     
  16. jo3bolton

    jo3bolton

    Joined:
    May 8, 2014
    Posts:
    1
    Hi Dan,
    I'm evaluating your plugin, and will buy it if you can help me resolve this issue.
    I've got an Augmented Reality Scene running Vuforia, and I need a Video played on the faces of a "cube" (its actually 6 planes stuck together).
    All works fine untill I try to load the Vuforia Plugin. At that Point Unity gives me the following errors when running in play mode:

    Code (csharp):
    1. UnityException: Creating texture from native texture is PRO only.
    2. UnityEngine.Texture2D..ctor (Int32 width, Int32 height, TextureFormat format, Boolean mipmap, Boolean linear, IntPtr nativeTex) (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/TextureBindings.cs:142)
    3. UnityEngine.Texture2D.CreateExternalTexture (Int32 width, Int32 height, TextureFormat format, Boolean mipmap, Boolean linear, IntPtr nativeTex) (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/TextureBindings.cs:150)
    4. MMT.MobileMovieTexture.AllocateTexures () (at Assets/MobileMovieTexture/MobileMovieTexture.cs:500)
    5. MMT.MobileMovieTexture.Update () (at Assets/MobileMovieTexture/MobileMovieTexture.cs:348)
    Also The Cube is rendered black (the default colour of the Movie Material?), whereas it played the video successfully prior to importing vuforia.
    $Screenshot.png
    I have the full version of Unity Pro (I had to do a sanity check to make sure I actually did then, I'll admit).

    I'd appreciate a speedy resolution on this as I need the app ready by the beginning of next week!
    Thanks
    Joe
     

    Attached Files:

    Last edited: May 8, 2014
  17. linku

    linku

    Joined:
    Dec 19, 2013
    Posts:
    1
    I would appreciate it very much if you could tell me the way not to crush the application when I use your plugin I customized on Samsung's devices.


    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5.  
    6. public class TestMobileTexture : MonoBehaviour
    7. {
    8.     private MMT.MobileMovieTexture m_movieTexture;
    9.  
    10.     void Awake()
    11.     {
    12.         m_movieTexture = GetComponent<MMT.MobileMovieTexture>();
    13.         m_movieTexture.onFinished += OnFinished;
    14.     }
    15.  
    16.  
    17.     void OnFinished(MMT.MobileMovieTexture sender)
    18.     {
    19.         Debug.Log(sender.Path + " has finished ");
    20.         NextMovie();
    21.     }
    22.  
    23.     string[] movies = new string[] {"ExplosionSplitAlpha.ogv", "HandOfFate.ogv", "IHSG_smash.ogg"};
    24.     int pos = 0;
    25.  
    26.     void NextMovie()
    27.     {
    28.         m_movieTexture.Stop();
    29.         pos = (pos + 1) % movies.Length;
    30.         m_movieTexture.Path = "MovieSamples/" + movies[pos];
    31.         m_movieTexture.Play();
    32.     }
    33.  
    34.     private void OnGUI()
    35.     {
    36.         GUILayout.BeginArea(new Rect(0.0f, 0.0f, Screen.width, Screen.height));
    37.  
    38.         var currentPosition = (float)m_movieTexture.playPosition;
    39.  
    40.         var newPosition = GUILayout.HorizontalSlider(currentPosition,0.0f,(float)m_movieTexture.duration);
    41.  
    42.         if (newPosition != currentPosition)
    43.         {
    44.             m_movieTexture.playPosition = newPosition;
    45.         }
    46.        
    47.         GUILayout.FlexibleSpace();
    48.         GUILayout.BeginHorizontal();
    49.         if (GUILayout.Button("Play"))
    50.         {
    51.             m_movieTexture.Play ();
    52.         }
    53.        
    54.         if (GUILayout.Button("Play/Pause"))
    55.         {
    56.             m_movieTexture.pause = !m_movieTexture.pause;
    57.         }
    58.  
    59.         if (GUILayout.Button("Stop"))
    60.         {
    61.             m_movieTexture.Stop();
    62.         }
    63.  
    64.         if (GUILayout.Button("Next"))
    65.         {
    66.             m_movieTexture.Stop();
    67.             NextMovie();
    68.         }
    69.  
    70.         GUILayout.FlexibleSpace();
    71.         GUILayout.EndHorizontal();
    72.  
    73.         GUILayout.EndArea();
    74.  
    75.      }
    76. }
    77.  
     
  18. trimf

    trimf

    Joined:
    May 4, 2014
    Posts:
    6
    Waiting for .apk, that will work on my devices and going to buy, if all is good. Still having green screen in demo.
     
  19. johnsmith954

    johnsmith954

    Joined:
    May 14, 2014
    Posts:
    3
    Hi

    Is it possible to adjust the UV mapping (tiling and such) of the movie texture?

    Thanks
     
  20. eskiroy

    eskiroy

    Joined:
    May 9, 2014
    Posts:
    11
    Hi,

    I have just bought the full version and I'm trying to use the same Movie texture for multiple objects that will play different videos. The only way I had it working was to duplicate the Movie texture and assign each object with a unique Movie texture. It worked when previewed in Unity, but when I ran it on my iPhone, all videos just showed a black screen.

    Is there anyway to get the multiple videos going in iOS or Android? I read in your description on the Asset Store saying that it can support multiple videos. Thanks very much for your help in advance.
     
  21. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    It wont let me upload a 18mb apk. PM me your email address and I'll mail it direct
     
  22. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Sort of. The video decode texture has up to a 16 pixel border around it, I set the uv matrix to crop this border. As long as you don't mind tilling the border as well, then feel free to override the uv matrix.
     
  23. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Are you also using unique materials per MMT component?
     
  24. eskiroy

    eskiroy

    Joined:
    May 9, 2014
    Posts:
    11
    Yes I have duplicated the Movie material and have assigned each unique material to each pair of MovieTexture and Plane. Plays fine in Unity but only shows black on mobile.

    Do I need to make unique MMT scripts for each of those pairs as well?
     
  25. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Possibly. I've lost you a bit. Can you send me the scene/project, then I'll understand
     
  26. eskiroy

    eskiroy

    Joined:
    May 9, 2014
    Posts:
    11
    Nevermind. I have rebuilt the scene and got everything working now. Must have screwed up something on the way before. Thanks so much!
     
  27. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    Is it possible to set the time of a video, or to start playing from a specific time? I will need to synchronize multiple feeds, and I can't think of a good way to do it without being able to set the time. I can't find this function in the API.
     
  28. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Then I have failed! What did you search for?

    Code (csharp):
    1. /// <summary>
    2.         /// Use this to retrieve the play position and to seek. NB after you seek, the play position will not be exactly what you seeked to, as it is tries to find a key frame
    3.         /// </summary>
    4.         public double playPosition
    5.         {
    6.             get { return m_elapsedTime; }
    7.             set
    8.             {
    9.                 if (m_nativeContext != IntPtr.Zero)
    10.                 {
    11.                     m_elapsedTime = Seek(m_nativeContext, value, m_seekKeyFrame);
    12.                 }
    13.             }
    14.         }
     
  29. Hubert-Gendron

    Hubert-Gendron

    Joined:
    May 6, 2013
    Posts:
    1
    Hi !

    Is it possible to know when a frame is decoded and shown on screen. Because I really need a way to get notified when the video changes from one frame to another and also knowing which frame number is currently shown.

    I tried using playPosition value to get the frame number using the FPS of my video in an update loop. But it's not accurate enough. Do you have any solutions ?

    Thanks.
     
  30. Deedlith

    Deedlith

    Joined:
    Feb 11, 2013
    Posts:
    3
    Hi,

    Sorry for my post but i have a problem since i get the upgrade, it work on Android but no more on Windows, i don't understand why, the error is :
    "EntryPointNotFoundException: CreateContext" so he doesn't create the context =( !

    Plz answer me why it's not working, and sorry for my poor english ^_^

    Thx U =)
     
    Last edited: May 27, 2014
  31. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    Ah, thanks Dan! I must have missed it. I think I was looking mostly for "time" or something similar.
     
  32. Alesi

    Alesi

    Joined:
    May 26, 2014
    Posts:
    1
    Hello,

    I installed the Demo and have trying to play the MobileMovieTextureTest scene, but it always returns the "DllNotFoundException..../x86/theorawrapper.dll" error.

    I checked and the Dll is in the folder indeed.

    Any clue why am I wrong?

    Thanks.
     
  33. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
  34. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
  35. AbstractMedia

    AbstractMedia

    Joined:
    May 29, 2014
    Posts:
    2
    I am having the same problem except on Android. I have a unique material on both objects I am displaying movies on. Though when I attempt to view them on my device they show up black.
     
  36. AbstractMedia

    AbstractMedia

    Joined:
    May 29, 2014
    Posts:
    2
    Scratch that, Fixed it. I simply forgot to switch a few lines of code around from something else I was trying.

    Though now it flashes a black box right before the video plays. I am not searching for keys or anything, just straight playing the video when it is triggered.
     
    Last edited: May 29, 2014
  37. bangchuigame

    bangchuigame

    Joined:
    Jul 3, 2012
    Posts:
    1
    After upgrade to 2.0.4, I run the Scene MobileMovieTextureTest on the HTC desire s and it didn't go well (show as below screen capture)
    $豌豆荚截图20140530112030.png
    The android version is 2.3.7
     
  38. trimf

    trimf

    Joined:
    May 4, 2014
    Posts:
    6
    squeakyoak@gmail.com
     
  39. Varioz

    Varioz

    Joined:
    May 30, 2014
    Posts:
    1
    Hello Dan !
    I downloaded the Demo version, and now, I'll buy the full version.
    can you tell me what I have to do, to replace the Demo Version on my project with the full version ?
    Thanks.
    Andrew.
     
  40. Deedlith

    Deedlith

    Joined:
    Feb 11, 2013
    Posts:
    3
    Last edited: Jun 2, 2014
  41. pjy_727

    pjy_727

    Joined:
    Jun 3, 2014
    Posts:
    2
    unity 4.5 pro version in use.
    Does not work. Is there a solution?
     

    Attached Files:

    • 1.png
      1.png
      File size:
      147.1 KB
      Views:
      1,041
  42. pain_gwar

    pain_gwar

    Joined:
    Apr 14, 2013
    Posts:
    22
    I think that you have to rebuild all the scripts in the project

    From the Upgrade guide for Unity 4.5:
    • Rendering: The internal value of TextureFormat.BGRA32 enum has changed. Any code using that enum in a .NET assembly must be rebuilt.
     
  43. alvaro-em

    alvaro-em

    Joined:
    Feb 23, 2012
    Posts:
    77
    We have updated to Unity 4.5. It works like a charm on IOS, but on Android it is not working. Pink screen like the one pjy_727 attached. We are in a hurry because a deadline. Any workaround that you can propose? Any estimations for the update?

    Thank you!!!

    EDITED: It has been solved in the last version of the asset (v2.0.4). Thank you very much!
     
    Last edited: Jun 13, 2014
  44. pain_gwar

    pain_gwar

    Joined:
    Apr 14, 2013
    Posts:
    22
    Try to check the material that you are using to reproduce the movie. Sometimes happened to me that the material was corrupted and i see the pink texture. Re-importing the plugin's material or creating from scratch a new one fixed the problem for me.
     
  45. pjy_727

    pjy_727

    Joined:
    Jun 3, 2014
    Posts:
    2
    I bought from Asset store.

    It is not in operation at Unity4.5.

    When updated ?
    It's available on Android
     
  46. guilaurea

    guilaurea

    Joined:
    Jun 11, 2014
    Posts:
    2
    Hi!

    I'm starting to use Mobile Movie Texture and I have a problem. I put my .ogg video in the Streaming Assets folder and put its path in the script. It works on the Unity, but when I use theapp on my Android (Samsung Galaxy S3) the video doesn't work.

    Do you know what can I do?


    Other question, I was looking for a tutorial of MMT, but I didn't found anithing, do you have one?


    Thank's!
     
  47. pain_gwar

    pain_gwar

    Joined:
    Apr 14, 2013
    Posts:
    22
    You can try to encode your video like suggested in the instructions. I have tested with S3 and everything works fine for me, both *.ogg file and *.ogv file.

    No idea about tutorial, i'm sorry.
     
  48. alvaro-em

    alvaro-em

    Joined:
    Feb 23, 2012
    Posts:
    77
    LAST VERSION TURNS METAIO CAMERA FEED INTO WHITE (iOS problem)

    Hello.

    We used to have a working Metaio + Mobile Video Texture project.

    Now, while trying to update to Unity 4.5, I have been working in the integration of the Metaio SDK (v5.3) with your last update. I am founding a very strange behavior: when I include the asset, the Metaio camera feed turns into white. After a lot of attempts, I have discovered that it is due to the DLLImports in the MobileMovieTexture.cs. The first one I uncomment, turns the camera feed into white. If I comment them, (and manage to build the project), then the feed is ok.

    Any ideas about how to solve this? I have to mention that no one of the imported functions are actually called in the code (I removed all the calls), so the problem must be related to the linkage stage.

    Thank you very much in advance and kind regards!

    Aernarion.

    EDIT: To reproduce it, you can download the Metaio SDK for free here:

    http://ar.metaio.com/download_sdk

    and import the Mobile Movie Texture asset. You will need to comment lines 17, 18 and 76 of MobileMovieManager.cs to avoid a different conflict (one problem at a time, you know).

    //[DllImport(PLATFORM_DLL)]
    //privatestaticexternvoidUnityRenderEvent(inteventID);
    .
    .
    .
    //UnityRenderEvent(7);

    EDITED: Last version of Metaio SDK has a function with the same name that another one in Mobile Video Texture asset. I contacted Dan and he helped me with a patch. I was also confirmed that the new Mobile Movie Texture release will fix this problem.

    Regards,
     
    Last edited: Jun 18, 2014
  49. KieranBaker

    KieranBaker

    Joined:
    Feb 25, 2014
    Posts:
    3
    Hello, we are trying to change the mobile movie texture path at runtime on an Android device. In the editor (Mac and PC), we can get this to work by setting the absolute path in the code to Application.persistantDataPth + "/FileName.ogv"; We then call .Play() on it.

    When we deploy this to android the movie seems to stay black instead of changing to the movie. How can we change the movie path on android at runtime? We're using the purchased version.

    Kieran
     
  50. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    It should work. Internally it just does a fopen on that path. Can you confirm the movie is at that path? Can you send me a small reproducible please
     
    almahdie likes this.