Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[Released] AVPro Windows Media

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

  1. wm-VR

    wm-VR

    Joined:
    Aug 17, 2014
    Posts:
    123
    We are recording 360 stereoscopic videos with Unity 5.

    For instance in one scene there is a cinema screen playing a movie (the cinema plane-mesh has correctly attached your AVProWindowsMedia plugin) When we start to capture the whole scene it seems that everything around the video (seat meshes, audience animations..) will be captured appropriately (it takes about 2 seconds for each frame to capture a single picture) except the video which seems not to stop during the capture-process. It still keeps running in background. The result is a fast forward playing movie with a lot of missing frames.

    We've spend a lot of time to find a solution for this problem but it seems without your input we'll not find a proper way out.

    Thanks,
    Wolfgang
     
    Last edited: Mar 27, 2016
  2. JosephLaurinoMSFT

    JosephLaurinoMSFT

    Joined:
    Aug 21, 2015
    Posts:
    1
    I have a movie (4096x2106) encoded as HAP. Using the PlayVideoDemo scene, I loaded the movie and it loaded successfully. But the scene is rendering invisible frames. I verified in Quicktime 7 that the movie displays and it does. Any suggestions on what to do?

    Thanks!
     
  3. Emilio-Martinez

    Emilio-Martinez

    Joined:
    Jun 19, 2015
    Posts:
    2
    If you just Play() the video, the plugin will update the movie texture in the background independently of Unity's framerate.
    Sounds like you want to manually scrub it frame by frame. It's something like this iirc:
    Code (csharp):
    1. void Update () {
    2.  
    3.     if (playMovie)
    4.         GetComponent<AVProWindowsMediaMovie>.PositionFrames++;
    5. }
     
    Last edited: Mar 28, 2016
    wm-VR likes this.
  4. idunnuhow

    idunnuhow

    Joined:
    Apr 16, 2014
    Posts:
    23
    im having problems for hap alpha playback with avpro win media. im using unity 5.3.3 with ur latest plugin version. when i load the video in the editor inspector using color format y cb cr_hd there are no errors but just a blank white in the video preview. Other hap videos with hap codec(hap1) codec play fine, so guess its my video. here is my video's info: format mpeg4 quicktime(.mov),codec is hap alpha(hap5) resolution width height are multiple of 4. any ideas?

    edit solved: using VDMX5 and AVF Batch Converter i reconverted my problematic hap alpha video and it is working now!
     
    Last edited: Apr 5, 2016
  5. rastleks

    rastleks

    Joined:
    Jul 17, 2014
    Posts:
    43
    Hi! :)

    I have some issue.
    In play mode movie is more brighter then in any movie player (like Windows movie player, VLC, media player in win 10, etc).

    How i can fix it?
     
  6. suifeng

    suifeng

    Joined:
    Nov 13, 2014
    Posts:
    2
    The OutputTexture is Rotation 90 Degrees When I get it,I Need it positive. in old version it is right, but
    I upgrade , get the OutputTexture is not what I need. Need Help.......
     
  7. luigix

    luigix

    Joined:
    Mar 13, 2010
    Posts:
    15
    I'm looking for a solution to stream (over http) videos in Unity which are drm protected like Playready-Smoothstreaming, mpeg dash or widevine.
    Anychance I can do it with AVPro, or it just works with local files?
     
  8. HsinChien

    HsinChien

    Joined:
    Nov 19, 2012
    Posts:
    22
    it take quite a while to start playing the movie. For all the demos, when I press "play" button in Unity, I have to wait for couple seconds until the movie actually shows up (the editor freezes for a while). Are there any way to avoid the wait? Thanks!
     
  9. ATMEthan

    ATMEthan

    Joined:
    Dec 27, 2012
    Posts:
    54
    Can this plugin work with Unity UI/Canvas objects? Like an image or panel game object?

    I'm messing around with the plugin now to see if this is possible but right now its not looking good.

    Thanks for the info,
    -Ethan
     
  10. Evgeniy1

    Evgeniy1

    Joined:
    Apr 13, 2016
    Posts:
    1
    Hey. Sorry for my English. I need to get an array of bytes to decrypt the video, is that possible?
     
  11. kideternal

    kideternal

    Joined:
    Nov 20, 2014
    Posts:
    82
    I'm curious about this as well. I thought "media.OpenVideoFromFile(filename)" was supposed to be on a separate thread, but if so, it still blocks the main thread, causing those of us in VR-land to see our "desktops" while it loads. The delay is worse when opening a streaming video, naturally.

    What's a developer to do?
     
  12. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Hi Gert,

    First of all you have to define your clips in the AVProWindowsMediaMovie component. You can then script it to react how you want. Here is some pseudocode:

    //
    Code (CSharp):
    1. AVProWindowsMediaMovie movie;
    2.  
    3. // Play the looping clip
    4. moviePlayClip.("MyLoop", true, false);
    5.  
    6. // When a key is pressed the video will continue playing from the current position until the end
    7. if (Input.anyKey)
    8. {
    9.    movie._loop = false;
    10.    movie.ResetClip();
    11. }
    12.  
     
  13. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Glad to hear you found a fix for this! It certainly should work with Unity 5.3.3 though....
     
  14. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Hi Jason,
    This is certainly tricky to achieve. Video playback needs buffering etc so joining up audio and video seamlessly is quite hard. Definitely your best option would be to use a simple MP4 file (without B-frames) so that it starts playback very fast. The Hap format probably has the fastest start of any format but it still might not be good enough. To get it seamless we would really need to write some smart code at the low-level. You should be able to encode Hap using FFMPEG. The virtualdub tool can also be used if you install our DirectShow encoder here: http://renderheads.com/product/hap-for-directshow/

    I guess you could try adding a visual cross-fade to help the two videos blend together and hide the seam. The audio could also fade up/down quickly to cross-fade....

    Sorry I don't have a brilliant solution for this.
     
  15. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Hi. This is strange. I'm afraid I don't have an answer for this. Could you send over a sample scene? Also how often does it crash? What kind of videos are you playing? Do you load/unload a lot of videos? Email us unitysupport@renderheads.com so we can investigate further.
     
  16. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Hi! I'm afraid we don't have the ability to play backwards. You can however pause the video and move backwards in time yourself, but any audio embedded will not play. This might be good enough for your usage. Another note is that if you are scrubbing/seeking backwards is that you should make sure your video is encoded with a key-frame per-frame, otherwise seeking will be very slow. Otherwise it should work well. Thanks,
     
  17. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Ahhh great advice :)
     
  18. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Hi Wolfgang,

    Yes the current version doesn't support any changes to Time.timeScale etc.

    Basically you would need to be able to detect changes to Time.timeScale or Time.captureFrameRate and then use your own timer to seek the video position manually. Each frame you would need to then seek to the new time and wait for a frame to come though. The FrameExtract demo shows how to wait for a frame. Each seek might not produce a frame so your wait would need a timeout value.

    We've used the above approach before when experimenting with video capturing our scenes and it has worked well. We will try to build this in to the next release as it seems to be useful to other people. In the meantime you may be able to implement it yourself. If you need more help just email us
    unitysupport@renderhads.com

    Thanks,
     
  19. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Hi,

    Our plugin doesn't support some of the new Hap frame formats. I would recommend uninstalling your Hap codec and installing an older one (like Version 3) from the github page. This should resolve the issue. You should also make sure that your video resolution is a multiple of 4.

    We will upgrade to the new version of Hap very soon but the above should work as a workaround for now.

    Thanks,
     
  20. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Sorry about this. I think this is because we haven't updated our Hap support to the latest version. If you use QuickTime then you need to use an older version of the encoder (like version 3 from the github page). We will add support for these newer frame formats soon. Thanks,
     
  21. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Hmm this is strange. Possibly due to a color-space conversion. If you set the "color format" option to RGBA32 then it should resolve correctly. If it doesn't then please email us your video so we can take a look. unitysupport@renderheads.com

    Thanks,
     
  22. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    I suspect you mean 180 degrees? Did you make sure to completely delete the old plugin files before upgrading?

    You could let me know:
    1) Which Unity version you're using?
    2) Which AVPro Windows Media version you're using?
    3) Which graphics API you're using (D3D9, D3D11, OpenGL) ?
    4) How are you displaying the video (IMGUI, uGUI, mapped to a mesh)?

    Ideally send us a copy of your project and/or video file.

    Either reply here or email unitysupport@renderheads.com where we can continue looking at this.

    Thanks,
     
  23. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    I don't think we'll be adding such support to AVPro Windows Media. Our new primary video plugin AVPro Video already has some basic streaming video support and this is probably where we will be putting any effort to support things like mpeg-dash in the future.
     
  24. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Hi,

    That's strange - they should start immediately. Perhaps you have a slow HDD?

    Perhaps you have a filter/codec pack installed that is doing some sort of frame buffering? Try uninstalling all codec packs.

    Some formats do take a while to start if they have been encoded with many reference frames or using B-frames. This is usually seen in H.264 videos that have a lot of compression.

    The sample videos however are very lightly compressed and should start straight away. Did you try it on another PC?
     
  25. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Yes uGUI is supported. We even have a uGUI component so you can just add it very very easily! It should be available in the normal component menu, or in "GameObject/UI/AVPro Windows Media uGUI" menu.

    I hope that helps,
     
  26. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Hi, I think I know what you're after. It's possible to load a video from memory (byte array). Take a look at the demo scene: PlayVideoFromResourcesDemo. This shows how you can load a video from Unity Resources (so they aren't exposed externally as files). This is done by reading it from via the Unity Resources class into a byte array and then passing that array to our plugin.
     
  27. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    I think you may be talking about AVPro Video and not AVPro Windows Media (cross thread message).

    AVPro Video does have asynchronous loading for Windows 8 and above. AVPro Windows Media doesn't have asychronous loading so there can be a small pause when loading new conent.
     
  28. Handsome-Wisely

    Handsome-Wisely

    Joined:
    Mar 20, 2013
    Posts:
    101
    I want to a AVProWindowsMedia.dll 64x, can you give me one. i have a x86, i can change with you!
     
  29. BB_Nabu

    BB_Nabu

    Joined:
    Apr 5, 2016
    Posts:
    4
    Hi everybody,
    I am on the first stages of research for a new game that will come out on XBOX and UWP
    The habitability to play HD video will be a mayor feature
    Is it at all possible to use this plugin while:
    1. building for XBOX
    2. building for UWP?
    3. what about UWP running in XBOX?

    Thank you
     
  30. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Hi, AVPro Windows Media isn't suitable for XBOX or UWP. I would encourage you to look at AVPro Video which has upcoming UWP support. I'm not sure about XBOX but in theory XBOX supports UWP....
     
  31. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    I'm not sure what you mean :) AVPro Windows Media comes with both 32-bit and 64-bit DLLs.
     
  32. aps2015

    aps2015

    Joined:
    Jun 13, 2016
    Posts:
    4
    Hello,

    Im using AVProWindowsMedia-v2.90-Trial, using the 360SphereVideo Prefab, videos play fine from StreamingAssets folder when in Editor mode but the log shows a "cannot load" message when trying to run the Build.

    Does anyone know how to fix this?

    Thanks
    Alex
     
  33. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    That's strange. Which version of Unity are you using? Did you try making a 64-bit build too? Which OS are you using?
     
  34. aps2015

    aps2015

    Joined:
    Jun 13, 2016
    Posts:
    4
    Hi,

    Unity 5.3.5f1,Win7

    Just tried a 64 bit Build and it works fine, but not 32-bit.

    Thanks for quick response!
    Alex
     
  35. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Interesting..we'll investigate further. I'm sure Unity will make 64-bit builds the default soon... :)
     
  36. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Hi All!

    One of our users has spotted a bug in the current version (v2.90) that allows changes to AVProWindowsMediaMovie component to not be saved. So you can edit a property such as "looping" but Unity will not mark the file as needing to be saved.

    If this is happening to you and you can't wait for the next plugin update I've attached here the two fixed scripts. As a bonus it now supports multi-object editing.

    These are the two files that need replacing:

    AVProWindowsMediaMovieEditor.cs in /Assets/AVProWindowsMedia/Editor
    AVProWindowsMediaMovie.cs in /Assets/AVProWindowsMedia/Scripts/Components

    Thanks,
     

    Attached Files:

  37. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Hi Alex,
    I've investigated more. I didn't have any problem with the 32-bit version or 64-bit version. I suspect that your machine has an alternative 32-bit codec installed for mp4 or h.264, or perhaps a filter pack and this is interfering with the video playback. Thanks,
     
  38. aps2015

    aps2015

    Joined:
    Jun 13, 2016
    Posts:
    4

    Good to know thanks, i'll stick with 64-bit builds for my purpose. - plus im not sure how to resolve the codec/filter pack issue you mention. Thanks
    Alex
     
  39. aps2015

    aps2015

    Joined:
    Jun 13, 2016
    Posts:
    4
    Hello,

    How can I make the video in the 360 Sphere Prefab play on a key press?
    I've made a script that allows me to drag the Video child from the prefab into it.

    public GameObject Video;
    void Update () {
    if (Input.GetKeyDown ("space")) {
    //how to make the prefab play?
    // Video.play(); ??????? etc​
    }​
    }

    Thanks
    Alex
     
  40. lia9m

    lia9m

    Joined:
    May 24, 2016
    Posts:
    3
    Hi Andrew,

    I'm trialling AVPro Windows Media as a solution for playing videos intermittently in a splash screen/attract mode kind of situation. The trial works well, was easy to setup and I haven't had any trouble with codecs and containers, so it's looking like this will suit our needs.

    I've written a test that plays your sample videos on an NGUI texture with a 5 second delay between them in an infinite loop. The code is a coroutine that uses AVProWindowsMediaMovie.LoadMovie (true), waits for completion, uses UnloadMovie, waits 5 seconds and repeats for the next video.

    I left this running overnight but after a few hours it crashed with an Access Violation in the .dll. This was running with no user input, no sleep mode and no file changes during runtime. Im running it again and don't see any obvious memory leaks from Loading and Unloading movies repeatedly. This was with two 10 second videos and a 5 second delay, so each video would have been played well over 250 times before having any trouble.

    The videos are being loaded from disk from a directory that has no access restrictions. Color format, audio and texture options are all using default values. Im using Unity 5.3.0f4 and am sticking with this version for the remainder of the project. The software was running on an Windows 7 PC with an AMD APU, the software runs at an easy 200fps while the HD sample is playing.

    From the crash logs:

    AVProWindowsMedia.dll caused an Access Violation (0xc0000005)
    in module AVProWindowsMedia.dll at 001b:098ef2d7.

    Read from location 0000002c caused an access violation.

    ========== OUTPUTING STACK TRACE ==================

    0x098EF2D7 (AVProWindowsMedia) LoadMovie
    0x098F007D (AVProWindowsMedia) LoadMovie
    0x098EDE1C (AVProWindowsMedia) SeekSeconds
    0x014A3344 (GameName) GetGfxDevice
    0x019338CF (GameName) RemapPPtrTransfer::TransferTypelessData
    0x019366AE (GameName) RemapPPtrTransfer::TransferTypelessData
    0x0157F4CD (GameName) Thread::RunThreadWrapper
    0x75FCED5C (kernel32) BaseThreadInitThunk
    0x772E37EB (ntdll) RtlInitializeExceptionChain

    ========== END OF STACKTRACE ===========

    **** Crash! ****
    If you have a solution for this or if there's any extra data i can gather for you please let me know. In the meantime I'm repeating the test and hoping to be able to reproduce it. Thanks very much!

    edit: I ran the test overnight again and produced the same crash again.
     
    Last edited: Jun 17, 2016
  41. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Hi,

    Thanks for the excellently detailed report!
    We do run our own soak tests before releasing a new version so I'm surprised to see this :)

    I will look into this today to see if I can reproduce. I suspect it's only happening on the 64-bit build and the 32-bit build would be okay.

    In the meantime have you considered using our AVPro Video? It's a newer plugin that AVPro Windows Media and we've put a lot of development effort into it recently.

    I'll get back to you about the crash.

    Thanks,
     
  42. ChrissCross

    ChrissCross

    Joined:
    Jun 27, 2016
    Posts:
    5
    Hi Andrew,

    I have a small question I hope you can help me with.

    We are making a game for the Oculus rift and we're integrating your plugin to show movies to our players. It seems however that when people are using the integrated headphones of the oculus rift it gets very laggy and the sound gets directed to the system default headset anyways. Switch off the integrated sound and the movies shows butttery smooth.. Any ideas how we can fix this? Thank you for your time.

    Kind Regards,
    ChrissCross
     
  43. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Hi,

    What do you mean by "switch off the integrated sound"? :)
     
  44. Igoraan

    Igoraan

    Joined:
    Jun 6, 2015
    Posts:
    2
    Hi Andrew,

    i integrated the AVpro-video package in one of our projects and for the most part it works great. The only problem we encounter is, that sometimes the sound of the video starts playing but the screen remains blank.

    i'am not sure where to look for the solution to this problem, since it only happens 1 in 4 times.

    I'am using unity 5.3.4 and i hope you can give me a few pointers on where to look. Let me know if you need more information on the problem.

    Thanks for a great package, that even with this problem works better then most other video playback solutions.

    Kind regards,

    Igoraan
     
  45. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Hi Igoraan,

    Thanks for your question. This isn't the right forum for your question (should be here), as this is the Forum for another plugin AVPro Windows Media :) But I'll answer anyway.

    If AVPro Video manages to decode the audio track but not the video track for some reason then it will just play the audio. There are a reasons why it might fail to decode the video track:
    1) codec isn't supported
    2) codec is supported but its resolution is too high
    3) codec is supported but the decoder isn't able to decode this specific varient (eg H.264 level 5.2 isn't supported by Microsofts H.264 decoder so only up to level 5.1 works).

    I suspect it is either issue 2 or 3.

    We have just released a new version of the AVPro Video plugin today so you might like to upgrade to it. We aim to improve the case you present here in the future.

    Thanks,
     
  46. ChrissCross

    ChrissCross

    Joined:
    Jun 27, 2016
    Posts:
    5
    Hi Andrew,

    Thanks for your fast reply.. Sorry if I didn't make myself clear enough. What I meant is that right now when we're playing our game, all game sounds and music are coming from the integrated Oculus Rift HeadPhone. However as soon as we play a video using the Media plugin in the game, the sounds go to my default music output (in my case my gaming headset). My collegue is using a DK2 who doesn't have integrated sound so all his game sounds and music as well as the video sound is coming through his headset.

    I guess my question is how can I target a different audio device than the default one to see if this stops the lag (music and video wise)

    Thanks for your time.

    Edit: Way too many smiles... deleted them :p
     
  47. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Nothing wrong with smiles :)

    So I think the lag issue may be more to do with the differences between CV1 and DK2. Particular that DK2 runs at 75hz and CV1 runs to 90hz. I could be wrong though but that's my hunch.

    You should try out the new v1.3.6 release. It has a new option to specify the name of the audio output device (Windows DirectShow player only) so that hopefully you can pipe audio to the Rift / Vive headphones. This is the first release with this feature and we aim to improve it further in the next.
     
  48. ChrissCross

    ChrissCross

    Joined:
    Jun 27, 2016
    Posts:
    5
    Fast reply! Thanks man. I'll give it a go. One of our testers said that when he disabled his rift audio (eg. 'switch off the integrated sound') everything plays perfectly on his CV1. I'll download your latest version, give it a try and post the results here!
     
  49. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,805
    Hi AVPro Windows Media users.

    We will begin phasing out AVPro Windows Media soon as we are replacing it with our newer and much more powerful plugin: AVPro Video. Soon AVPro Windows Media will be deprecated and will be removed from the Asset Store. This will allow us more time to focus on the newer plugin and make it even better!

    AVPro Windows Media was has been a Unity plugin since 2011 so it's had a pretty good run :) Thanks to all of our users over the years! We may do one final release before we deprecate it. Anyone looking to purchase this plugin please instead purchase AVPro Video.

    Thanks,
     
  50. pleribus77

    pleribus77

    Joined:
    Jul 9, 2013
    Posts:
    36
    Hi, I'm also experiencing flipping of videos that play through for a second time in Unity 5.3.5.

    They are flipped both horizontally and vertically when the app loads the first video again. Stranger still, if I toggle the game window between maximise and small, the video rights itself.

    I don't have the option of downgrading project to Unity 5.2 like other poster, nor can we use AVPro Video plugin due to not supporting HAP Q yet (have purchased, only to find it didn't support - I should have read docs first)

    Is there anything you guys can do to help track down this issue - have a large event next week where we are using this, so desperately need support.