Search Unity

[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:
    2,806
    hmm I'm afraid I'm not familiar enough with PlayMaker to know how to hook up our event system with it... We're hopefully getting some PlayMaker scripts soon from a guru.... We'll be sure to include those as soon as they are available :)

    Your fix might have worked because the S6 has slightly less resouces compared to the S7, so perhaps that is why only one MediaPlayer instance is working - especially if you're using high resolution video. I can't be sure though but that's just my guess...

    Let us know if you have any more findings :)

    Thanks,
     
  2. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370


    Any idea why my video stitches like this? It looks like this if I look up 90 degrees or down.

    Thanks Andrew!
     
  3. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Did you try our included 360 sample video?
    You can also click on "HIGH QUALITY "option on the material if it's using our 360 shader.

    Thanks,
     
  4. dpgdemos

    dpgdemos

    Joined:
    Apr 28, 2014
    Posts:
    24
    Hi there,

    I am having trouble with MediaPlayer Events firing after 2 iterations of a non-looping M3U8 stream.

    I have added a listener to the MediaPlayer Events. After 1 iteration, MediaPlayer Events fire, where I can handle the error codes, then I restart the stream. But, after 2 iterations, MediaPlayer Events quit firing, therefore I cannot handle the error codes and restart my stream.

    Is there something that I am doing wrong or is this an existing problem?

    I am using Unity 5.2.2f1 and AVPro 1.6.0.

    Thanks!

    EDIT:
    I added the following Update method test to my Stream Manager script to see if the stream was recognized as playing. Once the stream ends on the first iteration, "false" is printed. Then I restart the stream; "true" is printed. Once the stream stops playing after the second iteration, it is still recognized as playing; "true" is printed.

    Code (csharp):
    1.  
    2. private void Update()
    3. {
    4.     print(_mediaPlayer.Control.IsPlaying());
    5. }
    6.  
     
    Last edited: Apr 11, 2017
  5. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370
    The High Quality did the trick. Thanks andrew!
     
    AndrewRH likes this.
  6. Intellection

    Intellection

    Joined:
    Mar 25, 2017
    Posts:
    9
    So, guys i have a problem, i need to change playback rate at run-time and the problem is that video stops for some milliseconds when i change playbackrate. Any suggestions? it s very important(( ( please, answer asap

    edited:
    i learned plugin deeper and it seems the reason is limited buffer. am i right? Can we change the fps dynamically ? i think, here we can optimize your plugin
    thanks, still waiting)
     
    Last edited: Apr 12, 2017
  7. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Your video might be encoded with too much complexity to change playback rate quickly. Try adding more key-frames to your video and disabling some compression options(eg B-frames and cabac). As an example try our BigBuckBunny720p video - it was encoded with a key-frame every 2 frames and should be quite fast to scrub through and change rate on.
    Thanks,
     
    Intellection likes this.
  8. manuel_rochon

    manuel_rochon

    Joined:
    Nov 9, 2015
    Posts:
    23
    It didn't seem to change much. I'll try to isolate the problem a bit more when I have some time. But at least the glitches happen less often are are shorter when running a build version.

    thanks!
     
  9. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370
    Well High QUality fixes that problem, but the video now stutters.

    Any other suggestion?


    P.S. DAMN S6 :D Because it works fine on my S7 :(
     
    Last edited: Apr 18, 2017
  10. TechCor

    TechCor

    Joined:
    Apr 3, 2015
    Posts:
    56
    Hi,

    When I change quality settings in-game and change scenes, MediaPlayer starts giving a transparent texture. This problem is clearly visible in the preview, which shows the play time moving correctly.

    Is there some way to restore the MediaPlayer?
     
  11. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes the high quality shader is quite expensive, because it has a lot of per-pixel operations. There might be a way to optimise the shader, or simply improve the sphere mesh that's used instead of using the expensive shader. We'll look into it.
     
  12. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Standard questions:
    1) What is your AVPro Video plugin version?
    2) Which version of Unity are you using?
    3) Which platform are you seeing this on?

    I know we had a bug in an old version of the plugin that made it not support texture quality switching, but that was fixed some time ago. Make sure you're using the latest version of the plugin.

    Thanks,
     
  13. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370
    Any idea what to try out in the meantime? I have no other ideas on what to do. :(
     
  14. TechCor

    TechCor

    Joined:
    Apr 3, 2015
    Posts:
    56
    1) Just downloaded the paid version on the asset store yesterday.
    2) Unity 5.6.0f3
    3) Windows Standalone and Editor

    It's not quite just texture quality switching alone. When the video is active and quality is switched, it works fine. When the video game object is inactive and the quality is changed, activating it results in the blank texture. There's also a scene change before activation, so the exact cause isn't known for certain.

    I'll see if I can make a repro project to single out the cause.
     
  15. TechCor

    TechCor

    Joined:
    Apr 3, 2015
    Posts:
    56
    I've managed to repro this in a test project. It's a surprisingly specific bug.

    1. Begin playing video normally.
    2. Disable the GameObject that has the display uGUI and media player / SetActive(false) and Stop() media player
    3. Set quality setting to "Fastest" (half texture res) from the default "Good" (full texture res)
    4. Set quality setting back to Good (full res)
    5. Reactivate GameObject

    If you skip 2, 3 or 4 it works fine. Only when all 3 are done together does it stop working.

    Attempting to rewind and play does not fix it. However, changing the quality settings again while the video object is active will "fix" the issue.

    I'm guessing that AVPro checks for a change in quality settings in an update or something, and when it doesn't find one due to being disabled, it thinks everything is OK.
     
  16. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Something you could try.
    Download the spheres package here:
    http://catlikecoding.com/unity/tutorials/octahedron-sphere/

    Then use the "Octahedron Sphere 6 R1" sphere. You should then be able to disable the high quality option on the shader and get improved results.

    Let me know if that helps. Thanks,
     
  17. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Thanks for the repro case. Yes it does check for texture quality changes inside the Update loop. This is a very specific bug - I'll have a look at it now and see if we can make a fix. I'll let you know. Thanks,
     
  18. AndrewRH

    AndrewRH

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

    A workaround for now is to go into WindowsMediaPlayer.cs, line 602
    and comment out this one line:

    if(_textureQuality != QualitySettings.masterTextureLimit)

    This will cause the texture to be checked every frame, which can be a performance hit. We'll investigate other ways to do this. I hope that helps fix the issue for you in the meantime.

    Thanks,
     
    Last edited: Apr 19, 2017
  19. TechCor

    TechCor

    Joined:
    Apr 3, 2015
    Posts:
    56
    I poked around WindowsMediaPlayer.cs and that does fix it.

    If you're trying to avoid the native check every frame, one solution would be to call it through MediaPlayer.OnEnable() without the quality check, and leave the update check the way it is now.

    Just a friendly suggestion!
     
    AndrewRH likes this.
  20. luckyrran

    luckyrran

    Joined:
    Mar 29, 2016
    Posts:
    1
    Hello:Now I want to play the FLV format live streaming, but in my version now unable to play, I want to know, which version of AVPro can support live, please let us knowScreenshot below is my current version, the use of the unity of the version number is 5.4.0 F3Because I use the version 5.6.0 IOS can't pack.So please let us know, thank you!Here is my IOS error messages, live streaming connection may change, but also does not support play FLv format video, please inform AvPro which version can solve this problem.Thank you very much!

    2017-04-20 10:59:39.939190+0800 AV[2118:652684] [DYMTLInitPlatform] platform initialization successful

    2017-04-20 10:59:39.980160+0800 AV[2118:652551] -> registered mono modules 0x100cdae10
    -> applicationDidFinishLaunching()
    2017-04-20 10:59:40.065827+0800 AV[2118:652551] Metal GPU Frame Capture Enabled
    2017-04-20 10:59:40.065997+0800 AV[2118:652551] Metal API Validation Enabled
    2017-04-20 10:59:40.091947+0800 AV[2118:652551] libMobileGestalt MobileGestaltSupport.m:153: pid 2118 (AV) does not have sandbox access for frZQaeyWLUvLjeuEK43hmg and IS NOT appropriately entitled
    2017-04-20 10:59:40.091974+0800 AV[2118:652551] libMobileGestalt MobileGestalt.c:550: no access to InverseDeviceID (see <rdar://problem/11744455>)
    -> applicationDidBecomeActive()
    GfxDevice: creating device client; threaded=1
    Init: screen size 2208x1242
    Initializing Metal device caps: Apple A10 GPU
    Initialize engine version: 5.4.0f3 (a6d8d714de6f)
    UnloadTime: 1.066583 ms
    [AVProVideo] Initialising AVPro Video (script v1.5.8 plugin v1.5.8t) on Apple A10 GPU/Metal (MT True)
    RenderHeads.Media.AVProVideo.MediaPlayer:Initialise()
    RenderHeads.Media.AVProVideo.MediaPlayer:Start()


    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

    Event: Closing
    RenderHeads.Media.AVProVideo.Demos.VCR:OnVideoEvent(MediaPlayer, EventType, ErrorCode)
    UnityEngine.Events.InvokableCall`3:Invoke(Object[])
    UnityEngine.Events.InvokableCallList:Invoke(Object[])
    UnityEngine.Events.UnityEvent`3:Invoke(T0, T1, T2)
    RenderHeads.Media.AVProVideo.MediaPlayer:CloseVideo()
    RenderHeads.Media.AVProVideo.MediaPlayer:OpenVideoFromFile()


    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

    [AVProVideo] Opening http://live.vr.v1.cn/vr/vruser8610617.flv (offset 0)
    RenderHeads.Media.AVProVideo.MediaPlayer:OpenVideoFromFile()


    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

    Initialising for graphics device type Metal
    Player 676: failed to load value for key "playable", error: Operation Stopped
    [AVProVideo] Error: LoadFailed
    RenderHeads.Media.AVProVideo.MediaPlayer:UpdateErrors()
    RenderHeads.Media.AVProVideo.MediaPlayer:Update()


    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

    Event: Error
    RenderHeads.Media.AVProVideo.Demos.VCR:OnVideoEvent(MediaPlayer, EventType, ErrorCode)
    UnityEngine.Events.InvokableCall`3:Invoke(Object[])
    UnityEngine.Events.InvokableCallList:Invoke(Object[])
    UnityEngine.Events.UnityEvent`3:Invoke(T0, T1, T2)
    RenderHeads.Media.AVProVideo.MediaPlayer:UpdateErrors()
    RenderHeads.Media.AVProVideo.MediaPlayer:Update()


    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)
     
  21. AndrewRH

    AndrewRH

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

    Firstly version 1.5.8 is very old - I recommend upgrading to the latest version of the plugin (version 1.6.0).

    Next, FLV isn't supported on iOS natively at all. AVPro Video doesn't have native support for FLV on any platforms actually - it's just not that well supported. Currently the only platform we support it on is Windows but only when installing a 3rd party codec handler such as LAV Filters. I would recommend using another stream type that is more widely supported such as HLS.

    I hope this helps you. Let me know if you have any more questions.

    Thanks,
     
  22. vivekAgar

    vivekAgar

    Joined:
    Apr 21, 2017
    Posts:
    1
    HI,

    we are working on a On Ground Augmented reality activation . where camera will be placed on a height of 15.0 feet and User will be standing in front of camera around 25 feet .
    similar to (
    )

    We are using AVpro Live-camera plugin for unity, our camera(canon 700 D) is connected through USB connection.

    I run Background video sample from plugin folder, we re getting certain latency , delay in feed in our Unity scene.

    could you suggest , is our setup is right , could we get a full 30 FPS feed in unity ?

    what could be cause for latency?
     
  23. AndrewRH

    AndrewRH

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

    This is the forum for AVPro Video, a video playback plugin. Is your issue related to video playback? If not, please post to the AVPro Live Camera forum so that we can better understand your issue. Please also include information such as Unity version, AVPro plugin versions.

    Thanks,
     
  24. blevok

    blevok

    Joined:
    Feb 16, 2017
    Posts:
    75
    Well my app is completely finished except for this file opening issue. I don't really want to release without it, but i also don't want to wait too much longer. Do you think the update will be available in the next few days, because i'll wait, but if it's more than that then i think i have to release and add the feature in an update.

    Also, any hints about lowering the resource footprint when applying video to a mesh? I've found that lower-memory devices (1GB) fail to load a streamed video 99% of the time. There's not much in the scene, just a sphere with a jpg texture, a camera and a quad for the video screen, and unity quality settings as well as stream FPS/resolution reduction seems to make no difference.
    I'm not too concerned with the lowest tier of devices, but i was just wondering if there's anything i can do to make it a little more compatible. I'm also hoping it will be a little easier with local videos in device storage as opposed to streams, so if that ends up being the case, then the streaming issue will be less of an issue.

    Thanks
     
  25. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    We're currently working on this (loading directly from the file system for UWP platform). Unfortunately it won't make it into the next release (1.6.2) but hopefully it'll make it into the next one. Maybe release your app unless you can wait another week.

    One way to lower resources is to make sure your videos don't contain too many reference frames. Use 1-2 reference frames only during encoding if your target devices are low on memory. Otherwise 3/4 can be used. You can also optimise Unity, by going into Graphics Settings and removing a bunch of the deferred rendering support etc..

    Thanks,
     
  26. blevok

    blevok

    Joined:
    Feb 16, 2017
    Posts:
    75
    Okay i can wait a week. I'll experiment with your performance suggestions, and that should take a few days since this is just an hour-a-day project for me, and then hopefully i'll just have a few more days to wait after that.
    Thanks
     
  27. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370
    this worked! thanks!
     
  28. AndrewRH

    AndrewRH

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

    AVPro Video version 1.6.2 has just been released!

    ***** NOTE: Windows Users - please we aware that this release has a dependency on the Visual Studio 2015 run-time by mistake. We're working on releasing 1.6.2 ASAP to resolve this issue. You can read more about this at this #post. Thanks, *****


    You can find the updated version on the Asset Store and the free trial version / demos on our website.

    Changes include:

    iOS / tvOS
    • Added support for Y'CbCr Biplanar textures which results in less memory usage. This feature means older devices with only 1GB of RAM (iPhone 5+, iPhone6+) will no longer struggle with memory when playing back 4K video content.

      AVProVideoIOSYUV.png

    • Tweaks which hopefully fix a rare flickering issue for Metal when using multi-threaded rendering
    • Fixed shader compile issue for legacy Unity 4.x
    macOS
    • Fixed bug for high resolution Hap decoding due to apparent bug in Apple OpenGL extension
    • Fixed an issue with transparent ProRes video
    Android
    • Fixed bug that would cause video to not display when using the Mask uGUI component
    • Fixed OES GLSL shader support for Unity 5.5.2
    • Fixed shader compile issue for legacy Unity 4.x
    • Reported bug in Unity 5.6.0f3 support for GLSL (OES) shaders
    Windows
    • Performance improvement for Hap codec when using “chunks” encoding option. Now decoding happens over multiple threads.
    • Added support for the “-force-d3d11-no-singlethreaded” command-line parameter which doesn’t require the use of a new D3D context with a shared texture in the MF-Hardware path
    • Media Foundation code refactored
    General
    • Fixed bugs in NGUI script, previously it could crash when changing videos
    • Fixed very specific bug related changing texture quality settings while the MediaPlayer is disabled which would cause texture to become black. Removed the global setting that disabled the above texture quality fix as it no longer has a performance benefit
    • Improved UI of ApplyToMesh component with custom editor
    • Some shaders now default to black textures instead of white
    • Added basic playback controls to the debug UI
    • Added documentation about AMD hardware decoding (UVD) capabilities
    • Added support for Unity 2017 beta
    Thanks,
     
    Last edited: May 2, 2017
    nmd2 likes this.
  29. chrigit

    chrigit

    Joined:
    Mar 30, 2017
    Posts:
    3
    Hi

    I'm currently working on a Hololens project which needs small, short videos played in some holograms. The movie texture completely destroys the framerate on the Hololens so I am testing AVPlayer Pro. It looks quite promising but I have one "issue" I would like to ask about:
    I have a 320x320 H.264 baseline (level 3) video which I encoded using fast decode settings. In Unity I setup a round disc object on which I configured the player (Media Foundation with HW decode enabled) and Output it to the material. My issue is that when I'm close to the object so that the video fills most of the "screen" of the Hololens the performance goes way down to 30-40fps but when I'm away from the object so that it's only a smaller part of the visual space, the performance reaches about 58 fps. Is there a way to improve the performance of the video when I'm close to it?

    Thank you very much.
     
  30. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,
    The fact that the on-screen size of the video is affecting frame rate indicates that it is a hardware fill-rate issue, and not an issue related to the video decoding and displaying.

    Whatever shader you're using to display the video needs to be made as simple as possible. For example, don't use a transparent shader is possible because this has a much higher fill-rate requirement. Basically the more pixels on screen the textures covers, the more pixels need to run through the shaders pixel shader which is expensive.

    I hope that helps you. Let me know if how it goes.

    Thanks,
     
  31. HarryE22

    HarryE22

    Joined:
    May 20, 2013
    Posts:
    12
    Hi there!

    I'm using AVPro 1.6.0, and I'm having a problem with my framerate. My "Frame Rate" is being read as 24. and yet my "Display Rate" is jumping around all over the place, around, but not close enough to 24. That would be fine, except that it's causing the video to come out of sync with other cues in the scene.

    I need the display rate to be as close to, if not exactly at 24 fps at all times. Is there anything I can do to help with that? Correct file types (have tried both .MP4 and .MOV), Quality settings, etc?

    The video is also being projected onto a mesh via the Apply To Mesh Component. Might that be causing some slowdown? Should I be using Apply To Material instead?

    Thanks :)
     
  32. AndrewRH

    AndrewRH

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

    AplyToMesh is very fast so you're fine there.

    Does your display device (monitor/projector) run at 24fps? That's a strange frame rate for a computer - usually the monitors run at 60, so the ideal video frame rate is a multiple of that, eg 30.

    It sounds like the performance of your video decoding is not good though.

    A few questions:
    1) Which platform and operating system version are you on?
    2) Which version of Unity are you using?
    3) What resolution and format video are you using?
    4) Does it work better if you use one of our sample videos?

    Thanks,
     
  33. HarryE22

    HarryE22

    Joined:
    May 20, 2013
    Posts:
    12
    Hi, Andrew! Thanks for the quick response.

    Sorry, I meant the video file itself runs at 24fps. To answer your questions;
    1) Windows 10.
    2) Unity 5.5.3f1
    3) Resoultion: 1400 x 800. Format: MOV. I've also tried MP4 and that's the same.
    4) No.

    Just to be clear, I'm referring to the "Display Rate" label that appears in the Preview Pane of the AV Pro component, when I say that the Frame Rate is jumping around. Is that normal? It's practically unnoticable to the naked eye, it's just not in-line with the other audio cues.
     
  34. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    During playback the video frame rate should dance around the videos authored frame rate. So if the video was authored at 24fps, then it should display 23.6, then 24.1 then 23.8 etc..

    It sounds strange that your video is achieving a low playback rate.

    What numbers does the frame rate display?
    What GPU do you have?
    In the console it can you paste here what it prints out when you play the video?
    Where are the other audio cues coming from?

    Thanks,
     
  35. chrigit

    chrigit

    Joined:
    Mar 30, 2017
    Posts:
    3
    Thank you very mich for your answer! This helped a lot! Using the Unlit Shader from the HoloToolkit worked perfectly and the performance is ok now.

    Another problem I have: (Edited) I now found that WindowsUWP has it's own settings separate from Windows. But when I enable Use Unity Audio there, then the pitch of the audio is completely wrong and there is some crackling.
     
    Last edited: May 2, 2017
  36. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hmm that's strange. Did you check your audio settings? Perhaps try to change the buffer size?
    Is this only on Hololens or also normal UWP desktop builds? Does it make any difference when running on remote/emulator Holoelens vs the real hardware deployment?

    Thanks,
     
  37. chrigit

    chrigit

    Joined:
    Mar 30, 2017
    Posts:
    3
    So I tried some things like 2D only sound and doppler settings but nothing had any effect. It does not happen when I play it in the editor. Only when I deploy it to a device. I can not try the emulator at the moment.
    Could it be an issue with the audio codec used in the file?
     
  38. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    If it's crackling then it sounds like there isn't enough CPU power to handle the audio processing fast enough...
    Unfortunately we don't have access to a Hololens device for testing. Perhaps you can look in the profiler to see if there is something taking a lot of CPU time - reducing this should help the audio code to run faster.

    Let me know how it goes.

    Thanks,
     
  39. AndrewRH

    AndrewRH

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

    In the latest version (1.6.2) of AVPro Video there is a mistake for Windows users. We added a dependency (OpenMP DLL) by mistake. This means that unless you have the Visual Studio 2015 runtime installed on your PC, the DLL will fail to load.

    We are working on releasing a fix for this ASAP.

    In the meantime if you install the Visual Studio 2015 runtime, it should fix this temporary issue.

    Thanks,
     
    EarMaster likes this.
  40. alternativedev

    alternativedev

    Joined:
    Apr 28, 2017
    Posts:
    3
    Hello,

    I'm trying to play a movie with the AVPro Plugin on four monitors (4 x 1920x1080). The movie plays well but with micro-shuttering!

    The scene is very light, only:
    - 1 Raw Image in a Canvas to display the video + 1 Display UGUI Script
    - 1 Media Player
    - 4 Cameras watching the same Raw Image

    VIDEO CARACTERISTICS:
    Resolution: 1920x1080
    Video framerate: 25 img per second
    Format: mp4
    Codec: H.264
    Duration: max 30 seconds

    How can I play my movie without micro-shuttering? What do I do wrong? Is it possible to have playback as smooth as in a common video player (Windows Media Player, VLC... for example)?

    Thanks,
     
  41. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Posts:
    102
    You can set your exe to use exclusive mode (playersettings D3D.. Fullscreen mode) I found that helps a bit.
    Ideally your video framerate is 30 or 60 fps. (same as your display refreshrate)

     
    AndrewRH likes this.
  42. AndrewRH

    AndrewRH

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

    AVPro Video version 1.6.3 has just been released!

    You can find the updated version on the Asset Store and the free trial version / demos on our website.

    Changes include:

    Windows desktop
    • Fixed mistake from 1.6.2 which included a Visual Studio 2015 dependency (the OpenMP vcomp140.dll)
    • Chunked Hap decoding is now no longer multi-threaded. We will add this optimisation back in 1.6.4
    • Added some notes to documentation about Windows N / KN editions
    Thanks,
     
  43. patrick-emmerich

    patrick-emmerich

    Joined:
    Mar 28, 2016
    Posts:
    6
    Hi,

    I’m experiencing a bug in version 1.6.2 and 1.6.3 where if I reload the scene 10 times, 1 of 10 times the video plays without anything rendering on the material. I'm using Unity 5.5.2

    This happens even when I use the example scene 07_Demo_Mapping3D.

    Is this a known issue and do you have a workaround?
     
  44. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370
    Hey Andrew,

    I finally made almost everything work... do you have any idea if AVPro can play a video that is 4096 by 4096 on an S7?
     
  45. Cambesa

    Cambesa

    Joined:
    Jun 6, 2011
    Posts:
    119
    Hey Andrew, thanks for your plugin, it helps us out a lot!
    Could you or someone else help me out with some problems I'm working on?

    Problem1: I'm currently trying to get the fast OES path to work to delay or even negate crashing after intensive use for a while but when commenting out:
    //Fallback "AVProVideo/Unlit/Opaque (texture+color+fog+stereo support)" from the
    "AVProVideo/Unlit/Opaque (texture+color support) - Android OES ONLY" shader, the results show magenta textures on both the Samsung S5 and S6, also magenta in the editor when ran with -force-opengl, -force-gles, -forcegles30 and also when selecting GLES3.0 or GLES2.0 as graphics emulation in the editor.
    I tried replacing:
    gl_FragColor = texture2D(_MainTex, texVal.xy);
    by:
    gl_FragColor = textureExternal(_MainTex, texVal.xy);
    because the manual states that that should be used here: https://docs.unity3d.com/Manual/SL-GLSLShaderPrograms.html but it doesn't help, the textures stay magenta. I'm commenting out the fallback to make sure I'm looking at the result of the OES path attempt.

    Problem2: (more like a lot of questions instead of a problem because we are still thinking of how to do this) What does AVPro (or the mediaplayers used) do when looping a video? Does it redownload it or does it download it once and loops that download? And is it possible to buffer videos? So when the current video has downloaded to up to 4 seconds in the future, I could start buffering the next video so there's a smaller break between videos? Is there also a way to loop a video seamlessly? There's always a small break between looping, especially notable in the sound of the video, instead of a continuous atmospheric sound loop, there's a small shock when looping. I think the last one is a hard one to solve because I think it's up to the mediaplayers used by AVPro to manage the looping part but perhaps there's a solution.

    Kind regards,

    Yorick
    VR Composers
     
  46. DarkMio

    DarkMio

    Joined:
    Feb 10, 2016
    Posts:
    7
    Hi, we have an issues with true progressive streams:

    When feeding AVPro a MPEG-TS video that continues streaming, then AV Pro usually loads a fixed amount of video and then starts streaming what it loaded. It looks like the socket gets closed and that's it.

    Is there any kind of test-setup? (since your documents give some FFMPEG hints, we would like to try that)
    By now we have two setups where we either utilise FFServer or some self-built service that simply streams video data and keeps sockets open, as well as setting the appropriate header fields.

    In example, here is a FFServer config that we're using for continuously streamed mpeg-ts container:

    HttpPort 3395
    HttpBindAddress 0.0.0.0
    MaxClients 10
    MaxBandwidth 100000
    NoDaemon

    <Feed feed1.ffm>
    File /tmp/feed1.ffm
    FileMaxSize 1G
    </Feed>

    <Stream test.ts>
    Feed feed1.ffm
    Format mpegts
    VideoFrameRate 60
    VideoBitRateRange 80-2500
    VideoBitRate 2500
    VideoQMin 1
    VideoQMax 5
    VideoSize 640x480
    Noaudio
    </Stream>​

    you can replace test.ts with any kind of file-ending, in case if it matters. Settling with HLS is an option - but progressively streamed video would be far better.

    Thanks and kind regards!
     
  47. HarryE22

    HarryE22

    Joined:
    May 20, 2013
    Posts:
    12
    Hi Andrew.

    Sorry for not getting back to you last week. I've been ill since last week, but we have fixed our problem (we added the audio cues to the video, so they sync up now. Probably should have been doing that since the start).

    I have a new problem, though. Is there an Unlit Transparent shader for AVPro? I see there is a transparent shader; "AVProVideo-Unlit-Transparent" and a lit shader, "AVProVideo-Lit-Diffuse", but not one that does both. We are using the videos to render a 2D character onto a mesh (a quad). The transparent shader works fine for this, but there is an instance whereby the material must be lit by real-time lighting. Is it possible for this to happen?

    Thanks
     
  48. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Thanks, we're reproduced this bug - we had to disable vsync and run it outside of the editor. We'll fix this in the next update to the plugin (version 1.6.4). Thanks for reporting this.
     
  49. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I don't think such a high resolution video can be played back. 3840x1920 was the highest we reliably could do in our test....That was 6 months ago though, so maybe with an updated Android OS it might work...test it? But if I had to bet I'd say no it's not going to work.
     
  50. AndrewRH

    AndrewRH

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

    1) Yes Unity's support for GLSL is actually not great :( I've never been able to get a GLSL shader to run in the Editor, thus the fallback. If you want to make sure that the GLSL shader is running and not the fallback, then simply change the gl_FragColor to multiply by vec4(1, 0, 0, 1) to tint it red...

    2) Yes looping is very tricky, and if you're streaming then it's even harder. And yes, we're at the mercy of the underlying mediaplayer API running on the device / OS. For general file playback you can do some tricky like make sure there are many keyframes at the start of the video to allow it to restart without having to decode repentant frames. You can also reduce the encoder complexity by disabling b-frames, cabac, reducing reference frames. You could also do a trick where you make your video a bit longer and actually include a rendering of the seamless loop with the start of the video, then as long as you are buffering X frames ahead, you can quickly rewind your video while displaying the buffered frames. All of these are very fiddly...
    In AVPro Video we don't expose any buffering controls because most of the APIs we use don't expose this level of control themselves. I suspect that on most platforms they only allocate limited memory to streaming downloads, so when you reach the end it will probably have to reconnect and download again, which will of course be slow. One way around this would be to have a second MediaPlayer which starts just before the video is about to end..Then you would just need to cross fade between them at the right time. It'll still be very difficult to get it perfect though. I think ultimately for this level of control you need to be writing a very low-level metiaplayer where you have control over all of the networking and resources. Still tricky..