Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    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:
    2,611
    That's VERY strange...Haven't seen that before :)

    Try see if using the ApplyToMesh script behaves correctly instead?

    Or perhaps your material has a negative scaling in the Y channel?

    Do they appear flipped when you use our sample scenes?

    Thanks,
     
  2. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Has anyone here tried AVPro Video with Magic Leap? I'm just wondering it it works....
    The Magic Leap OS is called "Lumin" and is based on Android, but I don't know if our Android plugin is compatible...
    Anyone here have test hardware and has tried it?
     
  3. HeavyProduction

    HeavyProduction

    Joined:
    Aug 12, 2016
    Posts:
    26
    Yeah, not seen this before (well, only on older video plugins from the store, not with yours). I have not tried the sample scenes, I will do that today. I have tried this in a new empty scene with both ApplyToMaterial and ApplyToMesh (Unity 2018.1). Both are flipped.
     
  4. HeavyProduction

    HeavyProduction

    Joined:
    Aug 12, 2016
    Posts:
    26
    I wish I could get access to the hardware...
     
  5. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Thanks for reporting this. This should be fixed in 1.8.6 which will be released soon.

    Thanks,
     
  6. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    From the MediaPlayer component you can query the TextureProducer interface and get the exact frame time. If you need to work out the frame, just divide this by the video frame rather, or use one of the conversion functions we have int he Helper static class. You may want to add a delay so wait for a frame to change so and then seek using your overlay video and again wait for that frame to be available. I think it's quite a tricky use-case.

    The frame update happens via the Update() function in the MediaPlayer monobehaviour. That uses GL.IssuePluginEvent to do any texture updates on the render thread.

    Thanks,
     
  7. StevenB2

    StevenB2

    Joined:
    Mar 17, 2014
    Posts:
    2
    Hello, I'm having a pretty specific problem regarding streaming videos and audio sync. in 1.7.0, I'm able to stream videos, but when I scrub through them I sometimes lose audio sync by a frame or two. When I upgraded to v1.8.5, The sync issue was fixed, but in this case I'm using the audio output script to send the audio from videos in a specific place on screen to specific speakers in a 5.1 set up. This worked fine with v1.7.0 but doesn't seem to work at all in v1.8.5. I've made not changes to the code or the videos being streamed, it seems to be an issue with the audio output manager not sending the audio to the specific channels. Any ideas on how I could possibly fix this? Any help would be much appreciated.
     
  8. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Thanks for reporting this. There were some changes done between 1.7.0 and 1.8.5 to the audio component. Perhaps you could send us a screenshot of how your AudioOutput component is set up for outputing to different speakers? It's probably best to continue this via email, so please visit www.renderheads.com/contact and email the support link.
     
  9. ZealUnity

    ZealUnity

    Joined:
    Apr 13, 2014
    Posts:
    56
    We definitely need the ability to loop a video without any stutter... So what exactly does AVPro do when the buffer reaches the end of a video? Does it just go idle?

    Wouldn't it be possible to have the buffer begin rendering again from the start of the video? Seems like it would require only a minor amount of code.

    Just using two player sounds like it won't work on most memory limited platforms.
     
  10. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Yes, there is an option to loop the videos, but usually the loop won't be 100% perfect, more like 95-99%. It also depend son how you encode your video. If you are careful then you can it to be close to perfect. This includes makes things as simple as possible for the decoder - so not using any B or P frames in the encoding is ideal for perfect looping.

    I hope that helps.
     
  11. ZealUnity

    ZealUnity

    Joined:
    Apr 13, 2014
    Posts:
    56
    But once the last frame of a video is decoded, instead of going idle, couldn't you just start decoding again from the beginning? Wouldn't that be 100% perfect?
     
  12. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Yes, and that's what we are doing. But we don't have 100% control over the APIs that we're using and they introduce some delays. If you try our sample scenes in Unity, most of them are set to loop and you can't really see any delay/glitch.

    Thanks,
     
  13. AndrewRH

    AndrewRH

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

    AVPro Video version 1.8.6 has just been released!

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

    Changes include:

    macOS, iOS, tvOS
    • Fixed issue where playback wouldn't resume after setting playback rate to zero
    • Fixed crash issue when playing back HLS streams on iOS/tvOS versions older than 10.0
    • Fixed issue playing some unescaped URLs
    Android
    • Added option to force a streaming format using Exoplayer regardless of the file extension
    • Added option to prefer software decoders using ExoPlayer
    • Fixed bug where video wasn't pausing correctly when seeking and the app is suspended
    Windows
    • Fixed rare runtime error when audio is disabled in Unity
    General
    • Fixed stretching issue in 180 degree video display and added a new mapping layout field in the Visual section for specifying that the video is using equirectangular 180 degree layout
    • Fixed null reference exception in ApplyToMaterial script when no material is assigned
    • Added buffered progress rendering to the 03_Demo_VideoControls sample scene timeline
    • Moved the MediaPlayer debug display option into a separate component called DebugOverlay
    • Added new option to UpdateStereoMaterial component so allow stereo rendering to force just the left or right eye
    • PlayMaker actions now have a logo in the header
    • Shaders updated to use a common function for vertex transform
    Please report any issues here on the forum, or to our customer support email.

    Thanks,
     
  14. risto_aa

    risto_aa

    Joined:
    Apr 3, 2018
    Posts:
    12
    Great!! :D
     
  15. tokufxug

    tokufxug

    Joined:
    Nov 26, 2016
    Posts:
    2
    Although I have not tried it, since the preprocessor is PLATFORM_LUMIN, I think that it is necessary to replace all dependent processing.

    Magic Leap comes standard with Media Player API.
    Media Player supports streaming via HTTP (including HTTP Live Streaming) and RTSP. Adaptive streaming protocols, such as MPEG-DASH or Smooth Streaming, are not supported at this time.
    Please check the details below.(Whether to provide the Unity API or not is unknown.)

    https://creator.magicleap.com/learn/guides/multimedia

    Sadao Tokuyama
    https://twitter.com/tokufxug
     
    AndrewRH likes this.
  16. risto_aa

    risto_aa

    Joined:
    Apr 3, 2018
    Posts:
    12
    Issue 1. I purchased an android version, started fresh Unity project, downloaded the plugin from the asset store directly from Unity, then from the videoplayer I have Android selected, but there's still watermark.

    Issue 2. 180 stretching is fixed now, great, fantastic, but the videoscreen is still mirrored to the back with a seam between the two screens, so if you turn your head around in VR, the video plays in the behind too..
     
  17. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    1) There will still be a watermark in the Unity editor, because that platform is not Android, it is Windows, macOS or Linux. The watermark is only removed builds that you deploy to Android devices.

    2) Did you try the 180 degree demo scene? In that demo you shouldn't have the mirrored video, because it uses a transparent shader and has a parameter that does edge fading. Please check it out if you haven't :)

    I hope this helps you.

    Thanks,
     
  18. risto_aa

    risto_aa

    Joined:
    Apr 3, 2018
    Posts:
    12
    1) makes sense

    2) Yes, I opened the demo scene, changed the video to my own, hit play. It's mirrored.. :/

    Edit.

    If this helps..

    It doesn't render both eyes to the mirrored screen. If I turn my head left, it renders right eye to the mirrored screen, if I turn my head to the right, it renders left eye.
     
    Last edited: May 15, 2018
  19. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Ahh I see what you mean! If you use the left-right stereo then the video appears behind...Sorry about this. We will look into this ASAP and post the fix.
     
    risto_aa likes this.
  20. hhjjj

    hhjjj

    Joined:
    Mar 23, 2013
    Posts:
    4
    Using AVpro Video

    Issue: Tinted Color on Mac for Hap, Hap Q codec.

    - Project file made in Win 10 64 bit unity 2017 LTS version: Hap, Hap Q playback with original color-> OK
    - Copied the project file to Mac High Sierra with same unity version: Hap, Hap Q playback ok but with tinted color -> NOT OK ( Same Hap codec file played with original color in VDMX but the color tinted inside the Unity with AVpro Video)

    Can you guess what the problem might be?
     
  21. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Thanks for reporting this. Which version of AVPro Video are you using?
    Also, could you post an image of what you're seeing and how it should look? Is it just a darkening? (In which case it could be related to the Gamma ColorSpace setting in Player Settings). Also if you send us a copy of the video we can better diagnose the issue. Also, you could change the Graphics API (in Player Settings) from Metal to OpenGL to see if that makes any difference?

    Thanks,
     
  22. hhjjj

    hhjjj

    Joined:
    Mar 23, 2013
    Posts:
    4
    This is a commercial project so i might not be able to send you the video now.
    It's not darkening it just the Mint Color changed to Sky Blue Color.

    Here are some more infos:
    - Hap codec compressed with Compressor App (after installing hap codecs. I've done this for many times before)
    - All the Hap codec videos show original color with VDMX app.
    - Tried 1.8.5 / 1.8.6 AVpro video versions
    - Tried changing OpenGl / Metal priority
    - Tried Gamma/Linear color space
    - It's not just one video but all the videos with mint color (maybe more colors changed but this is the most noticeable ones)
    - Same symptoms for Display UGUI and Apply to Material Scripts
     
    Last edited: May 15, 2018
  23. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Thanks for all the details. I'm still not sure what could be causing that. It's very interesting that it displays correctly in VDMX. If you could even create a video with a single frame (so as not to worry about the commerical aspects of your project) that we could test with - that would help a lot.

    Thanks,
     
  24. hhjjj

    hhjjj

    Joined:
    Mar 23, 2013
    Posts:
    4
    thank you so much for your care.
    I just sent the hap q codec video file link to unitysupport@renderheads.com

    thank you!
     
    AndrewRH likes this.
  25. AndrewRH

    AndrewRH

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

    AVPro Video version 1.8.7 has just been released!

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

    Changes include:

    macOS
    • Fixed a bug in the HapQ colour conversion
    WebGL
    • Fixed compile issue in Unity 2017.4.1 by removing unused method and variable
    Windows
    • Fixed a bug where FinishedPlaying event wouldn’t get retriggered after the first time when playing a WAV or MP3 audio file
    • Now when emulating mobile builds in the editor, texture size limitations are ignored to allow videos to play locally
    General
    • Fixed a bug with the 180 video shader where left-right stereo packed videos appear behind the viewer
    • Fixed the SSL certificate validation code in HLSStream so it doesn’t ignore bad certificates
    Please report any issues here on the forum, or to our customer support email.

    Thanks,
     
  26. hhjjj

    hhjjj

    Joined:
    Mar 23, 2013
    Posts:
    4
    Solved. Thank you!!!
     
  27. risto_aa

    risto_aa

    Joined:
    Apr 3, 2018
    Posts:
    12
    Still mirrored. :/
    I am using the latest Unity 2018.1.0f2
     
  28. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    That's strange...It really should be fixed now :) Using the latest 1.8.7 of the plugin? Using the transparent insidepshere shader?

    Thanks,
     
  29. risto_aa

    risto_aa

    Joined:
    Apr 3, 2018
    Posts:
    12
    Just did a fresh plugin install from Unity's appstore on fresh project. Still mirrored.
    Here's the console info:


    [AVProVideo] Initialising AVPro Video (script v1.8.6 plugin v1.8.2t)..

    UnityEngine.Debug:Log(Object)
    RenderHeads.Media.AVProVideo.Helper:LogInfo(String, Object) (at Assets/AVProVideo/Scripts/Internal/Interfaces.cs:534)
    RenderHeads.Media.AVProVideo.MediaPlayer:Initialise() (at Assets/AVProVideo/Scripts/Components/MediaPlayer.cs:434)
    RenderHeads.Media.AVProVideo.MediaPlayer:Start() (at Assets/AVProVideo/Scripts/Components/MediaPlayer.cs:466)


    Seems that it doesn't download the correct version from the appstore or it loads it from some cache or something..?
     
  30. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Yes, I've seen Unity do this before where it gets it from the Cache..
    You can clear the cache by finding the file and deleting it from here:
    C:\Users\YOURUSERNAME\AppData\Roaming\Unity\Asset Store

    Hope that helps,
     
  31. risto_aa

    risto_aa

    Joined:
    Apr 3, 2018
    Posts:
    12
    YES. It worked. :)

    Thanks you very much. Now the video plays smoothly, without mirroring and as it's supposed to.
     
  32. Flimgoblin

    Flimgoblin

    Joined:
    Nov 25, 2009
    Posts:
    81
    Hi,

    Having trouble getting the WebGL to work with mpeg-dash - I've taken the 03_Demo_VideoControls scene (using the trial atm) and changed it to load URLs (using the dash examples from the docs)
    Works fine in editor (and a standalone windows build) but the WebGL build gives errors (Firefox 60.0.1 64-bit on Windows 10)

    HTTP "Content-Type" of "application/dash+xml" is not supported. Load of media resource http://www.bok.net/dash/tears_of_steel/cleartext/stream.mpd failed.

    Any suggestions as to what I'm doing wrong here?

    (edit to add: am using a plugin to allow CORS, so don't think it's that)

    Thanks
     
    Last edited: May 17, 2018
  33. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Hi Flimgoblin,

    Thanks for getting in touch. So we rely on the native capabilities of the browser. I believe Microsoft Edge has support for HLS and MPEG-DASH, but most other browsers do not. They rely on users using JS libraries such as Dash.JS or HLS.JS or Video.JS. We do not leverage any of these libraries, so only formats that the browser supports work correctly. Hopefully one day we'll get the time to look into integrating these javascript libraries, but in the meantime this is certainly something that could be done to extend support.

    I hope that makes sense. If you have any thoughts we'd love to hear them.

    Thanks,
     
  34. Flimgoblin

    Flimgoblin

    Joined:
    Nov 25, 2009
    Posts:
    81

    Aha ok that does make sense - I guess I'll be looking into whether I can somehow get the output build to behave with dash.js in the meantime!
     
  35. AndrewRH

    AndrewRH

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

    We did some experimenting and it actually turned out to be very simple to integrate dash.js:

    1) Open AVProVideo.jslib
    2) Go to the function AVPPlayerInsertVideoElement
    3) after var vid = document.createElement("video"); insert this code:
    var player = dashjs.MediaPlayer().create();
    player.initialize(vid, path, true);
    4) download the latest stable dash.all.min.js and copy it into the Plugins/WebGL/ folder
    5) rename dash.all.min.js to dash.all.min.jspre
    6) Make a build and test it (I've had trouble with Development builds, so try a full build)

    This will of course now ONLY load using dash.js, so it will be expecting a MPEG-DASH manifest URL.

    We will see about integrating this properly so that this can be an option.

    Thanks,
     
  36. Flimgoblin

    Flimgoblin

    Joined:
    Nov 25, 2009
    Posts:
    81
    Fantastic, thanks - I'd just got it working similarly this morning after some research (had the dash library included in the html, not ideal) - that solution's much superior. Thanks again.
     
  37. jh2

    jh2

    Joined:
    Feb 21, 2018
    Posts:
    12
    I'm taking an udacity course. My project is to make a VR app where you wander around a museum. In this museum I show little videos at various stations. My museum is basically one big room with 7 stations so all 7 video players are in one room, sort of next to each other in a semi-circle. If I deploy the app with only one video player everything is fine. I experience excellent performance. If I use all 7 video players corresponding to each video station at once the performance is terrible. I have narrowed down the problem to some aspect of the video player. Note: the video players are not set to auto play. Also, I am using the VideoTrigger script found in the demonstration folders of the plug-in and the VideoTrigger script opens and then plays each video at each corresponding video player. I have also tried writing some custom to code in an attempt to start the app with all the video players not activated, and then the each VideoPlayer is activated once the user reaches each respective station, and deactivate once the user leaves the station, but this results in an unacceptable lag/hiccup when the video player is activated at any particular station. I don't really know what to do. I have tried a million different things like combining the meshes in my scene, collusion culling, etc. to try and improve performance. Any ideas short of eliminating all but one or two video players?
     
  38. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Which platform is this on?
    What format are your videos in?
    In your project, could you possibly join all the videos together into a single video, and then use seeking to play each specific part of the video?

    Thanks,
     
  39. jh2

    jh2

    Joined:
    Feb 21, 2018
    Posts:
    12
    Thank you. The videos are in MP4. The platform is Google Cardboard on a Google Pixel phone. I am using Unity version 2017.2.0f3. I can get about 2 or 3 separate Video Player game objects displaying on separate panels (plane meshes), but anything more than that and I run into some severe performance issues.

    I can certainly combine all the videos into a single video. I am unfamiliar with the seeking function to play each part of the video, but I am willing to learn, but I am worried about your suggestion. The design issue I face is that I want the user to be able to walk around in the virtual environment and visit each station similar to an experience they would go through in a real museum. Can I still present different sections of the video at each separate station in the museum (plane mesh)?

    While using the strategy where all 7 media players are active when the app first starts: I've also tried just presenting the stations in a way that only puts a few of them within the Camera's field of vision to better use Unity's automatic Frustum Culling as I noticed if I look in the opposite direction from where my video panels are located my performance issues completely disappear, but when I tried this it didn't improve much. I also tried using Occlusion Culling, but for whatever reason, I could not get that to work even if I hid the panels in separate rooms. Thank you for your time. This plug-in is much better than Unity's built-in plugin.

    --

    Edit: After a lot of testing I appear to get the best results if I employ a strategy of activating and deactivating each respective video player as I get to each station. As I said before this results in a little hiccup every time a media player is activated. I notice from my profiler a huge spike in the CPU graph every time the script for the media player activates. I wonder, is there a way to emphasize everything else but the loading of the media player? It's not important the media player is activated immediately, It's more important that I have good performance and high FPS throughout. I tried using something like this "Application.backgroundLoadingPriority = ThreadPriority.Low;" in various parts of the script for the trigger and the media player, but it doesn't really do anything.

    Also, what about Android OES playback path? Should I use that? The documentation about this looks promising but I cannot get supplied shader that is supposed to be used with OES it to work. All I get is a dark screen/plane. If I use the OES playback path enabled and use a non-OES shader it appears to work with no discernable difference in performance, but I don't know if I am using OES properly in that case.
     
    Last edited: May 22, 2018
  40. HosamLiveLike

    HosamLiveLike

    Joined:
    Oct 25, 2016
    Posts:
    1
    Currently having an issue with AVPro in the Editor (On Windows).
    Playing HLS videos works fine as long as the link points directly to the .m3u8 file. However if it's behind a CDN, it can't handle redirecting me to the video and throws the error:
    [AVProVideo] Error: Loading failed.  File not found, codec not supported, video resolution too high or insufficient system resources.
    .
    This works fine on Android, iOS and macOS, but not on Windows.

    Any idea what the issue might be and how can we fix it? Thanks!
     
  41. AndrewRH

    AndrewRH

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

    I guess a workaround would be to use a standard .NET WebClient or Unity WWW class to access the URL, wait for it to resolve and then use the resolved URL in the MediaPlayer? There is an approach documentated here:
    https://stackoverflow.com/questions/8072052/resolve-url-redirect

    Could you perhaps email us (www.renderheads.com/contact/) a test URL so that we can investigate fixing this on Windows?

    Thanks,
     
  42. AndrewRH

    AndrewRH

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

    In general I would recommend that you have only a single MediaPlayer component in your scene, and simply load the new video content when needed. You can use the ApplyToMesh script to apply the video to the right geometry.

    Yes, using multiple video players on a mobile platform isn't something we recommend, mostly due to their memory and hardware video decoding limitations. In the MediaPlayer > Platform Specific > Android section you can change the video api to "ExoPlayer". This may give you a smoother loading experience with less hickups.

    OES playback pack can also be used, and uses less memory, faster playback and less setup. With this option enabled you do need to have a OES material in your scene to display the video. Create a material and then change the Shader to one of the AVProVideo OES/Android only shaders. This feature only works correctly in the FULL Android version of the plugin - not the trial version.

    If possible using a single video would give you the best results I think. You can seek to the part of the video where the sub-video starts using something like:

    MediaPlayer mp;
    mp.Control.Seek(_startTimeInMilliseconds);

    Then then you can detect when you're finished that sub-video via:

    if (mp.Control.GetCurrentTimeMs() >= _endTimeInMilliseconds)
    {
    mp.Pause();
    }

    Thanks,
     
  43. jh2

    jh2

    Joined:
    Feb 21, 2018
    Posts:
    12
    Thanks. This strategy of using only one media player appears to be working just fine. I just activate and inactivate various meshes throughout the museum where each portion of the video is played on. Works like a charm. Performance is great. Although the way I have my triggers set up is a little hacky, and sometimes the video in one station/segment pauses AFTER the video in the next station/segment plays and this appears to break everything. I am using the trigger scriptlet. This will be a good opportunity for me to figure out how coroutines work (which I think might be the best solution to the problem of the various triggers interfering with one another). Thanks for your help.
     
    Last edited: May 22, 2018
  44. princebk

    princebk

    Joined:
    Mar 27, 2017
    Posts:
    1
    Hi AndrewRH,

    Thank for develop awesome asset. I have a question about stereo video in AVPro. When StereoPacking is detected, Video's Right or Top will display automatically. In my case, i have a Left Right (or Top Bottom) stereo video, and i want to display video's left and right together in player screen. My solution is "creating left/right/top/bottom sphere shader" and 2 cameras to display 2 area on screen. Can you give a advice? I am a new in unity. Hope you reply soon.
     

    Attached Files:

  45. jnroesch

    jnroesch

    Joined:
    Feb 2, 2018
    Posts:
    5
    Hi Andrew,
    I am currently experimenting with the free demo of the AVPro asset and really like it so far! However I can not quite achieve the Performance that I want. I am sure that someone asked a similar Question in here but to be honest I don't want to read through this whole Forum so Maybe you can give some recommendations.

    Target: Android 5.1 and above
    Video Resolution: 3840x2160@30fps
    System: 360° stereoscopic Video for Cardboard (Unity VR)

    we played around with some Video codecs and containers like mp4 (h.264) , mp4 (h.265) and webm (vp8 and vp9) but when we Play the demo Scene with our Video on our Android devices (Nexus 5X, Galaxy S5, Galaxy S6 Edge) we only get around 30 fps. The Video seems to run rather smooth but the app itself is lagging. The Unity Profiler states that almost 70% are XR.WaitForGPU calls. So do you know any way to make more use of the CPU instead of the GPU? Or make GPU Rendering on Android faster?

    Cheers
     
  46. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    I understand you don't want to do stereo rendering, you just want to display both eye-halves of the video on the screen, on the left and right side? I'm not quite sure if I understand you correctly.

    If this is what you want then this is an edge case, and something that you would have to implement yourself. You could use 2 cameras, or you could actually make your single shader determine whether it is writing to the left or right half of the screen (using the X tecoord) and just use a single mesh+camera.

    If you do want to create stereo rendering, then this feature already exists. Simply go to MediaPlayer > Visual and select the stereo packing mode for your video. Then you just need to be using one of our shaders on your object. You can see the 360 demo scene for how this works.

    Thanks,
     
    princebk likes this.
  47. AndrewRH

    AndrewRH

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

    Are you sure that it's the video playback causing the low app frame rate? Does the rate increase when you pause the video? I know some versions of Unity default mobile apps to 30fps, so you may want to try calling Application.targetFrameRate = 60;
    Also it might be worth checking the quality settings in Unity to make sure VSync is set to 1 and not 2.

    I would try the above first.

    If it is the video playback causing the issue, then there are a few things that can be done. Firstly we have two video playback APIs to choose from. Look in MediaPlayer > Platform Specific > Android and see whether selecting ExoPlayer makes a difference. Next is the OES rendering mode option. This will improvement performance, but it requires that use apply AVPro OES shaders to your materials.

    Lastly, your video may be encoded with too many complex features or too high bit-rate, so re-encoding it can help to reduce the GPU burden. We have some notes in our PDF documentation on how to do this.

    Let me know if any of this helps you.

    Thanks,
     
  48. rolliefingez

    rolliefingez

    Joined:
    Apr 4, 2013
    Posts:
    21
    Hi there, there is many pages now on this thread so apologies if I am posting something that has been asked a million times!

    I just have a quick query on 360 and sphere size. I am creating a UI and testing using the demo 360 scene. the scale of the sphere is 1 so when I add canvas items (world) they are huge. Is there any bad performance if the sphere scale was greater or am I doing this wrong?

    sorry if question is that of a deluded simpleton!

    Thanks
     
  49. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Changing the scale of the sphere should be fine! It won't have any affect on performance.

    Thanks,
     
    rolliefingez likes this.
  50. chrisj7w

    chrisj7w

    Joined:
    Jul 31, 2017
    Posts:
    3
    Problem description:

    I have a video url that I'm streaming from - I have strong internet and yet the quality of the 4k 360 video is low
    What can I do to increase the quality settings on the player?

    Device (which devices are you having the issue with - model, OS version number):

    All devices.

    Media (tell us about your videos - number of videos, resolution, codec, frame-rate, example URLs):

    360 video 2k, looks crystal clear when played through a web 360 player and youtubes 360 player. It is streaming from AWS.

    System Information:

    AVPro Video: plugin v1.8.0 scripts v1.8.0
    Target Platform: iPhone
    Unity: v2017.4.2f2 OSXEditor
    OS: Desktop - MacBookPro13,3 - Mac OS X 10.13.4 - English
    CPU: Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz - 8 threads - 16384KB
    GPU: AMD Radeon Pro 460 OpenGL Engine - ATI Technologies Inc. - OpenGL 4.1 ATI-1.66.31 - 4096KB - 16384