Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[Released] AVPro Video - complete video playback solution

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

  1. xpansivevr

    xpansivevr

    Joined:
    Jun 22, 2016
    Posts:
    27
    I appreciate "any mappings you supply are just a bonus" but I think it would be awesome if a demo scene would be included in a future release :) maybe you could reach out to the Whirligig author?

    Cheers - Nick
     
  2. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,652
    I'll see what we can do :) Thanks,
     
  3. AndrewRH

    AndrewRH

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

    AVPro Video version 1.6.6 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:

    General
    • PlayMaker (the popular visual scripting system for Unity) is now supported by AVPro Video. We have added over 64 new PlayMaker actions for seamlessly integration into your PlayMaker workflow
    • Added audio stereo balance support
    • Added new stereo packing mode that uses a pair of UV sets for custom left and right mapping.
    • Added new Support & Help window to make reporting issues easier and to include helpful diagnostic information
    • Added documentation about 3rd-party library usage
    • Added documentation about iOS video decoders
    Windows Desktop
    • Added multi-threaded decoding for chunked Hap videos
    Windows Store / UWP / Hololens
    • Added new function to load media from native file locations using IRandomAccessStreamWithContentType. This means you can now play media from the camera roll. See the example script in Demos/Scripts/Scriptlets/NativeMediaOpen.cs for details of usage.
    Android
    • Fixed lost GLES context issue that can happens at least when switching Google Cardboard on/off
    • Fixed one of the OES shaders that was failing to compile on Android due to undefined TRANSFORM_TEX macro
    • Refactored some of the low-level code
    iOS
    • Added support for headphone connection changes. Unplugging / connecting headphones will now correctly set state of the video so that IsPaused() and IsPlaying() return the correct value
    • Fixed a rare bug in the VCR demo script which caused the FinishedPlaying event not to fire due to triggering a Seek() at the end of an HLS stream
    iOS / tvOS / macOS
    • Fixed frame flash issue due to FirstFrameReady event firing too early due to frame count increment bug
    Thanks,
     
    blevok likes this.
  4. blevok

    blevok

    Joined:
    Feb 16, 2017
    Posts:
    39
    Awesome! Thank you so much for working on this, i can't wait to try it out.
     
    AndrewRH likes this.
  5. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    367
  6. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,423
    Hi Andrew.
    How would you scale a source .mp4 video to fit a given movietexture in the longest dimension without changing the video's WxH ratio? ie letterbox the video if it doesn't match the movietexture WxH ratio.
     
  7. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,652
    Hi eco_bach,
    I'm not sure what you mean by movietexture? Are you referring to Unity's MovieTexture object? If so, none of our plugins support MovieTexture's.
    Most of our display components already support several scaling modes. Which display component are you using?
    If you're just looking to scale the source video, then personally we use FFMPEG command-line tool.
    If you can provide more details, or even a screenshot of your setup then we can help further.
    Thanks,
     
  8. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,423
    Thanks. Yes the MediaPlayer component. I don't see any scaling options. There is a Scale option in the ApplytoMaterial script but it juts accepts hard coded values
     
  9. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,652
    ApplyToMaterial is useful when you're meshes, and the mapping of this depends on your UV layout on the mesh. You may want to use either DisplayUGUI or DisplayIMGUI components as these both have scaling options such as "Scale To Fit" etc.. I hope that helps.
     
  10. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,423
    Thanks Andrew!
    Another strange issue with a desktop deploy

    Executable runs fine on my Mac OSX
    When I copy the EXACT same files to another users machine, I hear the audio, but see no video. Just a black screen. I've googled but cannot find any similar issues.
    Is there possibly a missing video codec on the deploy machine?
     
    Last edited: May 26, 2017
  11. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,423
    Just a heads up...Unity 5.6 related bug as far as I can tell.

    Redeployed using latest stable Unity 5.5 and the issue goes away!
     
  12. MrMatthias

    MrMatthias

    Joined:
    Sep 18, 2012
    Posts:
    181
    I get an dll not found exception on the HoloLens after upgrading to Unity 2017.1, also updated to the latest AV Pro video (1.6.6)
     
  13. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,652
    Hi MrMatthias,
    There is a chance that Unity didn't do the update of AVPro Video correctly, due to having the DLL files locked. Please try closing all Unity's, open a new Unity instance, and without running the scene do the upgrade. Hopefully this works, but if it doesn't, perhaps you could post the log of what exactly the error message is (with full stack trace), and also check that the DLL plugin files have the correct platforms set by clicking on them in the Project Window and viewing the platform settings that come up in the Inspector window.
    Thanks,
     
  14. immersiv

    immersiv

    Joined:
    Jun 8, 2015
    Posts:
    2
    Hello, I got an issue with the latest version of the plugin on iOS, when I try to play several videos the memory isn't freed after calling CloseVideo(). I use the YpCbCr420 option.
    Is there something else to call to free up the memory?
     
  15. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,652
    Hi,
    Thanks for reporting this - we'll look into it and get back to you. In the meantime - which graphics API are you using (Metal/GLES/OpenGL etc)? And does it make a difference if you change to a different graphics API? (via Player Settings)

    Thanks,
     
  16. Artyom-Abgaryan

    Artyom-Abgaryan

    Joined:
    Jan 9, 2010
    Posts:
    153
    @AndrewRH why there is no documentation ?
    AVPro Video Class Reference - this one just list of classes, there is no REFERENCE at all - no description
    PDF - is just scratches the surface
    upload_2017-5-29_12-30-10.png

    Pause - Pauses
    Stop - Pauses (What?)
    Rewind - what to expect, Seek(0) or what ?
    no detailed description

    I need to set video to start frame and wait for Play after playback stops.
     
  17. blevok

    blevok

    Joined:
    Feb 16, 2017
    Posts:
    39
    They have an online reference.
    http://www.renderheads.com/content/docs/AVProVideoClassReference/

    And btw @AndrewRH, the link to the reference in the pdf seems to be broken, at least when i try it. But i found the link to it on your website.
     
  18. immersiv

    immersiv

    Joined:
    Jun 8, 2015
    Posts:
    2
    I don't think we can choose the graphics API in Unity 5.6?
     
  19. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,652
    Thanks, I've fixed the link internally and it will be released in the next plugin version. Thanks for reporting this broken link.
     
  20. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,652
    I think you can? It should be in Player Settings > Other Settings > untick "Automatic Graphics API" and then you can select your preferences. Let me know how it goes please so we can help resolve this issue :) Thanks,
     
  21. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,652
    Hi,
    Sorry to hear that you had trouble finding scripting documentation. I think most of our effort has gone into the example scripts, which you can find in the AVProVideo/Demos/Scripts folder where we tried to show many use cases.

    I think this pseudocode might be helpful for you to:

    Code (CSharp):
    1. public MediaPlayer _mediaPlayer;
    2.  
    3. void Start()
    4. {          
    5.        _mediaPlayer.Events.AddListener(OnMediaPlayerEvent);
    6. }
    7.  
    8. // Callback function to handle events
    9. public void OnMediaPlayerEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
    10. {
    11.     switch (et)
    12.     {
    13.         case MediaPlayerEvent.EventType.FinishedPlaying:
    14.             _mediaPlayer.Rewind(true);
    15.             break;
    16.     }
    17. }
    18.  
    This will rewind an pause the video on the first frame when it has completed playback. Note that the FinishedPlaying event only fires on videos that aren't set to loop.

    I hope that helps. Any issues just let us know.

    Thanks,
     
  22. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,423
    Hi Andrew.
    The previous issue(sound only, no video) has resurfaced when deploying to Windows Desktop using Unity 5.5. Not getting any deploy errors!

    Video specs are attached

    Can you suggest any further troubleshooting steps?

    Again, not experiencing this issue using Unity 5.5 deploying to Mac desktop
     

    Attached Files:

    Last edited: May 30, 2017
  23. MrMatthias

    MrMatthias

    Joined:
    Sep 18, 2012
    Posts:
    181
    Hi Andrew,
    building into an old build folder seems to have been the problem
     
  24. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,652
    Which version of Windows? Which version of AVPro Video?
    Thanks,
     
  25. Selaphiel

    Selaphiel

    Joined:
    Jan 31, 2014
    Posts:
    21
    Hi Andrew,

    I am facing a crash. So to describe my project - i have two AVPRO media player in scene which plays 4k video one at a time, and i switched from one to another when first frame is ready by changing apply to mesh media player object. So if i keep switching these video in gear vr by tapping of certain intractable item then pressing back to switch again then tap on intractable item, such is the procedure. I get a crash after doing this for 10-15 times. I tried reproducing the issue in editor, and profiling it. Attached image of profiler is what i got with 3 sec freeze caused by MediaPlayer.Update(). Please help me i seriously need to make this work.
     

    Attached Files:

  26. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,652
    Hi Selaphiel,

    Having two 4K MediaPlayers on Android device is probably a bit heavy as there are a lot of resources used by each MediaPlayer. Instead, I would use a single MediaPlayer. When you want to switch videos, just Graphics.Blit() the current video texture to a RenderTexture and display that on your mesh until the MediaPlayer has loaded and fires the event for the first frame available.

    I hope this helps. Thanks,
     
  27. AndrewRH

    AndrewRH

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

    AVPro Video version 1.6.8 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:

    iOS / tvOS

    • No longer requires a separate plugin file for Unity 5.3 and below. New bootstrap C code handles the change in Unity’s plugin API.
    • Improved Metal compatibility with older versions of Unity
    General
    • The AudioOutput component has some new experimental changes, including the ability to have multiple AudioOutput instances and to remap which channels the audio outputs to
    Thanks,
     
  28. yaffa

    yaffa

    Joined:
    Nov 21, 2016
    Posts:
    34
    Hi , Im trying to make a 180 video file run on Avpro ,on a hemisphere , can you provide the right shader for that ?
    Heres a screeshot of the file.
     

    Attached Files:

  29. Selaphiel

    Selaphiel

    Joined:
    Jan 31, 2014
    Posts:
    21
    I removed second video player but still i am getting crash on my galaxy s7 with gear vr build. So i checked adb log for error, and, when i load another video i got these errors thrown
    Code (CSharp):
    1. 06-01 13:27:44.400: E/SEC_DRM_PLUGIN_Omafl(3254): OmaPlugin::eek:nOpenDecryptSession(fd)::Drm2IsDrmFileByExtFd::file is NOT DRM by extension
    2. 06-01 13:27:44.444: E/SEC_DRM_PLUGIN_Omafl(3254): OmaPlugin::eek:nOpenDecryptSession(fd)::Drm2IsDrmFileByExtFd::file is NOT DRM by extension
    3. 06-01 13:27:44.479: E/MediaPlayerService(3297): WFD client is not created
    4. 06-01 13:27:44.528: E/OMXNodeInstance(3293): setConfig(cdd0068:Exynos.avc.dec, ConfigPriority(0x6f800002)) ERROR: UnsupportedIndex(0x8000101a)
    5. 06-01 13:27:44.529: E/OMXNodeInstance(3293): getConfig(cdd0068:Exynos.avc.dec, ConfigCommonOutputCrop(0x700000f)) ERROR: NotReady(0x80001010)
    And these are logs when app crashes
    Code (CSharp):
    1. 06-01 14:34:11.318: A/libc(28528): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x10 in tid 28586 (Thread-329)
    2. 06-01 14:34:11.922: A/DEBUG(30779): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    3. 06-01 14:34:11.922: A/DEBUG(30779): Build fingerprint: 'samsung/heroltexx/herolte:7.0/NRD90M/G930FXXU1DQE7:user/release-keys'
    4. 06-01 14:34:11.922: A/DEBUG(30779): Revision: '8'
    5. 06-01 14:34:11.923: A/DEBUG(30779): ABI: 'arm'
    6. 06-01 14:34:11.923: A/DEBUG(30779): pid: 28528, tid: 28586, name: Thread-329  >>> com.rizort.test <<<
    7. 06-01 14:34:11.923: A/DEBUG(30779): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10
    8. 06-01 14:34:11.924: A/DEBUG(30779):     r0 00000010  r1 00000010  r2 00000053  r3 00000000
    9. 06-01 14:34:11.924: A/DEBUG(30779):     r4 ffffffff  r5 00000000  r6 00000000  r7 00000002
    10. 06-01 14:34:11.924: A/DEBUG(30779):     r8 ffffffff  r9 0000006e  sl d0c2570e  fp c9209988
    11. 06-01 14:34:11.924: A/DEBUG(30779):     ip f0a37d88  sp c9209788  lr f09fefa5  pc f09c7ba8  cpsr 600b0030
    12. 06-01 14:34:11.937: A/DEBUG(30779): backtrace:
    13. 06-01 14:34:11.939: A/DEBUG(30779):     #00 pc 00018ba8  /system/lib/libc.so (strlen+71)
    14. 06-01 14:34:11.939: A/DEBUG(30779):     #01 pc 0004ffa1  /system/lib/libc.so (__strlen_chk+4)
    15. 06-01 14:34:11.939: A/DEBUG(30779):     #02 pc 00040601  /system/lib/libc.so (__vfprintf+4552)
    16. 06-01 14:34:11.939: A/DEBUG(30779):     #03 pc 00045227  /system/lib/libc.so (vsnprintf+134)
    17. 06-01 14:34:11.940: A/DEBUG(30779):     #04 pc 003e2d5c  /data/app/com.rizort.test-2/lib/arm/libunity.so
    18. 06-01 14:34:11.940: A/DEBUG(30779):     #05 pc 000fd0c8  /data/app/com.rizort.test-2/lib/arm/libunity.so
    19. 06-01 14:34:11.940: A/DEBUG(30779):     #06 pc 000fb2b0  /data/app/com.rizort.test-2/lib/arm/libunity.so
    20. 06-01 14:34:11.940: A/DEBUG(30779):     #07 pc 000fbc74  /data/app/com.rizort.test-2/lib/arm/libunity.so
    21. 06-01 14:34:11.940: A/DEBUG(30779):     #08 pc 000fbaec  /data/app/com.rizort.test-2/lib/arm/libunity.so
    22. 06-01 14:34:11.940: A/DEBUG(30779):     #09 pc 0098da7c  /data/app/com.rizort.test-2/lib/arm/libunity.so
    23. 06-01 14:34:11.940: A/DEBUG(30779):     #10 pc 00029293  /data/app/com.rizort.test-2/oat/arm/base.odex (offset 0x27000)
    24. 06-01 14:53:00.584: E/(2990): ro.debug_level = 0x4f4c
    25. 06-01 14:53:00.584: E/(2990): sys.mobilecare.preload = false
    26. 06-01 14:53:00.607: E/audit(3246): type=1701 audit(1496308980.593:790): auid=4294967295 uid=10249 gid=10249 ses=4294967295 subj=u:r:untrusted_app:s0:c512,c768 pid=1492 comm="Thread-330" exe="/system/bin/app_process32" sig=11
    27. 06-01 14:53:00.608: E/SemAffinityControl(3739): SemAffinityControl : sched_setaffinity failed
    28. 06-01 14:53:00.630: E/GearVrManagerService(3739): Given thread does not exist
    29. 06-01 14:53:00.843: E/lowmemorykiller(3112): Error writing /proc/675/oom_score_adj; errno=22
    30.  
    31.  
     
    Last edited: Jun 1, 2017
  30. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,652
    Hmm, that screenshot looks corrupt? Perhaps it was too large for Unity Forums...could you resize it and post again? Thanks, Also - how are you generating these 180 degree videos? If we know what transforms are used to generate them then we can know how to untransform them.

    Thanks,
     
  31. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,652
    Hmmm..unfortunately I can't see anything useful in those logs :(
    Is there a chance you could send us a repro case for testing?
     
  32. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,423
    Andrew
    I managed to fix the issue but not sure of the exact cause. Something to do with nesting of the Movietexture as a child in another gameobject. I can see right away its not going to work when I see the color of my movietexture change from white to black in my Scene view after nesting.
     
  33. blevok

    blevok

    Joined:
    Feb 16, 2017
    Posts:
    39
    Hi Andrew. The new openfilefromstream function for windows store is working great, and my users love it. Thank you for making that happen. It causes a crash on lower-end devices due to using picksinglefileasync instead of picksinglefileandcontinue, but this app really isn't intended for low-end devices so i'm not too worried about it.

    I've been getting requests for 360 and 180 video compatibility. I tried the 360sphere with the "InsideSphere Unlit (stereo+fog)" shader, which works perfectly in the editor, but it doesn't work on the device. The sphere is just invisible or missing on the mobile build. I was able to reproduce the issue in an empty project using the example "08_Demo_360SphereVideo".

    Here is the error:
    WARNING: Shader Unsupported: 'AVProVideo/VR/InsideSphere Unlit (stereo+fog)' - Pass '' has no vertex shader
    ERROR: Shader Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)WARNING: Shader Unsupported: 'AVProVideo/VR/InsideSphere Unlit (stereo+fog)' - Setting to default shader.

    I tried another shader, "AVProVideo/Unlit/Opaque (texture+color+fog+stereo support)", which also worked perfectly in the editor, but didn't exactly work right on the device. It did work initially, but the video was flipped horizontally, so i used your suggestion in the PDF faq to flip it. That worked until i added functions for the user to select the stereo packing of the video.

    I found that changing the stereo setting on the fly has no effect, so i wrote the function so that when you use the in-app setting to change it, it closes the video, then changes the packing, then restarts the video. That made it work, but the video doesn't look right. A screenshot of a standard 360 video with no stereo packing is attached, but it also looks similar with top/bottom and left/right packing.

    And since people are asking for 180 videos, i'm also interested in yaffa's question. Playing a video on a hemisphere would be great, but even some settings that scale it properly on a 360 sphere would work, and i could just mask the back of the sphere. I've experimented a little, but haven't got it to look right yet.

    Thanks
     

    Attached Files:

  34. inoiberica

    inoiberica

    Joined:
    Sep 29, 2016
    Posts:
    3
    Hi!

    We have aquired your plugin one month ago or some. Now I am testing it using a technical demo with chroma videos (alpha left-right) and tunning the bitrates, size, etc.
    I am using last unity version 5.6.1p1 and last AVPro plugin (from 31 of may I believe). Videos are uploaded to Amazon WS in a bucket. For testing purposes are public and only the URL is required.

    The videos play very well in the editor and in Android if they are in the streamings folder, but when I try to play one in Android through URL (although in editor work well) they are not loaded and no error is displayed. Internet connection is "required" in player settings. I have tried with different mp4 videos which play well in Android through folder, but not when uploaded, although in editor play well through URL.

    Any idea why is this happening?

    Thanks and great plugin
    Robert Casas
     
  35. inoiberica

    inoiberica

    Joined:
    Sep 29, 2016
    Posts:
    3
    Resolved with a reboot. Something was wrong (its a testing device).
    Thanks
     
    AndrewRH likes this.
  36. ws19940118

    ws19940118

    Joined:
    Jun 3, 2017
    Posts:
    1
    hi,how to reduce cpu usage when i play 4k video? (cpu--80%) thank you very mauch.
     
  37. draky

    draky

    Joined:
    Nov 24, 2016
    Posts:
    5
    We downscaled to 3840x2048 and it fixed the problem :)

    Another question Andrew is when we try to rotate the camera on a tablet inside the stereo VR player, but the camera jitters whenever it rotates. My guess is the camera is having trouble with the way Stereo is rendered on the sphere. Do you have any ideas if there is a way around this?
     
  38. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,652
    Hi, could you possibly give more details? eg:

    1) Which platform?
    2) Which version of Unity?
    3) What are the specs of your videos?
    4) Which version of AVPro Video plugin?
    5) Your GPU hardware

    It sounds like for some reason your GPU isn't being used to decode the video.. This could be because of the format of your video, or your GPU hardware spec, or your operating system...

    Thanks,
     
  39. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,652
    Hi, glad to hear that solved the problem.
    I'm not sure what you mean by "jitters" - is it possible to see a screenshot/video? I know the GearVR does jitter the viewport around - this is part of asynchronous timewarp...If you suspect that the jitter is actually the eyes swapping, then you can enable the debug eye tinting (in Media Player > Media Properties) to see whether this is the case. We may be able to tell more about this once we have more information.
    Thanks,
     
  40. Evgeni-Yorgakiev

    Evgeni-Yorgakiev

    Joined:
    Oct 24, 2015
    Posts:
    3
    Hi!

    We are using the Trial version of your plugin and until recently it worked perfectly. We added another plugin that is using the
    "UnityEditor.BuildPipeline.BuildPlayer(string[] levels, string locationPathName, BuildTarget target, BuildOptions options);"
    function which for some reason causes the error from the attached file to appear. If I build it from the default File -> Build & Run button everything works perfectly with your plugin but that would mean the other plugin won't work. Everything works when ran from the Unity editor so the problem seems to come from only when built.
    I am building it for Android Api Level 19 and using Unity 5.6.0f3.
    I also have the latest version of the plugin.


    I hope you can help me with this problem.
    Thanks for the time.
     

    Attached Files:

  41. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,652
    What is the other plugin? It sounds like an issue that should be fixed in that plugin :)

    It looks like for some reason it is not copying over the AVProVideo Android plugin....

    Thanks,
     
  42. draky

    draky

    Joined:
    Nov 24, 2016
    Posts:
    5
    Heres a video of what i meant:

     
  43. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Posts:
    96
    I've had the same issue when you're not in Cardboard mode. I added a conditional in the shaders to force loading the left eye only. Would be a good feature to add. (or make the IsStereoEyeLeft a bit more robust to handle these cases)

    EDIT: The below makes no sense, as it's not a stereo display :) sorry for that
    (wrong: Make sure you have the UpdateStereoMaterial component and the correct camera linked to that component.)
     
    AndrewRH likes this.
  44. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,652
    Thanks for the video draky,
    and thanks for the thoughts Tom-Goethals.

    I agree with Tom - it looks like the left and right eyes are switching. You need to make sure you're using the UpdateStereoMaterial component, and that it is linked to the correct camera. But that is for stereo displays (like cardboard / gearVR), but in your video you're not running in stereo mode, so all bets are off.

    Thanks,
     
  45. Invizx3

    Invizx3

    Joined:
    Feb 1, 2016
    Posts:
    8
    Hi!
    We are trying to sync rendered animation with imported animation.
    This is with standard unity video player from unity 5.6:

    And this is with your plugin:


    What can be the problem of delaying video of inported model?
     
  46. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,652
    I'm not sure how you're playing your video. Do you wait for the video to finish loading before you play it and trigger the animation? Loading can take some time.. Also if you video is encoded reference frames, it can take a few milliseconds to begin playback. I would recommend loading the video, waiting for the first frame (via the events) and then waiting a a second before playing both the video and the animation.

    Thanks,
     
  47. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,166
    @AndrewRH
    I have a portrait fixed unity app, and i give full width and height to avpro media control (UGUI based) however video is played in portrait mode, is there any way to force video player to play according to bigger height or width.

    I cant use runtime orientation to landscape here as Unity has a runtime orientation bug on iOS.

    Please advise
     
  48. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Posts:
    96
    Did anyone test 5.6.1p2 for the fix of the OES shader compilation issue?

    [EDIT1 - It's not working :confused: Really missing this functionality in 5.6.1]

    [EDIT2 - for new people.. please vote on this bug: https://issuetracker.unity3d.com/is...er-compilation-failure-on-some-mobile-devices

    [EDIT3 - as it was still working in Unity 5.6.0b2, does anyone still have an installer for that? can't seem to find it anywhere. ]

    Andrew, don't know if it's possible, but maybe the bugreport can be updated to include the other unity versions as well? ]

    [EDIT4 - Adding ADB log, it's showing shader stuff, maybe AVPro has some use of it? I'm not seeying any actual compilation errors and also my sphere is not pink! Just black... might it be working but some other weird issue? worth investigating further?]
    Code (CSharp):
    1.  
    2. 06-07 15:18:47.978  7319  7361 D Unity   : //-----------------------------------------------------------------------------
    3. 06-07 15:18:47.978  7319  7361 D Unity   : // Copyright 2015-2017 RenderHeads Ltd.  All rights reserverd.
    4. 06-07 15:18:47.978  7319  7361 D Unity   : //-----------------------------------------------------------------------------
    5. 06-07 15:18:47.978  7319  7361 D Unity   : #if defined (SHADERLAB_GLSL)
    6. 06-07 15:18:47.978  7319  7361 D Unity   :  #define INLINE
    7. 06-07 15:18:47.978  7319  7361 D Unity   :  #define HALF2 vec2
    8. 06-07 15:18:47.978  7319  7361 D Unity   :  #define HALF3 vec3
    9. 06-07 15:18:47.979  7319  7361 D Unity   :  #define HALF4 vec4
    10. 06-07 15:18:47.979  7319  7361 D Unity   :  #define FLOAT2 vec2
    11. 06-07 15:18:47.979  7319  7361 D Unity   :  #define FLOAT3 vec3
    12. 06-07 15:18:47.979  7319  7361 D Unity   :  #define FLOAT4 vec4
    13. 06-07 15:18:47.979  7319  7361 D Unity   :  #define FLOAT3X3 mat3
    14. 06-07 15:18:47.979  7319  7361 D Unity   : #else
    15. 06-07 15:18:47.979  7319  7361 D Unity   :  #define INLINE inline
    16. 06-07 15:18:47.979  7319  7361 D Unity   :  #define HALF2 half2
    17. 06-07 15:18:47.979  7319  7361 D Unity   :  #define HALF3 half3
    18. 06-07 15:18:47.979  7319  7361 D Unity   :  #define HALF4 half4
    19. 06-07 15:18:47.979  7319  7361 D Unity   :  #define FLOAT2 float2
    20. 06-07 15:18:47.979  7319  7361 D Unity   :  #define FLOAT3 float3
    21. 06-07 15:18:47.979  7319  7361 D Unity   :  #define FLOAT4 float4
    22. 06-07 15:18:47.979  7319  7361 D Unity   :  #define FLOAT3X3 float3x3
    23. 06-07 15:18:47.979  7319  7361 D Unity   : #endif
    24. 06-07 15:18:47.979  7319  7361 D Unity   : INLINE bool IsStereoEyeLeft(FLOAT3 worldNosePosition, FLOAT3 worldCameraRight)
    25. 06-07 15:18:47.979  7319  7361 D Unity   : {
    26. 06-07 15:18:47.979  7319  7361 D Unity   : #if defined(UNITY_SINGLE_PASS_STEREO)
    27. 06-07 15:18:47.979  7319  7361 D Unity   :  // Unity 5.4 has this new variable
    28. 06-07 15:18:47.979  7319  7361 D Unity   :  return (unity_StereoEyeIndex == 0);
    29. 06-07 15:18:47.979  7319  7361 D Unity   : #else
    30. 06-07 15:18:47.979  7319  7361 D Unity   : //#if (UNITY_VERSION > 540) && defined(GOOGLEVR) && !defined(SHADERLAB_GLSL)
    31. 06-07 15:18:47.979  7319  7361 D Unity   :  // Daydream support uses the skew component of the projection matrix
    32. 06-07 15:18:47.979  7319  7361 D Unity   :  // (But unity_CameraProjection doesn't seem to be declared when using GLSL)
    33. 06-07 15:18:47.979  7319  7361 D Unity   :  // NOTE: we've had to remove this minor optimisationg as it was causing too many isues.
    34. 06-07 15:18:47.979  7319  7361 D Unity   :  //       eg. Unity 5.4.1 in GLSL mode complained UNITY_VERSION and unity_CameraProjection aren't defined
    35. 06-07 15:18:47.979  7319  7361 D Unity   :  //return (unity_CameraProjection[0][2] > 0.0);
    36. 06-07 15:18:47.979  7319  7361 D Unity   : //#else
    37. 06-07 15:18:47.979  7319  7361 D Unity   :  // worldNosePosition is the camera positon passed in from Unity via script
    38. 06-07 15:18:47.979  7319  7361 D Unity   :  // We need to determine whether _WorldSpaceCameraPos (Unity shader variable) is to the left or to the right of _cameraPosition
    39. 06-07 15:18:47.979  7319  7361 D Unity   :  float dRight = distance(worldNosePosition + worldCameraRight, _WorldSpaceCameraPos);
    40. 06-07 15:18:47.979  7319  7361 D Unity   :  float dLeft = distance(worldNosePosition - worldCameraRight, _WorldSpaceCameraPos);
    41. 06-07 15:18:47.979  7319  7361 D Unity   :  return (dRight > dLeft);
    42. 06-07 15:18:47.979  7319  7361 D Unity   : //#endif
    43. 06-07 15:18:47.979  7319  7361 D Unity   : #endif
    44. 06-07 15:18:47.979  7319  7361 D Unity   : }
    45. 06-07 15:18:47.979  7319  7361 D Unity   : #if defined(STEREO_TOP_BOTTOM) || defined(STEREO_LEFT_RIGHT)
    46. 06-07 15:18:47.979  7319  7361 D Unity   : FLOAT4 GetStereoScaleOffset(bool isLeftEye)
    47. 06-07 15:18:47.979  7319  7361 D Unity   : {
    48. 06-07 15:18:47.979  7319  7361 D Unity   :  FLOAT2 scale = FLOAT2(1.0, 1.0);
    49. 06-07 15:18:47.979  7319  7361 D Unity   :  FLOAT2 offset = FLOAT2(0.0, 0.0);
    50. 06-07 15:18:47.979  7319  7361 D Unity   :  // Top-Bottom
    51. 06-07 15:18:47.979  7319  7361 D Unity   : #if defined(STEREO_TOP_BOTTOM)
    52. 06-07 15:18:47.979  7319  7361 D Unity   :  scale.y = 0.5;
    53. 06-07 15:18:47.979  7319  7361 D Unity   :  offset.y = 0.0;
    54. 06-07 15:18:47.979  7319  7361 D Unity   :  if (!isLeftEye)
    55. 06-07 15:18:47.979  7319  7361 D Unity   :  {
    56. 06-07 15:18:47.979  7319  7361 D Unity   :   offset.y = 0.5;
    57. 06-07 15:18:47.979  7319  7361 D Unity   :  }
    58. 06-07 15:18:47.979  7319  7361 D Unity   :  // UNITY_UV_STARTS_AT_TOP is for directx
    59. 06-07 15:18:47.979  7319  7361 D Unity   : #if !defined(SHADERLAB_GLSL)
    60. 06-07 15:18:47.979  7319  7361 D Unity   : #if !defined(UNITY_UV_STARTS_AT_TOP)
    61. 06-07 15:18:47.979  7319  7361 D Unity   :  offset.y = 0.5 - offset.y;
    62. 06-07 15:18:47.979  7319  7361 D Unity   : #endif
    63. 06-07 15:18:47.979  7319  7361 D Unity   : #endif
    64. 06-07 15:18:47.979  7319  7361 D Unity   :  // Left-Right
    65. 06-07 15:18:47.979  7319  7361 D Unity   : #elif defined(STEREO_LEFT_RIGHT)
    66. 06-07 15:18:47.979  7319  7361 D Unity   :  scale.x = 0.5;
    67. 06-07 15:18:47.979  7319  7361 D Unity   :  offset.x = 0.0;
    68. 06-07 15:18:47.979  7319  7361 D Unity   :  if (!isLeftEye)
    69. 06-07 15:18:47.979  7319  7361 D Unity   :  {
    70. 06-07 15:18:47.979  7319  7361 D Unity   :   offset.x = 0.5;
    71. 06-07 15:18:47.979  7319  7361 D Unity   :  }
    72. 06-07 15:18:47.979  7319  7361 D Unity   : #endif
    73. 06-07 15:18:47.979  7319  7361 D Unity   :  return FLOAT4(scale, offset);
    74. 06-07 15:18:47.979  7319  7361 D Unity   : }
    75. 06-07 15:18:47.979  7319  7361 D Unity   : #endif
    76. 06-07 15:18:47.979  7319  7361 D Unity   : #if defined(STEREO_DEBUG)
    77. 06-07 15:18:47.979  7319  7361 D Unity   : INLINE FLOAT4 GetStereoDebugTint(bool isLeftEye)
    78. 06-07 15:18:47.979  7319  7361 D Unity   : {
    79. 06-07 15:18:47.979  7319  7361 D Unity   :  FLOAT4 tint = FLOAT4(1.0, 1.0, 1.0, 1.0);
    80. 06-07 15:18:47.979  7319  7361 D Unity   : #if defined(STEREO_TOP_BOTTOM) || defined(STEREO_LEFT_RIGHT) || defined(STEREO_CUSTOM_UV)
    81. 06-07 15:18:47.979  7319  7361 D Unity   :  FLOAT4 leftEyeColor = FLOAT4(0.0, 1.0, 0.0, 1.0);  // green
    82. 06-07 15:18:47.979  7319  7361 D Unity   :  FLOAT4 rightEyeColor = FLOAT4(1.0, 0.0, 0.0, 1.0);  // red
    83. 06-07 15:18:47.979  7319  7361 D Unity   :  if (isLeftEye)
    84. 06-07 15:18:47.979  7319  7361 D Unity   :  {
    85. 06-07 15:18:47.979  7319  7361 D Unity   :   tint = leftEyeColor;
    86. 06-07 15:18:47.979  7319  7361 D Unity   :  }
    87. 06-07 15:18:47.979  7319  7361 D Unity   :  else
    88. 06-07 15:18:47.979  7319  7361 D Unity   :  {
    89. 06-07 15:18:47.979  7319  7361 D Unity   :   tint = rightEyeColor;
    90. 06-07 15:18:47.979  7319  7361 D Unity   :  }
    91. 06-07 15:18:47.979  7319  7361 D Unity   : #endif
    92. 06-07 15:18:47.979  7319  7361 D Unity   : #if defined(UNITY_UV_STARTS_AT_TOP)
    93. 06-07 15:18:47.979  7319  7361 D Unity   :  tint.b = 0.5;
    94. 06-07 15:18:47.979  7319  7361 D Unity   : #endif
    95. 06-07 15:18:47.979  7319  7361 D Unity   :  return tint;
    96. 06-07 15:18:47.979  7319  7361 D Unity   : }
    97. 06-07 15:18:47.979  7319  7361 D Unity   : #endif
    98. 06-07 15:18:47.979  7319  7361 D Unity   : FLOAT2 ScaleZoomToFit(float targetWidth, float targetHeight, float sourceWidth, float sourceHeight)
    99. 06-07 15:18:47.979  7319  7361 D Unity   : {
    100. 06-07 15:18:47.979  7319  7361 D Unity   : #if defined(ALPHAPACK_TOP_BOTTOM)
    101. 06-07 15:18:47.979  7319  7361 D Unity   :  sourceHeight *= 0.5;
    102. 06-07 15:18:47.979  7319  7361 D Unity   : #elif defined(ALPHAPACK_LEFT_RIGHT)
    103. 06-07 15:18:47.979  7319  7361 D Unity   :  sourceWidth *= 0.5;
    104. 06-07 15:18:47.979  7319  7361 D Unity   : #endif
    105. 06-07 15:18:47.979  7319  7361 D Unity   :  float targetAspect = targetHeight / targetWidth;
    106. 06-07 15:18:47.979  7319  7361 D Unity   :  float sourceAspect = sourceHeight / sourceWidth;
    107. 06-07 15:18:47.979  7319  7361 D Unity   :  FLOAT2 scale = FLOAT2(1.0, sourceAspect / targetAspect);
    108. 06-07 15:18:47.979  7319  7361 D Unity   :  if (targetAspect < sourceAspect)
    109. 06-07 15:18:47.979  7319  7361 D Unity   :  {
    110. 06-07 15:18:47.979  7319  7361 D Unity   :   scale = FLOAT2(targetAspect / sourceAspect, 1.0);
    111. 06-07 15:18:47.979  7319  7361 D Unity   :  }
    112. 06-07 15:18:47.979  7319  7361 D Unity   :  return scale;
    113. 06-07 15:18:47.979  7319  7361 D Unity   : }
    114. 06-07 15:18:47.979  7319  7361 D Unity   : FLOAT4 OffsetAlphaPackingUV(FLOAT2 texelSize, FLOAT2 uv, bool flipVertical)
    115. 06-07 15:18:47.979  7319  7361 D Unity   : {
    116. 06-07 15:18:47.979  7319  7361 D Unity   :  FLOAT4 result = uv.xyxy;
    117. 06-07 15:18:47.979  7319  7361 D Unity   :  // We don't want bilinear interpolation to cause bleeding
    118. 06-07 15:18:47.979  7319  7361 D Unity   :  // when reading the pixels at the edge of the packed areas.
    119. 06-07 15:18:47.979  7319  7361 D Unity   :  // So we shift the UV's by a fraction of a pixel so the edges don't get sampled.
    120. 06-07 15:18:47.979  7319  7361 D Unity   : #if defined(ALPHAPACK_TOP_BOTTOM)
    121. 06-07 15:18:47.979  7319  7361 D Unity   :  float offset = texelSize.y * 1.5;
    122. 06-07 15:18:47.979  7319  7361 D Unity   :  result.y = lerp(0.0 + offset, 0.5 - offset, uv.y);
    123. 06-07 15:18:47.979  7319  7361 D Unity   :  result.w = result.y + 0.5;
    124. 06-07 15:18:47.979  7319  7361 D Unity   :  if (flipVertical)
    125. 06-07 15:18:47.979  7319  7361 D Unity   :  {
    126. 06-07 15:18:47.980  7319  7361 D Unity   :   // Flip vertically (and offset to put back in 0..1 range)
    127. 06-07 15:18:47.980  7319  7361 D Unity   :   result.yw = 1.0 - result.yw;
    128. 06-07 15:18:47.980  7319  7361 D Unity   :   result.yw = result.wy;
    129. 06-07 15:18:47.980  7319  7361 D Unity   :  }
    130. 06-07 15:18:47.980  7319  7361 D Unity   :  else
    131. 06-07 15:18:47.980  7319  7361 D Unity   :  {
    132. 06-07 15:18:47.980  7319  7361 D Unity   : #if !defined(UNITY_UV_STARTS_AT_TOP)
    133. 06-07 15:18:47.980  7319  7361 D Unity   :   // For opengl we flip
    134. 06-07 15:18:47.980  7319  7361 D Unity   :   result.yw = result.wy;
    135. 06-07 15:18:47.980  7319  7361 D Unity   : #endif
    136. 06-07 15:18:47.980  7319  7361 D Unity   :  }
    137. 06-07 15:18:47.980  7319  7361 D Unity   : #elif defined(ALPHAPACK_LEFT_RIGHT)
    138. 06-07 15:18:47.980  7319  7361 D Unity   :  float offset = texelSize.x * 1.5;
    139. 06-07 15:18:47.980  7319  7361 D Unity   :  result.x = lerp(0.0 + offset, 0.5 - offset, uv.x);
    140. 06-07 15:18:47.980  7319  7361 D Unity   :  result.z = result.x + 0.5;
    141. 06-07 15:18:47.980  7319  7361 D Unity   :  if (flipVertical)
    142. 06-07 15:18:47.980  7319  7361 D Unity   :  {
    143. 06-07 15:18:47.980  7319  7361 D Unity   :   // Flip vertically (and offset to put back in 0..1 range)
    144. 06-07 15:18:47.980  7319  7361 D Unity   :   result.yw = 1.0 - result.yw;
    145. 06-07 15:18:47.980  7319  7361 D Unity   :  }
    146. 06-07 15:18:47.980  7319  7361 D Unity   : #else
    147. 06-07 15:18:47.980  7319  7361 D Unity   :  if (flipVertical)
    148. 06-07 15:18:47.980  7319  7361 D Unity   :  {
    149. 06-07 15:18:47.980  7319  7361 D Unity   :   // Flip vertically (and offset to put back in 0..1 range)
    150. 06-07 15:18:47.980  7319  7361 D Unity   :   result.yw = 1.0 - result.yw;
    151. 06-07 15:18:47.980  7319  7361 D Unity   :  }
    152. 06-07 15:18:47.980  7319  7361 D Unity   : #endif
    153. 06-07 15:18:47.980  7319  7361 D Unity   :  return result;
    154. 06-07 15:18:47.980  7319  7361 D Unity   : }
    155. 06-07 15:18:47.980  7319  7361 D Unity   : // http://entropymine.com/imageworsener/srgbformula/
    156. 06-07 15:18:47.980  7319  7361 D Unity   : INLINE HALF3 GammaToLinear(HALF3 col)
    157. 06-07 15:18:47.980  7319  7361 D Unity   : {
    158. 06-07 15:18:47.980  7319  7361 D Unity   : // Forced cheap version
    159. 06-07 15:18:47.980  7319  7361 D Unity   : #if defined(CHEAP_GAMMATOLINEAR)
    160. 06-07 15:18:47.980  7319  7361 D Unity   : #if defined (SHADERLAB_GLSL)
    161. 06-07 15:18:47.980  7319  7361 D Unity   :  return pow(col, vec3(2.2, 2.2, 2.2));
    162. 06-07 15:18:47.980  7319  7361 D Unity   : #else
    163. 06-07 15:18:47.980  7319  7361 D Unity   :  // Approximate version from http://chilliant.blogspot.com.au/2012/08/srgb-approximations-for-hlsl.html?m=1
    164. 06-07 15:18:47.980  7319  7361 D Unity   :  return col * (col * (col * 0.305306011h + 0.682171111h) + 0.012522878h);
    165. 06-07 15:18:47.980  7319  7361 D Unity   : #endif
    166. 06-07 15:18:47.980  7319  7361 D Unity   : #else
    167. 06-07 15:18:47.980  7319  7361 D Unity   : #if SHADER_TARGET < 30
    168. 06-07 15:18:47.980  7319  7361 D Unity   : // Cheaper approximation
    169. 06-07 15:18:47.980  7319  7361 D Unity   : #if defined (SHADERLAB_GLSL)
    170. 06-07 15:18:47.980  7319  7361 D Unity   :  return col * (col * (col * 0.305306011 + 0.682171111) + 0.012522878);
    171. 06-07 15:18:47.980  7319  7361 D Unity   : #else
    172. 06-07 15:18:47.980  7319  7361 D Unity   :  return col * (col * (col * 0.305306011h + 0.682171111h) + 0.012522878h);
    173. 06-07 15:18:47.980  7319  7361 D Unity   : #endif
    174. 06-07 15:18:47.980  7319  7361 D Unity   : #else
    175. 06-07 15:18:47.980  7319  7361 D Unity   : // Accurate version
    176. 06-07 15:18:47.980  7319  7361 D Unity   :  if (col.r <= 0.04045)
    177. 06-07 15:18:47.980  7319  7361 D Unity   :   col.r = col.r / 12.92;
    178. 06-07 15:18:47.980  7319  7361 D Unity   :  else
    179. 06-07 15:18:47.980  7319  7361 D Unity   :   col.r = pow((col.r + 0.055) / 1.055, 2.4);
    180. 06-07 15:18:47.980  7319  7361 D Unity   :  if (col.g <= 0.04045)
    181. 06-07 15:18:47.980  7319  7361 D Unity   :   col.g = col.g / 12.92;
    182. 06-07 15:18:47.980  7319  7361 D Unity   :  else
    183. 06-07 15:18:47.980  7319  7361 D Unity   :   col.g = pow((col.g + 0.055) / 1.055, 2.4);
    184. 06-07 15:18:47.980  7319  7361 D Unity   :  if (col.b <= 0.04045)
    185. 06-07 15:18:47.980  7319  7361 D Unity   :   col.b = col.b / 12.92;
    186. 06-07 15:18:47.980  7319  7361 D Unity   :  else
    187. 06-07 15:18:47.980  7319  7361 D Unity   :   col.b = pow((col.b + 0.055) / 1.055, 2.4);
    188. 06-07 15:18:47.980  7319  7361 D Unity   : #endif
    189. 06-07 15:18:47.980  7319  7361 D Unity   : #endif
    190. 06-07 15:18:47.980  7319  7361 D Unity   :  return col;
    191. 06-07 15:18:47.980  7319  7361 D Unity   : }
    192. 06-07 15:18:47.980  7319  7361 D Unity   : INLINE HALF3 LinearToGamma(HALF3 col)
    193. 06-07 15:18:47.980  7319  7361 D Unity   : {
    194. 06-07 15:18:47.980  7319  7361 D Unity   : // Forced cheap version
    195. 06-07 15:18:47.980  7319  7361 D Unity   : #if defined(CHEAP_GAMMATOLINEAR)
    196. 06-07 15:18:47.980  7319  7361 D Unity   : #if defined (SHADERLAB_GLSL)
    197. 06-07 15:18:47.980  7319  7361 D Unity   :  return pow(col, vec3(1.0 / 2.2, 1.0 / 2.2, 1.0 / 2.2));
    198. 06-07 15:18:47.980  7319  7361 D Unity   : #else
    199. 06-07 15:18:47.980  7319  7361 D Unity   :  // Approximate version from http://chilliant.blogspot.com.au/2012/08/srgb-approximations-for-hlsl.html?m=1
    200. 06-07 15:18:47.980  7319  7361 D Unity   :  return max(1.055h * pow(col, 0.416666667h) - 0.055h, 0.0h);
    201. 06-07 15:18:47.980  7319  7361 D Unity   : #endif
    202. 06-07 15:18:47.980  7319  7361 D Unity   : #else
    203. 06-07 15:18:47.980  7319  7361 D Unity   : #if SHADER_TARGET < 30
    204. 06-07 15:18:47.980  7319  7361 D Unity   : // Cheaper approximation
    205. 06-07 15:18:47.980  7319  7361 D Unity   : #if defined (SHADERLAB_GLSL)
    206. 06-07 15:18:47.980  7319  7361 D Unity   :  return max(1.055 * pow(col, vec3(0.416666667, 0.416666667, 0.416666667)) - 0.055, 0.0);
    207. 06-07 15:18:47.980  7319  7361 D Unity   : #else
    208. 06-07 15:18:47.980  7319  7361 D Unity   :  return max(1.055h * pow(col, 0.416666667h) - 0.055h, 0.0h);
    209. 06-07 15:18:47.980  7319  7361 D Unity   : #endif
    210. 06-07 15:18:47.980  7319  7361 D Unity   : #else
    211. 06-07 15:18:47.980  7319  7361 D Unity   : // Accurate version
    212. 06-07 15:18:47.980  7319  7361 D Unity   :  if (col.r <= 0.0031308)
    213. 06-07 15:18:47.980  7319  7361 D Unity   :   col.r = col.r * 12.92;
    214. 06-07 15:18:47.980  7319  7361 D Unity   :  else
    215. 06-07 15:18:47.980  7319  7361 D Unity   :   col.r = 1.055 * pow(col.r, 0.4166667) - 0.055;
    216. 06-07 15:18:47.980  7319  7361 D Unity   :  if (col.g <= 0.0031308)
    217. 06-07 15:18:47.980  7319  7361 D Unity   :   col.g = col.g * 12.92;
    218. 06-07 15:18:47.980  7319  7361 D Unity   :  else
    219. 06-07 15:18:47.980  7319  7361 D Unity   :   col.g = 1.055 * pow(col.g, 0.4166667) - 0.055;
    220. 06-07 15:18:47.980  7319  7361 D Unity   :  if (col.b <= 0.0031308)
    221. 06-07 15:18:47.980  7319  7361 D Unity   :   col.b = col.b * 12.92;
    222. 06-07 15:18:47.980  7319  7361 D Unity   :  else
    223. 06-07 15:18:47.980  7319  7361 D Unity   :   col.b = 1.055 * pow(col.b, 0.4166667) - 0.055;
    224. 06-07 15:18:47.980  7319  7361 D Unity   : #endif
    225. 06-07 15:18:47.980  7319  7361 D Unity   : #endif
    226. 06-07 15:18:47.980  7319  7361 D Unity   :  return col;
    227. 06-07 15:18:47.980  7319  7361 D Unity   : }
    228. 06-07 15:18:47.980  7319  7361 D Unity   : INLINE FLOAT3 Convert420YpCbCr8ToRGB(FLOAT3 ypcbcr)
    229. 06-07 15:18:47.980  7319  7361 D Unity   : {
    230. 06-07 15:18:47.980  7319  7361 D Unity   : #if 1
    231. 06-07 15:18:47.980  7319  7361 D Unity   :  // Full range [0...255]
    232. 06-07 15:18:47.980  7319  7361 D Unity   :  FLOAT3X3 m = FLOAT3X3(
    233. 06-07 15:18:47.980  7319  7361 D Unity   :   1.0,  0.0,      1.402,
    234. 06-07 15:18:47.980  7319  7361 D Unity   :   1.0, -0.34414, -0.71414,
    235. 06-07 15:18:47.980  7319  7361 D Unity   :   1.0,  1.77200,  0.0
    236. 06-07 15:18:47.980  7319  7361 D Unity   :  );
    237. 06-07 15:18:47.980  7319  7361 D Unity   :  FLOAT3 o = FLOAT3(0.0, -0.5, -0.5);
    238. 06-07 15:18:47.980  7319  7361 D Unity   : #else
    239. 06-07 15:18:47.980  7319  7361 D Unity   :  // Video range [16...235]
    240. 06-07 15:18:47.980  7319  7361 D Unity   :  FLOAT3X3 m = FLOAT3X3(
    241. 06-07 15:18:47.980  7319  7361 D Unity   :   1.1643,  0.0,      1.5958,
    242. 06-07 15:18:47.980  7319  7361 D Unity   :   1.1643, -0.39173, -0.81290,
    243. 06-07 15:18:47.981  7319  7361 D Unity   :   1.1643,  2.017,    0.0
    244. 06-07 15:18:47.981  7319  7361 D Unity   :  );
    245. 06-07 15:18:47.981  7319  7361 D Unity   :  FLOAT3 o = FLOAT3(-0.0625, -0.5, -0.5);
    246. 06-07 15:18:47.981  7319  7361 D Unity   : #endif
    247. 06-07 15:18:47.981  7319  7361 D Unity   : #if defined(SHADERLAB_GLSL)
    248. 06-07 15:18:47.981  7319  7361 D Unity   :  return m * (ypcbcr + o);
    249. 06-07 15:18:47.981  7319  7361 D Unity   : #else
    250. 06-07 15:18:47.981  7319  7361 D Unity   :  return mul(m, ypcbcr + o);
    251. 06-07 15:18:47.981  7319  7361 D Unity   : #endif
    252. 06-07 15:18:47.981  7319  7361 D Unity   : }
    253. 06-07 15:18:47.981  7319  7361 D Unity   : #line 36
    254. 06-07 15:18:47.981  7319  7361 D Unity   :   out vec2 texVal;
    255. 06-07 15:18:47.981  7319  7361 D Unity   :   uniform vec3 _cameraPosition;
    256. 06-07 15:18:47.981  7319  7361 D Unity   :   uniform mat4 _ViewMatrix;
    257. 06-07 15:18:47.981  7319  7361 D Unity   :   uniform float _ForceLeft;
    258. 06-07 15:18:47.981  7319  7361 D Unity   : #if defined(STEREO_DEBUG)
    259. 06-07 15:18:47.981  7319  7361 D Unity   :   out vec4 tint;
    260. 06-07 15:18:47.981  7319  7361 D Unity   : #endif
    261. 06-07 15:18:47.981  7319  7361 D Unity   :    void main()
    262. 06-07 15:18:47.981  7319  7361 D Unity   :    {
    263. 06-07 15:18:47.981  7319  7361 D Unity   :     gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
    264. 06-07 15:18:47.981  7319  7361 D Unity   :     texVal = gl_MultiTexCoord0.xy;
    265. 06-07 15:18:47.981  7319  7361 D Unity   :     texVal = vec2(1.0, 1.0) - texVal;
    266. 06-07 15:18:47.981  7319  7361 D Unity   : #if defined(STEREO_TOP_BOTTOM) | defined(STEREO_LEFT_RIGHT)
    267. 06-07 15:18:47.981  7319  7361 D Unity   :     bool isLeftEye = (_ForceLeft || IsStereoEyeLeft(_cameraPosition, _ViewMatrix[0].xyz));
    268. 06-07 15:18:47.981  7319  7361 D Unity   :     vec4 scaleOffset = GetStereoScaleOffset(isLeftEye);
    269. 06-07 15:18:47.981  7319  7361 D Unity   :     texVal.xy *= scaleOffset.xy;
    270. 06-07 15:18:47.981  7319  7361 D Unity   :     texVal.xy += scaleOffset.zw;
    271. 06-07 15:18:47.981  7319  7361 D Unity   : #elif defined (STEREO_CUSTOM_UV)
    272. 06-07 15:18:47.981  7319  7361 D Unity   :     if (!(_ForceLeft || IsStereoEyeLeft(_cameraPosition, _ViewMatrix[0].xyz)))
    273. 06-07 15:18:47.981  7319  7361 D Unity   :     {
    274. 06-07 15:18:47.981  7319  7361 D Unity   :      texVal = gl_MultiTexCoord1.xy;
    275. 06-07 15:18:47.981  7319  7361 D Unity   :      texVal = vec2(1.0, 1.0) - texVal;
    276. 06-07 15:18:47.981  7319  7361 D Unity   :     }
    277. 06-07 15:18:47.981  7319  7361 D Unity   : #endif
    278. 06-07 15:18:47.981  7319  7361 D Unity   : #if defined(STEREO_DEBUG)
    279. 06-07 15:18:47.981  7319  7361 D Unity   :     tint = GetStereoDebugTint(_ForceLeft || IsStereoEyeLeft(_cameraPosition, _ViewMatrix[0].xyz));
    280. 06-07 15:18:47.981  7319  7361 D Unity   : #endif
    281. 06-07 15:18:47.981  7319  7361 D Unity   :             }
    282. 06-07 15:18:47.981  7319  7361 D Unity   : vertex shader
    283. 06-07 15:18:47.981  7319  7361 D Unity   : #version 300 es
    284. 06-07 15:18:47.981  7319  7361 D Unity   : #extension GL_OES_EGL_image_external : require
    285. 06-07 15:18:47.981  7319  7361 D Unity   : #extension GL_OES_EGL_image_external_essl3 : enable
    286. 06-07 15:18:47.981  7319  7361 D Unity   : #define UNITY_NO_DXT5nm 1
    287. 06-07 15:18:47.981  7319  7361 D Unity   : #define UNITY_NO_RGBM 1
    288. 06-07 15:18:47.981  7319  7361 D Unity   : #define UNITY_ENABLE_REFLECTION_BUFFERS 1
    289. 06-07 15:18:47.981  7319  7361 D Unity   : #define UNITY_FRAMEBUFFER_FETCH_AVAILABLE 1
    290. 06-07 15:18:47.981  7319  7361 D Unity   : #define UNITY_NO_SCREENSPACE_SHADOWS 1
    291. 06-07 15:18:47.981  7319  7361 D Unity   : #define UNITY_PBS_USE_BRDF2 1
    292. 06-07 15:18:47.981  7319  7361 D Unity   : #define SHADER_API_MOBILE 1
    293. 06-07 15:18:47.981  7319  7361 D Unity   : #define UNITY_HARDWARE_TIER2 1
    294. 06-07 15:18:47.981  7319  7361 D Unity   : #define UNITY_COLORSPACE_GAMMA 1
    295. 06-07 15:18:47.981  7319  7361 D Unity   : #define STEREO_CUSTOM_UV 1
    296. 06-07 15:18:47.981  7319  7361 D Unity   : #define STEREO_DEBUG 1
    297. 06-07 15:18:47.981  7319  7361 D Unity   : #ifndef SHADER_TARGET
    298. 06-07 15:18:47.981  7319  7361 D Unity   :     #define SHADER_TARGET 25
    299. 06-07 15:18:47.981  7319  7361 D Unity   : #endif
    300. 06-07 15:18:47.981  7319  7361 D Unity   : #ifndef SHADER_API_GLES3
    301. 06-07 15:18:47.981  7319  7361 D Unity   :     #define SHADER_API_GLES3 1
    302. 06-07 15:18:47.981  7319  7361 D Unity   : #endif
    303. 06-07 15:18:47.981  7319  7361 D Unity   : #line 1
    304. 06-07 15:18:47.981  7319  7361 D Unity   : #ifndef GLSL_SUPPORT_INCLUDED
    305. 06-07 15:18:47.981  7319  7361 D Unity   : #define GLSL_SUPPORT_INCLUDED
    306. 06-07 15:18:47.981  7319  7361 D Unity   : // Automatically included in raw GLSL (GLSLPROGRAM) shader snippets, to map from some of the legacy OpenGL
    307. 06-07 15:18:47.981  7319  7361 D Unity   : // variable names to uniform names used by Unity.
    308. 06-07 15:18:47.981  7319  7361 D Unity   : uniform mat4 unity_ObjectToWorld;
    309. 06-07 15:18:47.981  7319  7361 D Unity   : uniform mat4 unity_WorldToObject;
    310. 06-07 15:18:47.981  7319  7361 D Unity   : uniform mat4 unity_MatrixVP;
    311. 06-07 15:18:47.981  7319  7361 D Unity   : uniform mat4 unity_MatrixV;
    312. 06-07 15:18:47.981  7319  7361 D Unity   : uniform mat4 unity_MatrixInvV;
    313. 06-07 15:18:47.981  7319  7361 D Unity   : uniform mat4 glstate_matrix_projection;
    314. 06-07 15:18:47.981  7319  7361 D Unity   : #define gl_ModelViewProjectionMatrix        (unity_MatrixVP * unity_ObjectToWorld)
    315. 06-07 15:18:47.981  7319  7361 D Unity   : #define gl_ModelViewMatrix                  (unity_MatrixV * unity_ObjectToWorld)
    316. 06-07 15:18:47.981  7319  7361 D Unity   : #define gl_ModelViewMatrixTranspose         (transpose(unity_MatrixV * unity_ObjectToWorld))
    317. 06-07 15:18:47.981  7319  7361 D Unity   : #define gl_ModelViewMatrixInverseTranspose  (transpose(unity_WorldToObject * unity_MatrixInvV))
    318. 06-07 15:18:47.981  7319  7361 D Unity   : #define gl_NormalMatrix                     (transpose(mat3(unity_WorldToObject * unity_MatrixInvV)))
    319. 06-07 15:18:47.981  7319  7361 D Unity   : #define gl_ProjectionMatrix                 glstate_matrix_projection
    320. 06-07 15:18:47.981  7319  7361 D Unity   : #if __VERSION__ < 120
    321. 06-07 15:18:47.981  7319  7361 D Unity   : mat3 transpose(mat3 mtx)
    322. 06-07 15:18:47.981  7319  7361 D Unity   : {
    323. 06-07 15:18:47.981  7319  7361 D Unity   :     vec3 c0 = mtx[0];
    324. 06-07 15:18:47.981  7319  7361 D Unity   :     vec3 c1 = mtx[1];
    325. 06-07 15:18:47.981  7319  7361 D Unity   :     vec3 c2 = mtx[2];
    326. 06-07 15:18:47.981  7319  7361 D Unity   :     return mat3(
    327. 06-07 15:18:47.981  7319  7361 D Unity   :         vec3(c0.x, c1.x, c2.x),
    328. 06-07 15:18:47.981  7319  7361 D Unity   :         vec3(c0.y, c1.y, c2.y),
    329. 06-07 15:18:47.981  7319  7361 D Unity   :         vec3(c0.z, c1.z, c2.z)
    330. 06-07 15:18:47.981  7319  7361 D Unity   :     );
    331. 06-07 15:18:47.981  7319  7361 D Unity   : }
    332. 06-07 15:18:47.981  7319  7361 D Unity   : mat4 transpose(mat4 mtx)
    333. 06-07 15:18:47.981  7319  7361 D Unity   : {
    334. 06-07 15:18:47.981  7319  7361 D Unity   :     vec4 c0 = mtx[0];
    335. 06-07 15:18:47.981  7319  7361 D Unity   :     vec4 c1 = mtx[1];
    336. 06-07 15:18:47.981  7319  7361 D Unity   :     vec4 c2 = mtx[2];
    337. 06-07 15:18:47.981  7319  7361 D Unity   :     vec4 c3 = mtx[3];
    338. 06-07 15:18:47.981  7319  7361 D Unity   :     return mat4(
    339. 06-07 15:18:47.981  7319  7361 D Unity   :         vec4(c0.x, c1.x, c2.x, c3.x),
    340. 06-07 15:18:47.981  7319  7361 D Unity   :         vec4(c0.y, c1.y, c2.y, c3.y),
    341. 06-07 15:18:47.981  7319  7361 D Unity   :         vec4(c0.z, c1.z, c2.z, c3.z),
    342. 06-07 15:18:47.981  7319  7361 D Unity   :         vec4(c0.w, c1.w, c2.w, c3.w)
    343. 06-07 15:18:47.981  7319  7361 D Unity   :     );
    344. 06-07 15:18:47.981  7319  7361 D Unity   : }
    345. 06-07 15:18:47.981  7319  7361 D Unity   : #endif // __VERSION__ < 120
    346. 06-07 15:18:47.981  7319  7361 D Unity   : #endif // GLSL_SUPPORT_INCLUDED
    347. 06-07 15:18:47.981  7319  7361 D Unity   : #line 20
    348. 06-07 15:18:47.982  7319  7361 D Unity   : #line 19
    349. 06-07 15:18:47.982  7319  7361 D Unity   : #ifdef DUMMY_PREPROCESSOR_TO_WORK_AROUND_HLSL_COMPILER_LINE_HANDLING
    350. 06-07 15:18:47.982  7319  7361 D Unity   : #endif
    351. 06-07 15:18:47.982  7319  7361 D Unity   : #line 19
    352. 06-07 15:18:47.982  7319  7361 D Unity   : #ifdef DUMMY_PREPROCESSOR_TO_WORK_AROUND_HLSL_COMPILER_LINE_HANDLING
    353. 06-07 15:18:47.982  7319  7361 D Unity   : #endif
    354. 06-07 15:18:47.982  7319  7361 D Unity   : /* UNITY: Original start of shader */
    355. 06-07 15:18:47.982  7319  7361 D Unity   :                      // #pragma only_renderers gles gles3
    356. 06-07 15:18:47.982  7319  7361 D Unity   :                      // #pragma multi_compile MONOSCOPIC STEREO_TOP_BOTTOM STEREO_LEFT_RIGHT STEREO_CUSTOM_UV
    357. 06-07 15:18:47.982  7319  7361 D Unity   :                      // #pragma multi_compile __ STEREO_DEBUG
    358. 06-07 15:18:47.982  7319  7361 D Unity   :                      //// #pragma multi_compile __ GOOGLEVR
    359. 06-07 15:18:47.982  7319  7361 D Unity   :
    360. 06-07 15:18:47.982  7319  7361 D Unity   :
    361. 06-07 15:18:47.982  7319  7361 D Unity   :                      precision mediump float;
    362. 06-07 15:18:47.982  7319  7361 D Unity   :
    363. 06-07 15:18:47.982  7319  7361 D Unity   :
    364. 06-07 15:18:47.982  7319  7361 D Unity   :
    365. 06-07 15:18:47.982  7319  7361 D Unity   :
    366. 06-07 15:18:47.982  7319  7361 D Unity   : // default float precision for fragment shader is patched on runtime as some drivers have issues with highp
    367. 06-07 15:18:47.982  7319  7361 D Unity   : #define gl_FragColor _glesFragColor
    368. 06-07 15:18:47.982  7319  7361 D Unity   : layout(location = 0) out mediump vec4 _glesFragColor;
    369. 06-07 15:18:47.982  7319  7361 D Unity   :                      in vec2 texVal;
    370. 06-07 15:18:47.982  7319  7361 D Unity   : #if defined(STEREO_DEBUG)
    371. 06-07 15:18:47.982  7319  7361 D Unity   :                      in vec4 tint;
    372. 06-07 15:18:47.982  7319  7361 D Unity   : #endif
    373. 06-07 15:18:47.982  7319  7361 D Unity   :                      uniform samplerExternalOES _MainTex;
    374. 06-07 15:18:47.982  7319  7361 D Unity   :             void main()
    375. 06-07 15:18:47.982  7319  7361 D Unity   :             {
    376. 06-07 15:18:47.982  7319  7361 D Unity   : #if defined(SHADER_API_GLES) || defined(SHADER_API_GLES3)
    377. 06-07 15:18:47.982  7319  7361 D Unity   : #if __VERSION__ < 300
    378. 06-07 15:18:47.982  7319  7361 D Unity   :                              gl_FragColor = texture(_MainTex, texVal.xy);
    379. 06-07 15:18:47.982  7319  7361 D Unity   : #else
    380. 06-07 15:18:47.982  7319  7361 D Unity   :                              gl_FragColor = texture(_MainTex, texVal.xy);
    381. 06-07 15:18:47.982  7319  7361 D Unity   : #endif
    382. 06-07 15:18:47.983  7319  7361 D Unity   : #else
    383. 06-07 15:18:47.983  7319  7361 D Unity   :                              gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
    384. 06-07 15:18:47.983  7319  7361 D Unity   : #endif
    385. 06-07 15:18:47.983  7319  7361 D Unity   : #if defined(STEREO_DEBUG)
    386. 06-07 15:18:47.983  7319  7361 D Unity   :                              gl_FragColor *= tint;
    387. 06-07 15:18:47.983  7319  7361 D Unity   : #endif
    388. 06-07 15:18:47.983  7319  7361 D Unity   :                      }
    389. 06-07 15:18:47.983  7319  7361 D Unity   : fragment evaluation shader
    390. 06-07 15:18:48.050  7319  7339 I Unity   : [AVProVideo] Using playback path: MediaPlayer (2160x2160@30.00)
    391. 06-07 15:18:48.050  7319  7339 I Unity   :
    392. 06-07 15:18:48.050  7319  7339 I Unity   : (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    393. 06-07 15:18:48.050  7319  7339 I Unity   :
    394. 06-07 15:18:48.052  7319  7339 I Unity   : [AVProVideo] Texture ID: 75
    395. 06-07 15:18:48.052  7319  7339 I Unity   :
    396. 06-07 15:18:48.052  7319  7339 I Unity   : (Filename: ./artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    397. 06-07 15:18:48.052  7319  7339 I Unity   :
    398. 06-07 15:18:48.054  7319  7361 E Unity   : OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_ENUM: enum argument out of range
    399.  
     
    Last edited: Jun 7, 2017
  49. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,652
    Hi JohnGate,
    Can you not just rotate the UI element in the RectTransform? There is no way to force the orientation of the video - if it was recorded in portrait mode, then it will try to play in portrait mode and it will fit the rectangle of the UI element.
     
  50. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,652
    Well maybe if you're not getting compile errors, then it must be okay on that device. Unity report that the bug only affects certain devices. As to why its pink though - I'm not sure.... Currently I'm unable to compile these shaders with my test devices.
     
unityunity