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
    Sorry for missing your post!
    Glad to hear you like the new OpenFileFromStream function and thanks for the compatibility tip.

    I'm not sure why you're having so many problems with the shader reporting as invalid. Which platform and device are you seeing these errors on, and which version of Unity? The InsideSphere Unlit shader has some options that make it require SM3.0 - so make sure you have support for that on your GPU.

    Changing the stereo property isn't supported at runtime for a video that is already playing. This is because the component don't check every frame for changes to these properties. If you're using the ApplyToMesh component then you can force it to update the shader once you have changed the stereo mode by dirtying one of it's fields. Eg:

    ApplyToMesh apply;

    // This will force the component to reapply all of the shader properties
    MeshPlayer mp = apply.Player;
    apply.Player = null;
    apply.Player = mp;

    This should be much faster than reloading the whole video.

    We're busy adding a 180 degree sample for the next release of the plugin.

    Thanks,
     
  2. IEOPC1

    IEOPC1

    Joined:
    Jan 31, 2017
    Posts:
    13
    Hello AndrewRH,

    Perhaps this was addressed in an earlier thread: I am unable to stream a video on my android phone using a url address. The cube that I am rendering to remains black. I am using the 360CubeVideo as a test I simply replaced to video from the streaming assets folder to a video online.

    Everything runs fine in the editor during play mode, the streaming video from the url renders fine on the cube in the editor; however, if a build and run the app on my android phone only the cube shows up, but no video. Network connection is fine. Can you or someone on this forum point me to a thread where this may have been addressed.

    Thanks.
     
  3. Adkaros

    Adkaros

    Joined:
    Dec 14, 2015
    Posts:
    16
    Andrew, another android question as well.

    I'm doing 360 4k video on Gear VR, Galaxy S6. It was working fine and all until I updated my phone I believe. Now I'm on Android 7.0 Nougat, have you experienced stuttering issues with this update? Was wondering if this is a common problem and if I need to roll back a version.

    When I disabled the video it wasn't stuttering anymore. Let me know your thoughts if possible.
     
  4. rkraig

    rkraig

    Joined:
    Dec 6, 2016
    Posts:
    6
    This error is plaguing our ios build. Works great in PC, Oculus, GearVR, GoogleVR builds, but ios it fails. Additionally it also fails when I run the application straight in the debugger on ios. What could be possibly causing this?
    Screen Shot 2017-06-08 at 11.34.14 PM.png
     
  5. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I'm not sure what the answer is. We'll be able to help you more if you can provide more information:

    Which version of AVPro Video are you using?
    What kind of video specs are you trying to play?
    What Android OS version are you running?
    Did you check the ADB log to see what error messages were produced by the Android OS?

    Thanks,
     
  6. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I'm not sure if it is a common problem, but I have seen the gyroscope become very slow after an upgrade from Android 6.0 to 7.0 on Galaxy 6.0 device.

    Is the actual video playback stuttering, or just the movement of the sphere rotation based on the gyroscope?
    Are you using the latest version of AVPro Video? Perhaps you could tell us if you're able to reproduce it with one of our sample scenes and sample videos?

    Thanks,
     
  7. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    As the error message says, possibly the format of the video or the device is out of resources.

    H.265 / HEVC is not yet supported by iOS (only coming in iOS 11) What are your video specs?

    It could also be a memory issue - which device are you testing on and how much RAM does it have?
    Are you using the latest version of AVPro Video? If you suspect it is a memory issue, have you tried enabling the YCbCr option in the iOS section of the MediaPlayer?

    Thanks,
     
  8. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,941
    rotations distrub the ui elements alignment.




    Another problem is im getting insuffienct memory error on android when i keep setting new videso to load url. I have 100s of mp4 vidoes online, so i assign the link and it plays, user press next button and next one plays and eventually it stars to complain. what should i do?
     
  9. rkraig

    rkraig

    Joined:
    Dec 6, 2016
    Posts:
    6
    Using Android works fine, non-issue. iOS is the big issue. So I used Ipod Touch 6th Gen, Additionally tested it "normally" in the "run" app mod, and it reported the same issue, I saw this happen once on windows because a soundcard refused to play some audio codec or something, once unhooked built in sound worked fine.

    Also version of Unity is 2017.1.0b6, we are using this because one of our plugins we have I believe something to do with googlevr broke on us when we needed an update for something else, we ran into some issues making a googlevr build with 5.6.0, so we upgraded to 5.6.1 and that didn't work, we then used beta and that fixed our issue, but then AVPro stopped working, but this only exists in ios platform.
     
  10. rkraig

    rkraig

    Joined:
    Dec 6, 2016
    Posts:
    6
    Not currently using H.265 or HEVC, and we still get the:
    [AVProVideo] Error: Loading failed. Codec not supported or video resolution too high or insufficient system resources from streaming H.264 over HLS.
     
  11. prisonerjohn

    prisonerjohn

    Joined:
    Jul 31, 2013
    Posts:
    28
    Hello,

    I'm trying to play a video from an OBB file on Android and I'm seeing a weird issue. The path generated is different depending on the build.

    This URL works:
    [AVProVideo] Opening jar:file:///storage/emulated/0/Android/obb/com.whatever.MyApp/main.17.com.whatever.MyApp.obb!/assets/MyMovie.mp4

    This URL does not:
    [AVProVideo] Opening jar:file:///data/app/com.whatever.MyApp-1/base.apk!/assets/MyMovie.mp4

    I'm not actually setting these, I just ask for the MyMovie.mp4 from StreamingAssets and this is the log from AVPro Video.

    The working version APK is generated using Unity's internal system, and the non-working version is using the new Gradle build method. I need to use Gradle because Unity's internal system injects unwanted permissions to the manifest, and I'm trying to avoid that.

    Any idea what could be causing the difference? Is it possible to get this working using a Gradle build?

    Thanks!
     
  12. rkraig

    rkraig

    Joined:
    Dec 6, 2016
    Posts:
    6
    As you can see, VLC shows this is an mpeg-4 file using aac encoding. completely playable. Android has no such issue playing, but below, it just says "codec not supported or video resolution too high", I suspect the error may be something entirely different, but the AVPro compiled logic may be masking something we can't be entirely sure about. It's just a generic message sent. I'm able to play "static" files without issue, but HLS streamed files are a problem, also noticed that RTMP streams didn't work either, but that is normal I believe for ios. I'm not 100% sure..
    Screen Shot 2017-06-11 at 9.59.08 PM.png
     
  13. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    We have a fix for this Android issue coming up in the next version (out this week)

    Thanks,
     
    matthewninja and jGate99 like this.
  14. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,
    We see a couple of potential issues.

    First of all, your path has a colon ":" character in it, which isn't URL safe, so you'll probably want to escape that character. Next, Apple doesn't allow HTTP unless you allow it explicitly in the Player Settings under "Allow downloads over HTTP).

    I hope that helps. Thanks,
     
  15. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,
    We've had many problems with OBB in the past with Unity. It seems like the solution is:
    1) Use Unity 5.6.0 or above
    2) When you build, never build over the old file, always build to a new APK
    3) Also when building it's a good idea to change the bundle ID number.

    For some reason if you don't do these steps, then Unity can return Application.StreamingAssetsPath as a path of the APK file, instead of the OBB file...

    I hope that helps.
     
  16. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    Hi
    Trying to simply load a video file by passing the path to the OpenVideoFromFile method in the MediaPlayer.cs class.

    This is my calling method in another class
    Code (csharp):
    1.  
    2. private IEnumerator OutputRoutine(string url) {
    3. Debug.Log("URL: " + url);
    4. MediaPlayer.FileLocation location= mPlayer.m_VideoLocation;
    5. bool loader = mPlayer.OpenVideoFromFile(location,url,true);
    6. yield return loader;
    7. }
    8.  
    and this is the OpenVideoFromFile method in MediaPlayer.cs
    Code (csharp):
    1.  
    2. public bool OpenVideoFromFile(FileLocation location, string path, bool autoPlay = true)
    3.         {
    4.             m_VideoLocation = location;
    5.             m_VideoPath = path;
    6.             m_AutoStart = autoPlay;
    7.          if (m_Control == null)
    8.             {
    9.                 Initialise();
    10.             }
    11.             return OpenVideoFromFile();
    12.         }
    13.  
    but get 2 errors

    Player 95: failed to load value for key "playable", error: The requested URL was not found on this server.
    UnityEngine.Debug:LogError(Object)
    RenderHeads.Media.AVProVideo_OSXMediaPlayer:DebugLogCallback(Int32, Int32, String) (at Assets/StandardAssets/AVProVideo/Scripts/Internal/OSXMediaPlayer.cs:233)

    and

    [AVProVideo] Error: Loading failed. Codec not supported or video resolution too high or insufficient system resources.
    UnityEngine.Debug:LogError(Object)
    RenderHeads.Media.AVProVideo.MediaPlayer:UpdateErrors() (at Assets/StandardAssets/AVProVideo/Scripts/Components/MediaPlayer.cs:1373)
    RenderHeads.Media.AVProVideo.MediaPlayer:Update() (at Assets/StandardAssets/AVProVideo/Scripts/Components/MediaPlayer.cs:838)
     
  17. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,
    Are you trying to load from a HTTP URL? Apple doesn't allow this by default and really wants people to use HTTPS. If you are unable to use HTTPS, then if you are deplying to iOS there is an option you can enable in Player Settings called "Allow downloads over HTTP". If you are deploying on MacOS then it requires editing your plist file. Please see page 13 of our PDF documentation were we go into more detail about this. Thanks,
     
  18. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    Thanks Andrew
    I should clarify. Am trying to load only from the desktop. I figured out that my issue was pathing. I was passing in the absolute path to the OpenVideoFromFile method and not just the name of the file.
     
  19. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Does this mean you've solved it now? If not, please show an example of that path you're using, and check that the FileLocation is set to AbsolutePathOrURL.

    Thanks,
     
  20. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    Thanks, yes solved
     
  21. Selaphiel

    Selaphiel

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

    Can i know whats the max resolution of video supported on android, through this plugin ?
     
  22. obviousjim

    obviousjim

    Joined:
    Oct 11, 2009
    Posts:
    29
    Hi Andrew,

    Love this plug in! Thanks so much for your amazing effort.

    We've run into a problem with the "Use Unity Audio" feature to route to VR headsets (namely the Rift). We are running in a project where we are also using Two Big Ears for spatial sound tracks. Our TBE tracks were rendered out at 44.1khz so we need to force Unity's audio to 44100 in the audio settings for them to be effectively routed to 44.1khz

    This setting causes all AVPro media with audio routed through Unity to play as if they are slowed down, making voices sound deeper and the audio to lag behind the video. Forcing 48khz in unity audio makes it sound fine, but of course breaks the TBE.

    The audio on the video is also 44.1khz, so it seems somewhere in AVPro AudioOutput there is an assumption of 48khz.

    Also FWIW the audio routing works fine using Unity's native video player.

    Thanks for looking into this, let me know if I'm missing something!
     
  23. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    It depends on the hardware. Samsung Galaxy S6 and S7 support up to 3840x2160@30 in our tests. I think technically it may support higher (like 4096x2048), but we haven't had stable results with this. Newer phones such as S8 and Pixel I'm not sure of. The H.264 spec itself doesn't go higher than 4096x2304. I think in general though once you go over 3840x2160, H.265 is better supported as it supports higher resolutions than H.264.

    Thanks,
     
  24. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Glad you like the plugin :)
    We didn't see that it was possible to change the audio sample rate in Unity. We will add support for this in the next release (1.6.12).
    Thanks,
     
  25. AndrewRH

    AndrewRH

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

    AVPro Video version 1.6.10 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

    • Improved support for iOS 8.0 by fixing an issue with CoreVideo
    Android
    • Fixed issue where loading over 255 videos would cause videos to no longer load correctly
    Windows Desktop / UWP
    • The AudioOutput component now supports routing audio to a specific channel, or to multiple channels. It also now supports multiple instances so you can more easily have audio coming from different world positions.
    • Fixed a memory leak when using AudioOutput component
    Windows Desktop
    • Added new function to load media from memory for DirectShow API. This is demonstrated in the scriptlet LoadFromBuffer.cs
    General
    • Started adding a new 180 degree video playback demo, it just lacks a media file which will come in the next release.
    • Videos with auto-start enabled no longer fire the ReadyToPlay event.
    • Added new method ForceUpdate() to ApplyToMesh component which refreshes the material when changing media properties such as stereo packing.

    Thanks,
     
  26. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Has anyone tried building in the latest Xcode beta? I am getting linker issues.
     
  27. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Our Apple programmer Morris says that he's tried Xcode9-beta and it builds Unity projects with AVPro Video fine for him...
     
  28. phileday

    phileday

    Joined:
    Feb 8, 2014
    Posts:
    121
    Hi

    I've got a problem when using the media foundation, audio output and then switching to Directshow. I get the error message.

    OverflowException: Number overflow.
    RenderHeads.Media.AVProVideo.AudioOutputManager.RequestAudio (RenderHeads.Media.AVProVideo.AudioOutput _outputComponent, RenderHeads.Media.AVProVideo.MediaPlayer mediaPlayer, System.Single[] data, Int32 channelMask, Int32 totalChannels, AudioOutputMode audioOutputMode) (at Assets/Standard Assets/ScriptsAVProVideo/Internal/AudioOutputManager.cs:62)
    RenderHeads.Media.AVProVideo.AudioOutput.OnAudioFilterRead (System.Single[] data, Int32 channels) (at Assets/Standard Assets/ScriptsAVProVideo/Components/AudioOutput.cs:116)

    This is on the audio output object. I'm going to disable that object when using directshow which I think will fix it but I thought I would mention it as it's a change to the previous version of the plugin.

    Out of interest are you still considering adding Unity Audio output to directshow?

    All the best and great work.

    Phil
     
  29. Gounemond

    Gounemond

    Joined:
    Nov 17, 2012
    Posts:
    6
    Hello there Andrew!

    I've tried to play on Oculus Video app (on GearVR, Samsung S7) a stereo 360° video 4096 * 4096, H265 9-12 bitrate, and it worked perfectly.

    I thought that I could easily replicate this on AVPro, but unfortunately I can only hear the audio. I tried using both Unity 5.5.3f with OES enabled and Unity 5.6 without.
    I tested this using directly the demo scene for 360Sphere video.

    Video was playing through the StreamingAsset folder and through a specific location on device(700MB video)

    Am I missing something or what I'm trying to do is completely unfeasible, even though I saw it working on the Oculus Video app?

    Thank you in advance!
     
  30. vrshow

    vrshow

    Joined:
    May 27, 2017
    Posts:
    1
    Hello!

    I have some TopButtom 360 video, When i use “Media Foundation”,it output one side frames.if switch to "Direct show" and install LAV Filters,some stereo video that resoluton is 1440x1440 is play blackscreen, the Debug Gui display the resolution is 1440x480,But when install k-lite,all video is play properly.
    My Unity3D is 5.6.1,AVPro is 1.6.10.Forgive my English is very poor.
     
  31. thedreamvr

    thedreamvr

    Joined:
    May 23, 2017
    Posts:
    1
    I recently bought this plugin but I do not know if it supports multibitrate. The video(HLS 3-14 bitrate) is always viewed with the same resolution. Does multibitrate support?
     
  32. gnp89

    gnp89

    Joined:
    Jun 25, 2012
    Posts:
    36
    Hi guys! I'm using this asset for Android and iOS and it's awesome!

    I'm having a small issue with seeking and would like to know if there's a solution for this.

    I implemented a timeline that the user can scroll. So when the user stops scrolling I calculate the ms and seek to that point in time.
    When I "Play()" the player jumps back, and this doesn't look nice in the timeline.
    I read that the Seek accuracy might not be perfect and it depends on the video file. That's ok. My question is, is there a way to get the time where the player will start when I send the Play command?

    For example:
    I seek to ms 5200.
    If I check Control.GetCurrentMs() it returns 5200.
    When I Play it jumps back and starts from 4800.

    Is there a way I can get that 4800 before I start playing?
     
  33. ATMEthan

    ATMEthan

    Joined:
    Dec 27, 2012
    Posts:
    54
    Hello all,

    Maybe someone here can help me. I'm using this plugin with iOS and an iPhone 6. I'm having trouble with a simple scene and loading/unloading videos. I have three buttons and they, when clicked, will load or unload 3 different videos. I can load and unload two videos pretty cleanly as long as I give the application time to close the video. Rapid clicking causes the application to crash. If I slowly play all 3 videos the application crashes when I play the 3rd/last video. These videos are pretty light too, they run for about 15 seconds and are roughly 10 MBs on disk. From what I can tell this isn't a issue with running of out memory. Does anyone have any ideas why my application might be crashing? The same application on Android has no issues from what I've experienced.

    Edit Addition: I believe this is a memory leak. Having an empty scene and just spam clicking the buttons eventually results in the application crashing. Using the xCode Instruments it definitely looks like a memory leak or maybe a reference/instance isn't being freed up. I can see the "# Persistent" column climb in the Allocations tools. Nothing is reported in the "Leaks" tool but I suspect that is b/c its happening in the AVPro iOS library which might be causing the instrument to not accurately report it. Can alone else confirm this?

    Side question, is there a place I can download older versions of AVPro Video? I had a thought maybe a bug(introducted in this version) on AVPro's side is causing this issue.
    Edit: I got version 1.5.25 from a co-worker. Same thing happens.

    -Ethan

    Please let me know if there's any additional information needed that will help.

    Here are some technical details:
    Unity 5.6.0f3
    AVPro Video 1.6.10
    iPhone 6(MG472LL/A)
    iOS 10.3.2 (14F89)
    xCode 8.3.3

    Here's an example of my code that handles the loading / unloading. ToggleVideo() is called when clicked.

    public MediaPlayer player1;
    void Start()
    {
    player1.Events.AddListener(OnVideoEvent);
    }
    void OnDestroy()
    {
    player1.Events.RemoveAllListeners();
    }
    public void OnVideoEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode)
    {
    switch (et)
    {
    case MediaPlayerEvent.EventType.FinishedPlaying:
    player1.CloseVideo();
    break;
    }
    }
    public void ToggleVideo()
    {
    if (!player1.VideoOpened)
    {
    player1.OpenVideoFromFile (player1.m_VideoLocation, player1.m_VideoPath, true);
    }
    else
    {
    player1.CloseVideo ();
    }
    }
     
    Last edited: Jun 19, 2017
  34. Unity_vvs

    Unity_vvs

    Joined:
    Jun 19, 2017
    Posts:
    1
    Dev'ing on Mac but licensed for the Windows version (where we will be deploying).. Do this often without issue other than you see watermark as expected while Mac dev'ing. This time, our video plays fine if dev'ing in Windows, however on Mac it plays at hyper-speed? Any idea what could be causing this? This video is encoded at 30FPS where we usually use 60, but Windows has no issues with it.

    Thanks!
     
  35. ymntst

    ymntst

    Joined:
    Jun 9, 2017
    Posts:
    2
    Hello;
    I am trying to load Video from Asset Bundle, but I couldnt do that becouse the "OpenVideoFromFile" function eaquiers a String Type parameter to vedio path. Would you please help me solv this issue.
    Thanks in Advance.
     
  36. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Posts:
    102
    Hi,

    I'm trying to convert the "AVProVideo/Unlit/Opaque (texture+color+fog+stereo support)" shader to also support transparency but not much luck there.

    I would like to fade up a Stereo image. Would it be possible to provide such a shader in a future release?
    Thanks!
     
  37. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Hi Phil,

    Thanks for reporting this error. We are considering adding it and it is on our list, but there is no immediate plan for it.

    Some questions to help us resolve this issue:
    Are you using version 1.6.10 of the plugin?
    Does this error happen when using DirectShow?

    Thanks,
     
  38. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes, I'm not sure how the Oculus software plays such high videos back. We are using Androids mediaplayer system and it says that high resolution isn't supported... Maybe they're using special Samsung tricks...
    I'm afraid the only option when using AVPro Video is to resize it. Oculus themselves recommend a maximum of 3840x1920@30. Thanks,
     
  39. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I think this is caused by the video being encoded with 3D stereo metadata. AVPro Video doesn't support such videos, so this metadata would need to be stripped out. Please see our PDF documentation for steps to do this.
    Thanks,
     
  40. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,
    Yes adaptive streaming is supported. It will change bitrate based on the network quality. There are different flavours of HLS though, so perhaps the version of HLS you're using isn't totally supported on your platform. Perhaps you could try with other HLS test streams to see if it works. Feel free to send us your URL and platform details if you're still having problems.
    Thanks,
     
  41. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi, which platform is this happening on?
    There are two types of seek functions: Seek() and SeekFast(). SeekFast() should just seek to the nearest keyframe, while Seek() will try to seek to the accurate position, but may take longer to complete. On some platforms only inaccurate seeking is possible so both functions to do the same thing. You could try using SeekFast() to see if that helps.
    Otherwise you could try setting your video to Play() and then Seek() and then Pause() immediately - I haven't tried it but it might work.
    Adding more keyframes to your video will increase the accuracy of the seek. Another option would be to calculate the time yourself, and this would require knowing the key-frame rate for the encoding.

    I hope that helps you.
    Thanks,
     
  42. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,
    Thanks for reporting this. Our iOS guru tested this but wasn't able to find any problems / leaks. He was testing in Unity 5.5 though. Unity 5.6.0 is very new and these versions often contain bugs. I recommend either testing in 5.5.4, or in 5.6.2. He also said that the only leaking he get was when the Unity profiler fails to keep up and the app started caching all the recorded data.
    Let me know if you have any more information on this - we're keen to fix it if it is a real issue, but so far we're unable to replicate it.
    Thanks,
     
  43. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,
    This isn't something we have heard of before. Perhaps you could send us a copy of the video for testing? Also let us know about your testing environment, Unity version, AVPro Video version.
    Thanks,
     
  44. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi, sorry but loading from Asset Bundle is not supported. An alternative option is to download the video to a temporary location and then load it from there. If you're trying to hide the video and your target platform is Android, then you can see in the Android options we have a file offset option which lets you hide your video within another file. Thanks,
     
  45. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hmm it should be possible! You can take a look at this shader:
    "AVProVideo/Unlit/Transparent (texture+color+fog+packed alpha)" as a reference. Basically you would need to add:

    ZWrite Off
    Blend SrcAlpha OneMinusSrcAlpha
    Lighting Off

    to your SubShader, and also optionally:

    ZTest Always

    then change the Tag property to:

    Tags { "RenderType"="Transparent" "IgnoreProjector"="True" "Queue"="Transparent" }

    then make sure your Properties has a colour field:

    _Color("Main Color", Color) = (1,1,1,1)

    add the corresponding _Color uniform variable to your shader:

    uniform fixed4 _Color;

    then at the end of the fragment shader multiply by the _Color:

    return col * _Color;

    Now you should be able to control the alpha value of your material _Color property and make your stereo material fade.

    I hope that helps!
     
  46. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Posts:
    102
    Thanks Andrew!
    Last piece of the puzzle where i got stuck was this:
    Change: return fixed4(col.rgb, 1.0);
    To: return col;

    Attached the result should other people need it.
     

    Attached Files:

  47. infoatm

    infoatm

    Joined:
    Mar 20, 2015
    Posts:
    1
    Unfortunately I cannot use 5.5. for this project b/c I need to use the Google Cardboard SDK which only supports 5.6 and above. I can run a test though on my spare time to see if its present in Unity5.5.0 and Unity5.6.2. We resorted to using Sprite Animations instead of videos b/c we are pressed for time but I'll still like to see this resolved so I'll continue to help.

    Err.... same as ATMEthan just signed in under different account.
     
  48. joelbeloUnloop

    joelbeloUnloop

    Joined:
    Jun 1, 2017
    Posts:
    3
    Hi!
    I'm using AVPro Video to show some transparent videos in AR using Vuforia camera on background.
    I tested in some android phones and it works, but in my Galaxy S7 the video only plays audio.

    Why in some devices the video works fine but in some it only plays the audio and not image.?
    Thanks!
     
  49. phileday

    phileday

    Joined:
    Feb 8, 2014
    Posts:
    121
    Hi

    Yes it does. It actually only started happening when using 1.6.10.

    When switching to directshow and using the unity audio source output.

    I've got a solution for this which I'm already implementing so it's not something that is worrying me, it's just something I thought would be good to report.

    I have found another issue when using DirectShow. The mute tickbox doesn't work. The sound just stays playing. I'm using the volume as a separate value so it would be able able to mute with the tickbox. This does work in Media foundation.

    All the best

    Phil
     
  50. joelbeloUnloop

    joelbeloUnloop

    Joined:
    Jun 1, 2017
    Posts:
    3
    HELP!
    Video only plays audio on some android devices!