Search Unity

[Released] AVPro QuickTime (DEPRECATED)

Discussion in 'Assets and Asset Store' started by AndrewRH, Jul 4, 2012.

  1. okimoki

    okimoki

    Joined:
    May 13, 2010
    Posts:
    116
    The problem is that if i do a "Build Run" from unity it works just fine. Then when i try to run just exe (the same that was running before from Unity), from explorer lets say, everything else works, the planes that had video mapped to them and worked before, are now just white squares..
    The DLL is in the ..Data\Plugins folder, yes..
    I managed to just do the "Build Run" from Unity before, but now i'll need this to work.. please help..
    Thanks,
    Best regards,
    Merry Christmas,
    Oskar
     
  2. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi Oskar, this seems to be a working path / folder related issuing. When you run the EXE from explorer the working path will be the same folder as the EXE, so all movie paths will be relative to that. When you run with "build run" the working path is set to something else (possibly the Unity.exe path) so all movies are relative to that.

    It's not really a bug, but more of a quirk. You could edit the code that parses the movie path. If it detects that the path is relative (eg "Movies/mymovie.mov") it could add the path path of the EXE to it (eg "c:\mybuild\Movies\mymovie.mov"). If you're using a relative path then you need to manually place your movie files in a similar location relative to your build. Eg if your movie path is "Movies\mymovie.mov" then in your build folder you must have "Movies\mymovie.mov".

    Hope that helps
    -Andrew
     
  3. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Actually Oskar here is the change you need to make to get it to work. We'll include this code change in the next release.

    In AVProQuickTime.cs, method StartFromFile(),

    Change:

    Code (csharp):
    1. Filename = filename.Trim() ;
    to:

    Code (csharp):
    1.  
    2.         Filename = filename = filename.Trim();
    3.        
    4.         // If we're running outside of the editor we may need to resolve the relative path
    5.         // as the working-directory may not be that of the application EXE.
    6.         if (!Application.isEditor  !Path.IsPathRooted(filename))
    7.         {
    8.             string rootPath = Path.GetFullPath(Path.Combine(Application.dataPath, ".."));
    9.             Filename = Path.Combine(rootPath, filename);
    10.         }
    11.  
    And you'll need to add this to the top of the file:

    Code (csharp):
    1.  
    2. using System.IO;
    3.  
    Hope that helps and happy holidays :)

    -Andrew
     
  4. Antidotenow

    Antidotenow

    Joined:
    Dec 23, 2012
    Posts:
    6
    Hi Andrew,

    I'm interested by the AVPro QuickTime movie, but is that possible to play the movies at variable speed ? I mean changing dynamically the speed with a slider for example and set it at XX% of normal speed and increasing or decreasing it.

    Regards,
     
  5. druffzy

    druffzy

    Joined:
    Sep 19, 2009
    Posts:
    55
    I moved plugins to root folder. still getting that error.
     
  6. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes, you can set the speed to any value. How quickly (and smoothly) the video playback reacts to the change in speed will depend on the codec and it's settings. Generally something with a lot of keyframes will react well. Take a look at the downloadable demo on the website where you can adjust the speed of playback dynamically.
     
  7. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi druffzy, are you using the latest version of the plugin? Which operating system are you using? Note that the build configuration "windows-64bit" isn't supported.
     
  8. druffzy

    druffzy

    Joined:
    Sep 19, 2009
    Posts:
    55
    Hi Andrew,

    I tried it both on Windows and Mac. It works fine on Windows but not on Mac with same setup.

    Also another question, how can I run multiple videos? how can I create multiple movie objects in the same scene?
     
  9. sangramdange

    sangramdange

    Joined:
    Jun 20, 2009
    Posts:
    1
    Hi Andrew

    How can i have four different movies running in a scene ,i tried doing so as you had replied earlier that putting the movie file name in AVpro Quicktime Movie script but it doesnt work and also can i use NGUI with AVpro quicktime ?,
    regards
    sangram
     
  10. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi Duffzy, which version of the plugin are you using, and what happens on the Mac exactly? To run multiple videos simply create multiple AVProQuickTimeMovie components and play them.
     
  11. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi Sangram, You can have multiple videos playing just by creating multiple AVProQuickTimeMovie components. These components will only play the videos and will not display them. You then need a way to use another set of components like AVProQuickTimeGUIDisplay (one for each movie) to display it on screen using the Unity GUI. Or you can map them to materials using the AVProQuickTimeMaterialAppy component. If you want to use it with NGUI you will probably have to make a new component based on AVProQuickTimeGUIDisplay but to work with NGUI and replace the texture NGUI is using. I have not used NGUI so I can't offer an exact solution for this.
     
  12. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    So if user does not have QuickTime ,what happends? They see black screen? Is there someway to embed the quicktime dll in there?
     
  13. cloudfun

    cloudfun

    Joined:
    Oct 2, 2011
    Posts:
    35
    could you help
    im trying to use but im not able i get this errors just trying the demo
    im using unity 4.0 pro on mac with quicktime

    i move the contents of plugins direfctory to the root plugins directory but
    i get this errors trying to play the PlayVideoDemo scene

    DllNotFoundException: AVProQuickTime
    AVProQuickTimeManager.Init () (at Assets/Scripts/Components/AVProQuickTimeManager.cs:81)

    DllNotFoundException: AVProQuickTime
    AVProQuickTime.StartMovie (Boolean loop, PixelFormat format) (at Assets/Scripts/Internal/AVProQuickTime.cs:213)
    AVProQuickTime.StartFromFile (System.String filename, Boolean loop, PixelFormat format) (at Assets/Scripts/Internal/AVProQuickTime.cs:176)
    AVProQuickTimeMovie.LoadMovie () (at Assets/Scripts/Components/AVProQuickTimeMovie.cs:64)
    AVProQuickTimeMovie.Start () (at Assets/Scripts/Components/AVProQuickTimeMovie.cs:47)

    DllNotFoundException: AVProQuickTime
    AVProQuickTime.get_LoadedSeconds () (at Assets/Scripts/Internal/AVProQuickTime.cs:78)
    AVProQuickTimePlayVideoDemo.ControlWindow (Int32 id) (at Assets/AVProQuickTime/Demos/PlayVideoDemo/AVProQuickTimePlayVideoDemo.cs:104)
    AVProQuickTimePlayVideoDemo_OnGUI () (at Assets/AVProQuickTime/Demos/PlayVideoDemo/AVProQuickTimePlayVideoDemo.cs:21)

    DllNotFoundException: AVProQuickTime
    AVProQuickTimeManager.Deinit () (at Assets/Scripts/Components/AVProQuickTimeManager.cs:169)
    AVProQuickTimeManager.OnDestroy () (at Assets/Scripts/Components/AVProQuickTimeManager.cs:74)
     
  14. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    If they don't have QuickTime installed then no videos will play. There is code in the plugin to detect QuickTime, at which point you could prompt the user to install it. It is possible to bundle QuickTime with your own installer and do a silent install. I don't know about including the DLLs directly but I don't think Apple would like this very much.

    Thanks :)
     
  15. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    The DLL/bundle needs to be inside the "Plugins" folder at the root and not in the root itself. So you need to have /Assets/Plugins/AVProQuickTime.bundle

    Hope that helps!
     
  16. cloudfun

    cloudfun

    Joined:
    Oct 2, 2011
    Posts:
    35
    hi andrew
    first at all thanks
    but it doesnt work
    thats how i got and still is the same problem

    could you help me please? im really lost
    i think that the problem is your package in unity 4 on MAC need to do something more
    but i really dont khow what
     
  17. JVox

    JVox

    Joined:
    Jan 17, 2013
    Posts:
    1
    Hey Andrew, I just purchased your plugin and I am having the same issues as cloudfun. Im on a mac using Unity 3.5.6f4. Thanks!
     
  18. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Not too elegant as user might not have admin access. How does VLC Player play QT files then?
     
  19. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    To all Mac users,

    The last version of the asset store had a corrupt bundle plugin file. Please download the new version (2.43) to get the fix. Sorry about this!

    Thanks to everyone that reported the problem.
     
  20. cloudfun

    cloudfun

    Joined:
    Oct 2, 2011
    Posts:
    35
    thanks for your help andrew, really was a nightmare but was so simple :)
    thanks again
     
  21. cloudfun

    cloudfun

    Joined:
    Oct 2, 2011
    Posts:
    35
    hi again
    i need your support again
    why all the videos look so yellow?
    how can i change that?
    the demo videos too

    i need to show quicktime videos on the gui ill start from your playvideodemo
    ill pass the name on the video as a parameter and thats all, but im searchin gon the two scripts AVProQuickTimeGUIDisplay, AVProQuickTimePlayVideoDemo
    and im not able to find where do you put yellow filter or whatever

    thanks a lot in advance
     
  22. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    That is very stange..I'll continue with this over email so we can find out what's going on.
     
  23. cloudfun

    cloudfun

    Joined:
    Oct 2, 2011
    Posts:
    35
    thanks it was my fault andrew
     
  24. Gromit

    Gromit

    Joined:
    Nov 20, 2012
    Posts:
    9
    Hi,

    I'm having a problem with multi-video playback after upgraded to Unity 4 on my Mac. Basically I have 2 videos loaded, and whenever one reaches the end, Unity crashes without any error or warning.

    This also occasionally happens when I scrub multiple videos concurrently.

    I have also updated my AVPro to version 2.43, but there wasn't any luck.

    Any help would be appreciated.

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------

    Edit: I just checked, I haven't actually updated to 2.43, it was simply importing the old 2.0. Trying to get it updated now, but it seems like asset store is not responding, it just stays "purchasing" forever.

    Edit2: Finally updated the plugin, doesn't seem like it's crashing anymore.
     
    Last edited: Jan 30, 2013
  25. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Glad it's working now Gromit :)
     
  26. norbykov

    norbykov

    Joined:
    Jul 27, 2010
    Posts:
    23
    Hey guys,

    Thanks for the awesome plugin. I have a quick question. I have 8 videos, and I play them one after each other in a loop, from memory (they're stored as bytes). First I tried to load them with Resource.Load, then used the code you supplied with one of the demos. In both cases, the memory used by the application seems to be getting higher with time, to a point where after a couple of hours, it reaches about 2GB's, and - I assume this is the reason - it crashes. I tried to unload all unused resources, clean memory, but it seems to not make much difference, as it slowly fills up the memory. I don't seem to have such problem when loading it from disk, although I haven't run it for 4 hours straight yet. Do you have any suggestions?

    Cheers,
    Norby
     
  27. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi Norby, I had a look and you're right! There is a leak in the playback from memory! Luckily the fix is easy. In AVProQuickTime.cs go to the function PrepareMovie() and at the top change the code to this:

    if (_movieSource != AVProQuickTimePlugin.MovieSource.Memory)
    {
    if (!AVProQuickTimePlugin.LoadMovieProperties(_movieHandle))
    {
    Debug.LogWarning("[AVProQuickTime] Failed loading movie properties");
    Close();
    return false;
    }
    }

    We'll include this fix in the next release - thanks for reporting it!
    I would also recommend doing a System.GC.Collect() after each movie load/unload to force a garbage collection.
     
    Last edited: Feb 21, 2013
  28. suyoga354

    suyoga354

    Joined:
    Feb 19, 2013
    Posts:
    1
    Hi...

    I'm having trouble with geting movie status that I played...

    Is there's a way for me to know that the video is finish played? so I can change the movie source...

    thanks...
     
  29. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes, here's some pseudocode:

    class NextMovie : MonoBehaviour
    {
    public AVProQuickTimeMovie _movie;

    public void Update()
    {
    if (_movie.MovieInstance.Frame + 2 >= _movie.MovieInstance.FrameCount)
    {
    // your code to skip to next movie here...
    }
    }
    }
     
  30. norbykov

    norbykov

    Joined:
    Jul 27, 2010
    Posts:
    23
    Thanks Andrew, I'll check this out and let you know the results.

    Cheers!

     
  31. Wisit-Nik

    Wisit-Nik

    Joined:
    Jul 28, 2012
    Posts:
    12
    Hi, I have a little problem to figure out, what is file path look like?
    If my file placed at D:\Movies\

    Thanks
     
    Last edited: Mar 2, 2013
  32. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    The folder should be written as "D:/Movies/" then the filename can just be "movie.mp4".
     
  33. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi!

    Version 2.5 has just been released. What's new:

    + Added a new demo that plays a queue of videos
    + Fixed GL.IssuePluginEvents() conflict bug with other AVPro plugins.
    + Optimised and improved pixel format conversion
    + Memory optimisations
    + Improved AVProQuickTimeManager
    + Fixed Apple App Store submission issues
    + Fixed small memory leak when playing movies from memory.
    + Added dynamic setting of loop state.
    + Added path resolve for relative paths when working path isn’t that of the EXE
    + Fixed several other minor bugs

    You can get the latest version from the Asset Store, or try out the demo by downloading it from our website.
     
  34. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Unity 4.1 was released today and the current release of our plugin doesn't work with it yet. We are working on the issue and should have a new version out in a few hours. Thanks for your patience :)
     
  35. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Pleased to say that the plugin has now been updated on the Asset Store to support Unity 4.1 and we also fixed a few other issues with other versions of Unity!
     
  36. lunoka

    lunoka

    Joined:
    Jul 3, 2012
    Posts:
    16
    Hi Andrew,

    I updated Unity this morning and have experienced a white screen during several frames before the video started ( on AVPro QuickTime 2.43 ), but at least the fvideo was still playing. I made the update from the assetStore ( v 2.52 ) and now the video remains white all along the replay and i get this warning :

    [AVProQuickTime] unable to convert camera format

    Do you have any idea about what could have cause this change ?

    Thanks for reply.
     
  37. Butterworth

    Butterworth

    Joined:
    Aug 8, 2012
    Posts:
    25
    Hello.

    Is there currently any way to determine if the movie loaded contains an alpha layer? Or better yet, determine before loading the movie with some sort of query call? Is there any performance hit if I simply use the RGBA shader (CompositeSwapChannelsRB) for all movies, even if they contain no alpha layer? Historically with our old movie system we loaded the movie, then queried if it had alpha, then we created the movie texture using either a standard shader or if it had alpha, we used a shader that supported transparency.

    Thanks in advance.
     
  38. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hmm that's odd. Could you email me more details? Perhaps include the video file and what version of Unity you're using. Hopefully then I can fix it super quick :)
     
  39. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi Butterworth,

    I'm afraid there currently isn't a way to query whether a movie has an alpha channel or not. You may need to store this data somewhere in a metadata file for example and query it during loading. This is something we'll try to add in the next release!

    The RGBA method is defininitely more expensive as it has to process double the amount of pixels even if there is no alpha layer. It depends on what sort of machine you're running on but it could certainly be feasible to run it in RGBA mode all of the time.

    I hope that helps for now. I have added your suggestions to the list.
     
  40. lunoka

    lunoka

    Joined:
    Jul 3, 2012
    Posts:
    16
    Hi Andrew,

    I found the problem. After updating the plugin, shader references were missing on the ManagerObject. Now it's ok.

    Cheers.
     
  41. Butterworth

    Butterworth

    Joined:
    Aug 8, 2012
    Posts:
    25
    Thanks for the response.

    I have another question. Unity now has a beta version that will publish to Windows 8. Will your quicktime player work in Windows 8?

    Thanks in advance.
     
  42. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes, I've tested it in Windows 8 and it does work :) I don't know what the Windows 8 App Store policies are though.
     
  43. Butterworth

    Butterworth

    Joined:
    Aug 8, 2012
    Posts:
    25
    So I got the Windows version of our game working nicely with your Quicktime player, but when I switch to the Mac I have run into a few problems.

    The first problem was, calling "StartFromFile" more than once in a frame seemed to not fully load the subsequent calls, or at least they did not update the associated Unity textures. I got around this by calling this method only once a frame when loading the level.

    The second problem I am still working on is, when I am finished with a movie I set the frame to zero so that it is in the starting position for the next time it will be used. The call "AVProQuickTimePlugin.SeekFrame" doesnt seem to do anything under certain conditions, but I havent as yet narrowed down what the conditions are. Since I cannot step into the DLL, can you possible provide some insight as to why or when this call may fail to set a movie to frame 0?

    Thanks in advance.
     
  44. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    We're looking into this and will get back to you when we know more. Thanks for reporting the problem and apologies for the trouble it's causing you.

    Will get back to you shortly!
     
  45. bigSky

    bigSky

    Joined:
    Jan 31, 2011
    Posts:
    114
    Hi There,

    I'm on mac os 10.7.4, and using unity 3.5.7, and have the plugin in Assets/plugins/and my movie in the AVProQuicktime/Demos/Shared folder. When I export my movie, I see a white mesh. Previewing the scene in the Unity editor works fine. Very frustrating.
     
  46. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    When you make a build the movie files aren't automatically copied to the build folder. You need to do this manually and maintain the same folder structure you use in the editor.
     
  47. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi Butterworth.

    We have done some tests but haven't been able to replicate these issues. I think it would be best if you could send over your videos and a test scene so we can reproduce the issues and see what's wrong.

    Thanks,
     
  48. huntsfromshadow

    huntsfromshadow

    Joined:
    Feb 8, 2013
    Posts:
    1
    Hello,

    Curious about the alpha channel capabilities of the plugin.

    We are trying to find a plugin that will let us play a movie, and have part of the movie transparent (so we can see what is behind the movie). This is very similar to what we do with 2d png sprites in our project.

    I saw in your demo you had the ability to blend the alpha, but that started to fade the entire movie rather than just part of it.

    Curious if your plugin would work for the above use.

    Thanks
     
  49. maxG

    maxG

    Joined:
    Apr 4, 2013
    Posts:
    4
    I am also curious about the Alpha Channel functionality... It appears that when I try to change the color profile to RGBA it reverts back Ycb at runtime... Is it necessary to use this color profile to work with embedded alpha channels? And are there any specific shaders that need to be implemented or will the alpha register with anything, like a standard Diffuse?

    windows 8 / QT installed / unity 4.1

    Thanks!

    EDIT:

    False alarm... I forgot that I was referencing files I had already imported, which converted to theora, thusly losing alpha channel...Aaaaand fixed.

    Great plugin mates :)
     
    Last edited: Apr 4, 2013
  50. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes, if you use a video with alpha channel (we don't have any in our demos) and select the RGBA colour-space then it will behave just like a sequence of transparent PNG files. We will try to add a transparent video into the next demo...We actually kept it out just to save file size.