1. We've introduced thread tags, search within a thread and similar thread search. Read more here.
    Dismiss Notice
  2. Learn how you'll soon be able to publish your games to China in four simple steps with Xiaomi. Sign up now for early access.
    Dismiss Notice
  3. Get further faster with the Unity Plus Accelerator Pack, free for new Unity Plus subscribers for a limited time. Click here for more details.
    Dismiss Notice
  4. We've released our first Timeline Experimental Preview, our new tool for creating cutscenes and more! To check it out click here.
    Dismiss Notice
  5. Unity 5.5 is now released.
    Dismiss Notice
  6. Check out all the fixes for 5.5 in patch releases 1 & 2.
    Dismiss Notice
  7. Unity 5.6 beta is now available for download.
    Dismiss Notice

[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
    Posts:
    1,217
    Version 1.3.0 of AVPro Video has just been released!

    You can grab it now from the Asset Store.

    We have also updated the free trial version, demos and documentation.

    Changes include:

    • Windows XP, Vista and Windows 7 support by adding DirectShow playback path.

    • A new GPU accelerated video player for Windows (8.1 and above, D3D11 only). To use this you need to run editor and your app with the "-no-singlethreaded" command-line argument.

    • Multi-threaded rendering support on Android

    • Hap1 and Hap5 codecs supported in DirectShow playback path (note that this doesn't yet work in Win8 and above but will come in the next release).

    • Quite a few bugs fixed, UI improvements, documentation updates

    For more details see the release notes in the documentation.


    Thanks,
     
  2. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Hi, this is interesting - we haven't seen this before. Please email us the URL to test with so we can debug it. Thanks!
     
  3. nsc_creative

    nsc_creative

    Joined:
    Nov 3, 2015
    Posts:
    12
    Hi

    Thank you for the update. I've updated my AVpro for Windows and I'm now ferociously adding it into Whirligig. I do have a couple of questions. Well at least one.

    You've added directshow support for playback on Windows 7. Does this also translate over to windows 8 and 10 when the a video doesn't play back in Media foundry? For instance webm isn't supported yet.

    Thanks for the update on frame numbers. I'm going to try and convert all the aspects in the player to time stamps if possible.
     
  4. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Hi Philip,

    The DirectShow support currently only kicks in if the running OS is Win7 or earlier. There's no way currently to force DS for all platforms or to allow the Win8+ platforms to fallback to it if they failed to load a video using Media Foundation. This is something we will add in the next release as it is a powerful feature (especially for power users).

    Thanks,
     
  5. nsc_creative

    nsc_creative

    Joined:
    Nov 3, 2015
    Posts:
    12
    Thanks for the quick reply. It's good to hear that that you are going to add it for the next release.

    You mentioned that there is currently no way of forcing all platforms to use use directshow or have a fall back. I'm currently making a player which would massively benefit from being able to as least have a DS forced on all platforms even if there isn't an option for a fallback. What are your timeframes for this feature (a difficult question I know)? I'm happy to try beta versions and early builds as this feature is incredible important for my player. The biggest issues I get reports on are files not playing so having multiple options to be able to give the user helps a lot.
     
  6. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    It'll also be in the next release. I'm happy to send you a beta when one is available. We've only just released v1.3.0 so it won't be right away :)

    Yes we want to fully expose all the different playback paths for Windows and let them be forced, changed etc

    We have massively improved the DirectShow support in AVPro Video compared to our older plugin AVPro Windows Media. For example MP4/MOV container support is now built-in so no 3rd party plugin is needed for this. Also the colour internal conversion support is much better now, and there are some nice performance improvements. Hope you like the new plugin and expect more in the future.

    Cheers,
     
  7. nsc_creative

    nsc_creative

    Joined:
    Nov 3, 2015
    Posts:
    12
    Thanks. It is pretty soon to ask for a beta considering that you've only just released the last version :)

    Really good see the amount of development going into this plugin right now.

    Cheers
     
  8. SamarinZ

    SamarinZ

    Joined:
    Oct 1, 2015
    Posts:
    3
    Good stuff! I was able to get the demo version integrated into my project on Windows 7, but as @nsc_creative mentioned audio isn't output through the Oculus Rift per whatever mechanism Oculus implemented. If you can add a way to allow us to choose the audio device, or just send it out through Unity somehow, you've got yourself a sale!

    I'm eager to release my stuff very soon, so even if the implementation is ugly I'm game. I'm able to help test immediately.

    Stereo/3D playback is also a very nice to have. I wasn't able to see how to do enable it in the demo scripts, but could always create two textures and use offsets...
     
    Last edited: Apr 22, 2016
  9. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Posts:
    36
    Nice release again!

    Could be me, but had an issue with the finished event on iOs. (non looping video)

    Also on iOs (could also have been a problem in the previous version, did not test then) When i have a progressive download stream. (mp4 from Vimeo) 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.

    Could it be it runs out of data and does not resume or something?

    would there be a way for me to show a loading icon when it's buffering? (i only have the first frame ready event where i remove the loading icon) would be cool if there would be a "buffering"|"resuming" event. (workarround maybe?)

    Would love to release the iOs version :) but this is stopping it for the moment.

    (+1 for the ability to send audio through a unity audio source, that way positional sound from a virtual television would also be possible)
     
    Last edited: Apr 22, 2016
  10. jeroenvdv

    jeroenvdv

    Joined:
    Oct 25, 2010
    Posts:
    36
    Great work! Testing the 1.3 version right now.

    Is support for HAP on OSX planned? Doesn't seem to work yet :)
     
  11. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Hey there :)

    Yes it's currently being coded up! The super fast Hap codec support on OS X should be in the next release :)
     
  12. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Thanks Tom, perhaps I need to test the iOS streaming on a slower connection :) We'll take a look! Could you email me your vimeo streaming MP4 link so we can test it?

    If you definitely are having problems with the Finished event please confirm and give details. I'm pretty sure we had fixed it....

    We'll add some feedback for buffering events/queries in the next update.

    Thanks,
     
  13. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Is it not possible in Windows to make the Rift audio device the default one and then it all just works? We are looking at ways to push to the Rift audio device specifically though.

    The Stereo video playback should be very easy to use. IF you look at our sample 360 video scene you can just go to the material on the sphere and set it to top-bottom or left-right stereo configuration. The shader automatically supports stereo rendering when set. It also have a debug option called tinting which will make your sphere appear red/green in the different eye views to show that it's working.

    Thanks,
     
  14. SamarinZ

    SamarinZ

    Joined:
    Oct 1, 2015
    Posts:
    3
    Yes, that works, but asking every user to do so is too much. (Most users will have separate speakers/headphones setup as default, and just want Rift audio to be in the Rift.)

    Thanks for looking into it! Hopefully it's not difficult.

    Thanks for the stereo video tip!
     
  15. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Hey Tom,

    We had a look at the buffering issue on iOS and indeed there is an issue with streaming MP4 files on slow connections. When it reaches the end of the buffer it isn't playable for the rest. We didn't have a problem until we enabled 3G emulation. We will investigate this further and expose more functions to reveal the state of buffering etc in upcoming versions.

    For the VIMEO test URL you supplied we did find that if you replace the ".mp4" part with ".m3u8" then it will use HLS streaming which seems to work fine :)

    Also if the intended end use is a product on the App Store then it would need to be an HLS stream to pass Apple certification.

    Cheers,
     
  16. nsc_creative

    nsc_creative

    Joined:
    Nov 3, 2015
    Posts:
    12
    Hi
    I've integrated the plugin into my project and ran into a difference when testing it on a windows 7 machine and windows 8. I think based on the Direct show and media Foundation. It appears that on the windows 7 machine the video isn't flipped but on the windows 8 machine it is.

    I previously asked you about disabling the forced offset and scale which I've done by commenting out those elements in the apply material script. That part that I commented out, does it apply the flip automatically when using Media Foundation over Direct Show?
     
  17. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Yes different media players present the frames in different vertical orientations which is why we had to add the RequiresVerticalFlip() query function :) I'm sure it wouldn't be too hard for you to use this query too and then flip your Y scale. If the video is getting clamped then you can also change the Wrap mode on the texture.

    We could flip the texture in the plugin so that it's always the right way around, but this would involve a whole extra texture copy and hurt performance. Instead we just flip it the right way during display :)
     
  18. nsc_creative

    nsc_creative

    Joined:
    Nov 3, 2015
    Posts:
    12
    Thanks. I'll have a go at integrating that later and report back on how I get on :)
     
  19. fklingler

    fklingler

    Joined:
    May 29, 2015
    Posts:
    10
    Thanks for this awesome plugin! Finally a working pro solution for video playback on Unity :)

    Is there any way to detect (at runtime) the max texture size supported on a device?
     
  20. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Thanks glad you like it :)

    Yes SystemInfo.maxTextureSize :)
     
  21. nsc_creative

    nsc_creative

    Joined:
    Nov 3, 2015
    Posts:
    12
    Hi

    I worked out a way to do the offset and scale by setting it based on the operating system so if it was windows 7 it would set one and anything else the other. Seemed to make sense as at this point they are divided up that way.

    I have another question. You can currently check the resolution of a video. Is there a way to get the aspect ration of a video? Some videos uses a different pixel size so the resolution doesn't always return the right size.

    Cheers

    Phil
     
  22. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Hi Phil,

    I wouldn't base the vertical flip on the operating system as different videos can be flipped differently depending on their pixel format regardless of OS. There are also different video renderers (and more coming) so it's best just to check that boolean whether to flip vertically or not.

    Could you email us a video that is behaving badly re pixel size so we can test it and provide a solution?

    Thanks!
     
  23. phileday

    phileday

    Joined:
    Feb 8, 2014
    Posts:
    55
    phileday (also nsccreative)

    Regarding the flip, I'll do that in the next build thanks.

    Regarding the pixel size. I've had this reported by others and I know how I can recreate it so I'll make a video and email you.

    Thanks for the support.

    Phil
     
  24. grigb

    grigb

    Joined:
    Oct 30, 2015
    Posts:
    4
    Took it for a test spin... I love it!
     
  25. fklingler

    fklingler

    Joined:
    May 29, 2015
    Posts:
    10
    Thanks for the answer concerning the max texture size, that's very helpful.

    I have another question about the iOS version of the player. The `RequiresVerticalFlip()` method returns false in every case, but on the iPhone 5S I used to test, the video required a flip since it was upside down.
    Will this be implemented in a future version? I don't have another iOS device to test on and I'm afraid it will change depending on the device. What do you suggest me to do?

    Thanks,

    François
     
  26. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Hi François,
    Thanks for reporting this. We haven't heard of this behaviour before. So was it just a specific video that was flipped or any video on the iPhone5S?
    Thanks,
     
  27. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Windows Phone, Windows Store and Universal Windows Platform (UWP) annoncement:

    AVPro Video will soon be supporting the above deployment platforms in Unity. We've successfully tested them with x86, x86_64 and ARM builds and so far-so good! This means in either the next update (v1.4.0) or the one after (v1.5.0) the plugin will have support for these platforms.

    In other news we're working hard to fix some issues and suggestions we've had feedback on, as well as adding new features are releasing v1.4.0 :)

    Please continue to send us any bugs/issues you have so we can address them.

    Thanks,
     
  28. redeyenight

    redeyenight

    Joined:
    Sep 4, 2014
    Posts:
    3
    I have installed the demo and got it all working. I upgraded the demo to paid version. I have tried everything to remove the watermark but it still shows. I even restarted my machine started a new project downloaded the package again from the asset store and tried it on a cube but it still has the watermark. How do I remove this? I'm in a little bit of a hurry so some help with this would be great! Thanks

    Android
    bought this: https://www.assetstore.unity3d.com/en/#!/content/52745
     
  29. fklingler

    fklingler

    Joined:
    May 29, 2015
    Posts:
    10
    I tested on a few videos and all of them were flipped.
     
  30. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Are you seeing the watermark on your actual Android builds? If you bought the Android version then the watermark will still show in the editor as this is Windows/OS X platform but if you make a build and run it on Android then it shouldn't have a watermark. Thanks,
     
  31. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Thanks, we haven't seen this with our other iOS devices. We'll do some tests here.
     
  32. fklingler

    fklingler

    Joined:
    May 29, 2015
    Posts:
    10
    I tested on an iPad Mini and I have the same problem. I just sent you in private the file I use to test, if it can be useful.
     
    Last edited: May 2, 2016
  33. asosto

    asosto

    Joined:
    Apr 11, 2016
    Posts:
    1
    HI, I TRY TO REPRODUCE VIDEO FROM YOUTUBE URL BUT NOT RUN. THIS PLUGIN SUPPORT YOU TUBE?
    THANKS!
     
  34. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    No the plugin can't be given YouTube webpage URLs unless you can give it the URL of the MP4 that YouTubeuses. There is another plugin on the asset store that can extract the MP4 URLs from a YouTubevideo. These could then be used in AVPro Video :)
    Thanks,
     
  35. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Posts:
    36
    Quick question, is there a way to "pauze" the updating of a DisplayUGUI when a new movie is loaded in the connected Mediaplayer? Now there is a flash when the movie is loaded, I want to "pauze" the last frame of the previous movie while the new one is loading and then only start updating again when the first frame is loaded on the new one.

    [Edit: Worked around it for now by switching 2 GUI/mediaplayers and waiting for firstFrameReady before showing/hiding the player]
     
    Last edited: May 3, 2016
  36. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Hi Tom,

    Glad you found a workaround - that was actually what I was going to suggest :) We have some proper seamless 'playlist' components in the work which should be in a version soon. Thanks,
     
  37. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Posts:
    36
    Sounds good!

    Found a discrepancy between the iOs/OSx version and the pc/android version.

    When you do a OpenVideoFromFile(..., ...)
    and directly below that line you do a Control.Play();
    On a MediaPlayer that has both Startup Auto Open and Auto Start unchecked (false).

    Then the video plays in both android and pc, but does not start playing on iOs/OSx

    [Work around: don't use Control.Play() but set the auto open and auto start to true.]
     
  38. Clodo

    Clodo

    Joined:
    Dec 27, 2013
    Posts:
    40
    It will be possible to have X texture as output, each a region of the video file?

    In VR, if i have a 3D Side-by-side video in 4096 x 2048 resolution,
    i can use this asset to show the same texture in each eye with different scale/offset.

    But if i have a 3D Side-by-side video in 6192 x 3096 resolution,
    can't work it because the texture will exceed the 4096 x 4096 resolution.
    The idea is allow this asset to output one texture for the <0,0,3096,3096> rect and another for the <3096,0,6129,3096> rect.

    Another example, ORBX/OctaneRender use a image format 18432x1536 (12 square image aligned horizontally for obtain a Stereo Cubemap). The upcoming "Batman: The Animated Series" are rendered in this format.
    I can playback it with this asset only with 12 separate textures.

    Thanks.
     
  39. Clodo

    Clodo

    Joined:
    Dec 27, 2013
    Posts:
    40
    Or, at least, the possibility to open X time the same video file, with a custom source rect for the current unique texture output, and something that ensure the sync between asset instances.
     
  40. MarkHC

    MarkHC

    Joined:
    May 5, 2016
    Posts:
    1
    Hi there, I'm hoping to use AVPro Video to play 360 videos mapped to as sphere. I'm giving the demo package a try, I've opened the 360SphereVideo scene and have successfully played some of my 360 videos but only at 1920 x 1080. Whenever I go higher, 2880 x 1440, 3840 x 2160 or 4096 x 2048 I just get a white screen. When debug GUI is turned on it tells me that the video is 720 x 480 when it is in fact much larger.

    Am I missing something, as I understand it 4k video should play, even if it plays slowly.

    Windows 7, Dual Xeon 3.4Ghz, Quadro 4200.
     
  41. paulo.zaffari

    paulo.zaffari

    Joined:
    Jul 9, 2013
    Posts:
    3
    Hi,

    When switching to fullscreen using the plugin I have a crash.
    It says it couldn't change the video resolution.
    It seems similar to a problem I've seen on the past where a native plugin didn't release all of its textures (in the D3D default ppol) before device is lost/destroyed/recreated.
    This happened while using Unit 4.6.8.f1.
    Is this a known problem? If so, is there a workaround or solution?

    Thanks,
    Paulo Zaffari.
     
  42. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Thanks for reporting this issue Tom. We'll add it to the list :)
     
  43. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Hi Clodo,

    We don't currently support outputting multiple textures. Those sound like pretty MASSIVE videos....Perhaps you could just use a format that supports such large frame buffers? Something like XVid or Hap perhaps. We plan to add stereo cubemap support soon but it will all be a single texture stream.

    Our plugin currently has examples for how to use it with stereo content. It has a built-in material that lets you specify left/right or top/bottom oritentation and handles all of the texture scale/offset itself. This could easily be extended to handle "cubemap" support.

    Thanks for explaining your use case, I hope we can support i better in the next version. Feel free to try the trial version which is downloable from our web site. You may find that it already has enough support to do what you're trying to do with a few tweaks.

    Cheers,
     
  44. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Hi Clodo,

    Also the 4096x4096 resolution limit you're talking about. This is probably just a limitation of the Windows H.264 decoder (and most GPU Decoders). If you used another format (Hap or XVid) you'll almost definitely be able to achieve higher resolution. Also if you install a 3rd party h.264 codec such as from the LAV Filter pack then you will be able to get higher resolution, but probably only with CPU decoding so you'll need a very fast CPU.

    Cheers,
     
  45. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Hi Paulo,

    This is the first time we've heard of this issue. I was quite sure we were handling all of the device lost scenarios really well, but obviously not :) Which GPU API is your project using: D3D9 or D3D11? How can I replicate this, is it just alt-enter in a standalone build that does it or what exactly?

    Thanks, I hope we can fix this quickly for you.
     
  46. Clodo

    Clodo

    Joined:
    Dec 27, 2013
    Posts:
    40
    You cannot obtain a pratical results without multiple texture, imho.

    Otoy/Octane cubemap stereo format is 18432x1536 (twelve 1536x1536 aligned horizontally), to load it in a single texture and play with texture scale/offset to apply to a cube, it's actually required to reduce the quality by 4.5 (18432/4.5 = 4096) to allow loading the image in a single texture.

    I already do experiments with texture scale/offset, it's ok until the entire stream can fix the texture size limit 4096x4096.

    From what i understand, largest size for a Texture 2D is 4096x4096. Some GPU can work with 8192x8192, but at this point probably Unity restrict to 4096x4096 for compatibility.

    I already developed a Cubemap IMAGE viewer that support high resolutions, but i load the image with System.Drawing, extract region in each Image and convert to texture, obtaining X textures.
    Like this: http://www.41post.com/4416/programming/unity3d-using-textures-larger-than-4096x4096.

    I will try in a few days to render 8192x8192 video files to understand if is a MediaFoundation limit.
    If is a MediaFoundation limit there isn't nothing you can do, otherwise will be a fantastic (unique!) feature of your asset allow multiple texture output based on regions.
     
  47. kideternal

    kideternal

    Joined:
    Nov 20, 2014
    Posts:
    58
    I noticed others having "flipping" issues and thought I'd mention that I just noticed, on my Windows 7 machine, that a video needs to play for ~100ms before RequiresVerticalFlip() returns the correct value.

    If you read the value after just OpenVideoFromFile(), it'll only be correct 50% of the time. ;)

    But, if you wait a few frames before calling RequiresVerticalFlip() all is well.

    (This hasn't been thoroughly tested.)
     
  48. paulo.zaffari

    paulo.zaffari

    Joined:
    Jul 9, 2013
    Posts:
    3
    1 - We are Using D3D9.
    2 - Alt + Enter in the standalone caused it.

    Another relevant detail: we have our own render plugin running as well. (we disabled it entirely for the test, though: no DX calls in our own plugin)
     
  49. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Hi Clodo,

    Our plugin isn't limited by Unity's texture size as we're creating all the textures ourselves natively. Most cards support 16K texture sizes so in general we're mostly limited by what the decoder is capable of outputing. Codecs such as Hap support really massive resolutions. GPU hardware decoders (eg h.264) are often limited to 2K/4K and a maximum of 2 instances so they generally aren't useful for massive resolution decoding unless you get some serious hardware I guess. Thanks for bringing these massive resolutions to our attention. We're definitely aiming to improve support for them in the future.

    Cheers,
     
  50. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    1,217
    Thanks! We will take a look at this and get back to you.