1. All Unity Pro perpetual license customers: your special offer to subscribe is ready! Click here.
  2. We're running a survey about the usage of our graphics pipeline, help give us your feedback.
  3. Unity 5.6 beta is now available for download.
  4. Unity 5.5 is now released.
  5. Check out all the fixes for 5.5 in patch releases 1 & 2.
  6. Enter the Google Play Indie Games Contest in Europe. Read more about it here.
  7. Get prepared for the Tizen Mobile App Incentive Program! Read more about the upcoming program here.
  8. Enter the Microsoft Developer Challenge for a chance to win prizes. Read more about it here.

[Released] AVPro Video - complete video playback solution

Discussion in 'Assets and Asset Store' started by AndrewRH, Feb 12, 2016.

  1. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Messages:
    1,075
    Yes the video loading is asynchronous so calling RequiresVerticalFlip immediately after the Open function will not return a valid result. You should only call this function once the video has loaded which you can establish by either listening for the event or polling the Info interface of MediaPlayer and calling one of the status functions there :) I hope that makes sense!

    Cheers,
     
  2. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Messages:
    1,075
    Hi Paulo,

    We have replicated the bug and fixed it. The fix will be included in the next release of the plugin. Thanks once again for reporting this issue.
     
  3. sam598

    sam598

    Joined:
    Sep 21, 2014
    Messages:
    9
    Hard drive space quickly gets filled on OSX.

    It seems that whenever the video stops playing and the VideoEvent "FinishedPlaying" is called, the application takes up a portion of storage roughly equivalent to the size of the video file. If a large video file is used and played multiple times, this takes up gigabytes of space and causes the application to crash.

    No storage is taken up when the file is first played, and no storage is taken up when seeking or starting to play from the first frame multiple times. Tried on Windows 8.1 as well and it works fine.

    Only seems to be in OSX when the video reaches it's end.

    Hardware:

    Mac OSX 10.9.5, 2.3 GHz Intel Core i7, 16GB 1600 MHz DDR3, SSD

    Development Environment:

    Unity 5.3.4f1, OSX, AVPro Video 1.3.0

    Video details:

    1920x1080 H.264 30fps and 1920x1080 ProRes 422, 30fps
     
  4. yingwang

    yingwang

    Joined:
    May 8, 2016
    Messages:
    5
    Looking at the Demo_VideoControls scene, I notice there is a flicker after clicking the 'Next Video' button when transitioning to the new video. This is understandable as OpenVideoFromFile() is loading the next video asynchronously.

    Is there any way to play video files without the flicker? Perhaps even a workaround?
     
  5. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Messages:
    1,075
    Hi Sam598.

    Thanks for the very detailed issue report! This is mighty strange. Video playback taking up disk space? We will of course look into this and get back to you. I can only imagine that for some reason Apple's ProRes decoder is expanding the file to some temporary location... Very strange. I presume that doesn't happen if you use a non ProRes video? If you could email us unitysupport@renderheads.com a copy of your test video that would really help. Also you mentioned that this doesn't happen on Windows - how were you playing a ProRes file on Windows? I didn't know it was supported..

    We will try to get this resolved ASAP. Please get back to us with answers to be above questions.

    Thanks,
     
  6. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Messages:
    1,075
    Yes certainly. There is another sample scene called "imgui" that demonstrates how to get around this nicely. It can transition smoothly between multiple videos.

    Thanks,
     
  7. sam598

    sam598

    Joined:
    Sep 21, 2014
    Messages:
    9
    Thanks Andrew! It's actually both H264 and ProRes files. Playing around further it seems to happen when displaying video on a Unity GUI object (the newer GUI system). I'll send over a video and scene sample.

    The new plugin is fantastic by the way!
     
  8. phileday

    phileday

    Joined:
    Feb 8, 2014
    Messages:
    50
    Hi
    I'm using the Windows original version of this plugin in my player and I'm having reports from people that mkv files don't play back very well. Is there any information about this or any possible solutions? I'm not sure how to reply to these problems as I don't seem to be able to easily recreate them. Have you or anyone else experienced any similar issues?
     
  9. yingwang

    yingwang

    Joined:
    May 8, 2016
    Messages:
    5
    Thanks for the quick response, Andrew. I see the scene you pointed me to uses a black fade between video loads. If I deselect the 'Fade to Black During Loading' option the video transitions exhibit the flickering. I assume there is no way to load and play the new video immediately given that the video sources are located in the StreamingAssets folder? Essentially, I want to make it appear that the new video is a seamless continuation of the currently playing one.
     
  10. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Messages:
    1,075
    Yes it's possible. You can have two MediaPlayer components and ping-pong between them. Use the inactive one for loading and once it has a frame you can switch to it and stop the playing MediaPlayer. So it's totally possible to do. We'll add component for this in the future so you can just drop them in :)

    Cheers,
     
  11. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Messages:
    1,075
    Hi Philip,

    We don't use MKV files at all and haven't had any reports of them causing problems. I believe Windows 10 has native support for MKV but I have not tested it. Once we get the DirectShow fallback then at least 3rd party filters (such as Haali Splitter / LAV can be used).
     
  12. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Messages:
    1,075
    Thanks sam598! Very weird that the disk space gets used.. Thanks for sending over the files, we'll take a look and get back you to.
     
  13. paulo.zaffari

    paulo.zaffari

    Joined:
    Jul 9, 2013
    Messages:
    3
    Cool. And when will the next release be?
     
  14. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Messages:
    1,075
    We don't have a release date for the next version yet and we have a lot of new features to get into the next version :) Within 4 weeks certainly! If you need it urgently please email me at unitysupport@renderheads.com and I can try to get you a beta version containing the bug-fix. Thanks,
     
  15. SingularDeviation

    SingularDeviation

    Joined:
    Mar 24, 2015
    Messages:
    2
    Hi,

    I use this plugin to stream videos hosted on the internet to an iPad. Unfortunately I have two issues while doing so. One of the issues that sometimes occurs is already meantioned by Tom Goethals ("When i have a progressive download stream it almost immediately starts playing it but then stops a few seconds in. sometimes after 3 seconds. sometimes after 30s. The wifi connection seems okay and the same codebase on android does not show this problem. It never resumes once it stops.") but from what I understand you already looked into this.

    Another issue I have is that the video sometimes shows a past or future frame (I think it's a future frame). When I set the video to loop, it always happens at the same frame. When restarting the application or video it does not happen at the exact same frames of the previous playback, but at random other frames. It looks like sometimes a few frames are downloaded/stored in the wrong order.
    It seems this only occurs with higher resolution/bitrate videos, (720p), I have not yet encountered this issue while using a low-res video.

    Please let me know if there is anything I can do to fix or work around these issues, or if it is possible to release an early fix (I don't think our client can wait 4 weeks).
     
    Last edited: May 10, 2016
  16. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Messages:
    1,075
    Hi thanks for reporting these issues. We're looking into them at the moment and will hopefully have a fix very soon :) If we forget to contact you then do remind us. Thanks,
     
  17. lacucaracha

    lacucaracha

    Joined:
    May 11, 2016
    Messages:
    8
    Hello Andrew,
    I'm working with : Windows Media and QuickTime

    By the time i used those plugins, I had needs for my clients so i modified your plugin.
    For Windows, I don't want my user to install an external codec package with the player.
    Plus i wanted a full support of local files and url files/stream.

    My solution was to develop a new Dll using ffmpeg in order to replace your Dll in unity. So all the call avpro windows does in your Dll, i replaced them by my code compiled in a Dll too.
    So i just use your code in my apps for all the texture conversion, interface etc.. I change the codec part.

    I pretty much did the same for Mac, mostly for the performance and the streams part.

    I decode everything with ffmpeg, then i pass the texture to unity via pointer and opengl.
    So i have 2 plugins in my apps, both with modified dll code and calls in order to interact with your code.

    Is it worth it to use this new plugin ?
    What about the performance ?
    Can i decode and display streams ?

    i read your online documentation but it only said "support = yes" i need more info.
    Consider i have the same needs for windows and osx ! ( i dont use iPad, android etc..)

    I tried your demo unity package, but nothing worked. I can't see anything. Local files or Url.

    Thanks for your time.
     
  18. Tunkali

    Tunkali

    Joined:
    Feb 5, 2013
    Messages:
    32
    Is stereo 360 L/R supported for android / google cardboard / gear VR ?
     
  19. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Messages:
    1,075
    Hi Tunkali,

    Yes it is. You can try it for yourself using the free trial version from our website.
    There is a 360 video player sample included and the material on the scene can be changed to stereo L/R setting in the inspector.

    Good luck!
     
  20. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Messages:
    1,075
    Hi lacucaracha,

    It sounds like you're been having a lot of fun with DLL's ,great work!.

    Overall the performance of the new AVPro Video plugin is much better than the old plugins. This is partly due to better code design and also because it's based on newer OS media player libraries. In the old plugins we were using DirectShow and QuickTime which are deprecated technologies that haven't been updated in years. The new plugin is based on AVFoundation and Media Foundation which are much newer and have faster decoders.

    AVPro Video has some support for streaming video yes. Naturally though it won't be able to cover the huge format range that ffmpeg can. We try to keep away from ffmpeg due to legal reasons.

    I am VERY interested to know why the demo unity package didn't work. Please let me know which version of Unity you were using to test it with and what happened when you imported the UnityPackage. Were there any error messages or any fields in the inspector that were garbled? It is a high priority for us to make sure the trial demo version works well.

    Thanks,
     
  21. lacucaracha

    lacucaracha

    Joined:
    May 11, 2016
    Messages:
    8
    Re,

    We try to keep away from ffmpeg due to legal reasons.

    My application is available for free for everyone, correct me if i'm wrong but i won't have any problem with ffmpeg thus ?

    About the demo application, I retried the demo and still doesn't work BUT the demo is "UnityPlugin-AVProVideo-v1.1.0-Trial" which is not up to date ! (I imported the package, no error, still no video, even the bunny ones)

    So I looked at your assets page to be sure, the new link for the demo is "UnityPlugin-AVProVideo-v1.3.0-Trial".
    THIS ONE IS OK, works great !


    So i really dont remember from where but there is a link for a demo package that gave me this morning the oldest version of your demo ;)


    PS: This unity forum message verification is really horrible, i cant post a simple message without editing every single word... "spam"
     
  22. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Messages:
    1,075
    Thanks! I found the link to the old broken version and have removed it now - awesome :)
     
  23. Feydwin

    Feydwin

    Joined:
    Jan 11, 2013
    Messages:
    152
    Hello Everyone,

    I have a quick question regarding a 360 VR exp i am making :
    I need to have the video play in reverse. the video is paused at the beginning, start playing when the user look at a specific spot, and plays in reverse when the user looks away.
    Is that possible ? If so, i did not see any "Reverse" public void in the media player component. Any pointers would be greatly appreciated :)
     
  24. nsc_creative

    nsc_creative

    Joined:
    Nov 3, 2015
    Messages:
    11
    I'm developing for Android GearVR and was wondering what you recommend regarding codec compression etc.

    The maximum quality will be 4kx4k 60fps.

    We use ffmpeg for conversion on most files so I am well versed in using this command line tool to create the videos. I've created mp4 with h265 but I seem to loss audio sync. I've actually had problems with h264 which I'm currently trying to work out.

    Any help would be appreciated. If you've documented it and I've missed it please let me know.

    All the best

    Phil
     
  25. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Messages:
    35
  26. nsc_creative

    nsc_creative

    Joined:
    Nov 3, 2015
    Messages:
    11
    Thanks Tom this is very useful :)
     
  27. kideternal

    kideternal

    Joined:
    Nov 20, 2014
    Messages:
    58
    Ran into a crashing bug that I found a workaround for, and thought it worth sharing in case others encounter the same.

    AVPro Windows Media on Windows 7, building 64-bit .exe on Unity 5.4.0b17, using OpenVR w/HTC Vive.

    Switching to next/previous videos worked great in the editor, but upon running a compiled version while wearing the Vive it resulted in a "nvwgf2umx.dll caused an Access Violation" crash to desktop when playing local files. (There was no crash when playing streaming videos, or with the Vive unplugged.)

    I narrowed the problem down to OpenVideoFromFile(), and after attempting multiple workarounds finally discovered that doing just a " yield return new WaitForEndOfFrame();" just before OpenVideoFromFile() prevents the crash. Fun with threads, kids! (Enjoy debugging THAT one, Andrew!)

    While I'm here, I should mention that doing a SceneManager.LoadScene(0) while a video is playing causes its audio to continue streaming until you close Unity. (Hitting "Stop" isn't enough.) Same thing at runtime; you must close the app to enjoy silence. I noticed my Dispose() method wasn't being called, so not sure what's going on there, but I'm stopping it another way and am done debugging for today.
     
  28. ccklokwerks

    ccklokwerks

    Joined:
    Oct 21, 2014
    Messages:
    37
    Hi,

    I'm testing the 1.3 trial version at the moment. In general, I make the call to load a video in my own scripts. In one usage case I want to load the video and only display the first frame, which I hooked to the FirstFrameReady event.

    This works on other platforms, but on Android specifically, I am not receiving the FirstFrameReady event after ReadyToPlay. Adding a Seek(0) when ReadyToPlay occurs seems to force an update and trigger FFR, but I think this is a small bug.

    Otherwise, the plugin is looking REALLY good.

    Is the ability to alter playback speed scheduled for a future update?
     
  29. L05

    L05

    Joined:
    May 18, 2014
    Messages:
    3
    +1 for being able to push sound from a Media Player instance to an Audio Source so that we can do positional audio.

    We're ready to pull the trigger on buying the whole $450 package as soon as this is implemented!
     
  30. nsc_creative

    nsc_creative

    Joined:
    Nov 3, 2015
    Messages:
    11
    Hi
    I'm also getting a crash when loading a new video in 5.4.0b17, using Oculus although mine happens in the editor as well. Whenever I try and load a video it just crashes. I tried the "yield return new WaitForEndOfFrame();" but it wouldn't allow it in my code as I'm using javascript. If anyone knows the equivalent I'll give that a go.

    Phil
     
  31. ccklokwerks

    ccklokwerks

    Joined:
    Oct 21, 2014
    Messages:
    37
    Ok, this is somewhat weird: if the MediaPlayer and my output texture (currently just a RawImage, on which I set the texture) are located within a Mask, the video doesn't render properly. (This is still with the 1.3 trial.)

    edit: this might not have been a Mask issue. It might just be this intermitted issue I'm seeing where a video fails to play properly in the editor - but it's fine in a build.
     
    Last edited: May 20, 2016
  32. Ivy-SM

    Ivy-SM

    Joined:
    Apr 18, 2013
    Messages:
    10
    Have you looked at this issue? I sent a couple of emails to unitysupport@renderheads.com, but got no answer.
     
  33. ooldsnake

    ooldsnake

    Joined:
    May 6, 2016
    Messages:
    2
    hi all,

    Im trying to play a 360 stream via network (http://IP) on Android/iPhone devices with AVPro VIdeo Free Trial.
    I can see the sphere but no texture on it.....

    It is working when i build for my PC. It is NOT working when i build for Mac (Error:: Failed, not playalable).
    Some videos found in the net are working on devices...
    Is the problem around the codecs or player settings option (i checked the requires internet on Android)?
    Thanks
     
  34. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Messages:
    1,075
    Hi all! We're a bit busy at the moment but we'll reply to your questions ASAP.
    Thanks for your patience.
     
  35. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Messages:
    35
    Hi Andrew,

    Hope you like busy, here's another feature request! ;-)

    The MP4 container allows for multiple audio streams, would be great if we could select the audio stream (programmatically or/and through the IDE).

    360 4K video is so large already, making localized versions of videos where only the Voice Over changes could benefit from this feature.

    Any work around to allow for that now? (Android platform)
     
  36. hirotetsu

    hirotetsu

    Joined:
    Mar 14, 2013
    Messages:
    9
    Hi.
    I try build for Mac App Store version.
    Unity5.3.4f1
    AVProVideo 1.3.0

    Got some error
    Invalid Signature - A sealed resource is missing or invalid. The binary at path [MyApp.app/Contents/Plugins/AVProVideo.bundle/Contents/MacOS/AVProVideo] contains an invalid signature.

    I tried
    /usr/bin/codesign --deep --force --timestamp=none --sign \"3rd Party Mac Developer Application: MyCerts\" --entitlements "/PathToProject/Assets/Editor/entitlements.entitlements" "/PathToApp/MyApp.app/Contents/Plugins/AVProVideo.bundle"

    /PathToApp/MyApp.app/Contents/Plugins/AVProVideo.bundle: unsealed contents present in the bundle root
    /PathToApp/MyApp.app/Contents/Plugins/AVProVideo.bundle/Contents/MacOS/AVProVideo: unsealed contents present in the bundle root

    these 2 errors.

    What should I do?
    Please teach me how to fix these 'Invalid Signature' error.
    thanks.
     
  37. hirotetsu

    hirotetsu

    Joined:
    Mar 14, 2013
    Messages:
    9
    I found countermeasure.
    Delete all *.meta file in AVProVideo.bundle
    then build fine and uploaded.
     
    NathanRH likes this.
  38. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Messages:
    175
  39. hsmayamel

    hsmayamel

    Joined:
    May 25, 2016
    Messages:
    1
    My version —— AVPro Video (Windows)
    My video size----3840 *1080
    Format -----MP4
    HI !dear
    Problem:
    Sound and the picture is not synchronous, the sound is fast, the picture is slow。
    Thank you, very urgently
     
  40. Yakuzi666

    Yakuzi666

    Joined:
    Dec 3, 2015
    Messages:
    1
    Hello !

    Just wanted to ask if somebody could explain to me how I could switch videos randomly with one media player.
    I´m currently not understanding how the scripting reference works.

    In another post I saw that there will be a playlist option soon, do you know when it will be ready?

    Thank you !
     
  41. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Messages:
    175
    I have a pretty serious problem.

    I have a quad that it's playing a video.
    I have a path, and my camera is walking on that path.
    I'm doing a 360 Video Rendering... and the main problem is that while the rendering is a bit slow... the video is being played at the normal speed + I also have some jitters.

    There where others that had this problem and from what i found out AVPro "does not support time scale".

    Any update on this? This is a pretty serious problem for us :(

    Thank You
     
  42. kideternal

    kideternal

    Joined:
    Nov 20, 2014
    Messages:
    58
    I'm not the developers, but perhaps there's a way for you to adjust the framerate of your video source? i.e. if it's a video stream, perhaps you can adjust its playback rate on the fly? (Not an expert here, but all video decoders support playback rate.)
     
  43. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Messages:
    175
    It's not the framerate. Both have been set to 25 like the video source.
    When I render my 360 video the Unity Plugin takes a screenshot for every frame... and ofc this screenshot process is not real time, however the video from AVPro plays at normal speed.
     
  44. headHeartDev

    headHeartDev

    Joined:
    Feb 8, 2016
    Messages:
    3
    I have the same problem I've been trying to work with the 360 video demo just inserting my own video. The video was originally 4k 60fps but here's what I've done to little to no affect. The computer isn't the issue as I am using an i5 4590 processor and a r9 390 gpu
    • Reduced the resolution from 1920x1080 (haven't tried lower but it already is much worse looking)
    • Set the sphere to static in the editor (this is the only one that seemed to have any true effect, a little one at that)
    • Not moving the headset (I thought perhaps my DK2 was reading it incorrectly and giving me the jitters. Turns out that just running it without anything still has framerate dips below 60fps. Which is a killer to VR)
    • Building the project and running the exe (I thought maybe having the editor running might be a bit too much had no effect at all)
    I'm wondering if anyone else has figured out a solution that helps with the framerate. I think I'll try using a sphere with less polygons next, but I have doubts that it'll have a strong effect.
     
  45. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Messages:
    175
    Well one of our programmers made a script that was calculating and setting a timescale for the whole project so the video works fine.

    It's a bit weird because it's working fine on his PC where he has an AMD CPU ... old CPU... 2010 equivalent however that script does not work on my PC, still getting sitters. A bit weird.

    Considering that I'm making a 360 video we are just going to insert the video in After Effects.

    Just to clarify. I'm making a 360 video using this asset. That asset takes a Stereostophic screenshot every frame and then it makes a video out of those frames. When I'm doing this the game moves much slower however my video that I placed on a QUAD using AVPro ... moves at normal speed.
     
  46. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Messages:
    1,075
    Hi All,

    Thanks for your patience. I'm back again and am currently going through all of the emails and forum messages left in my absence. Expect emails and forum responses today and tomorrow.

    Thanks!
     
  47. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Messages:
    1,075
    Hey Tom,

    Great idea!! We will add it to the list. We'll have to look at all of the platforms and see how much we can support this but it's certainly a very useful feature to have. Thanks for the suggestion! Currently we don't have any workaround for this :( We will start looking at Android support for this soon. Cheers,
     
  48. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Messages:
    1,075
    Wow great find! We're not sure why this happens but we'll add it to the documentation FAQ in case other users have the same issue. Cheers,
     
  49. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Messages:
    1,075
    Yes sorry it is a bit confusing. AVPro Windows Media (your second link) is one of our older plugins and AVPro Video is our latest plugin. AVPro Video doesn't include AVPro Windows Media becuase they are two separate products. But AVPro Video does include 90% of the functionality of AVPro Windows Media, so effectively it replaces it. We will be removing the old AVPro Windows Media as soon we we have implemented the last remaining missing features. It's only really the Hap codec support that is still better in AVPro Windows Media but this is something we will resolve very soon.

    I would say that you should use AVPro Video as it is far better in most regards. There are trial versions available for both on the website if you want to test them for yourself.

    I hope that helps.
     
  50. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Messages:
    1,075
    MP4 videos can be encoded in all sorts of ways. You might want to try reencoding it with more keyframes or less reference frames or something to make the decoding player. Alternatively you can launch your app / Unity Editor with the "-force-d3d11-no-singlethreaded" flag which will example GPU decoding on Windows 8 and above. I hope this helps you. If you're still having problems you can email us and send us the video file.