Search Unity

[Released] AVPro Video - complete video playback solution

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

  1. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi Eric,

    For our WebGL implementation, we use the browsers' native video players, which I believe don't support HLS out of the box (with the exception of safari I believe, which does seem to support it).

    Kind Regards,
     
  2. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    Thanks for reporting this. Can you tell us the following:
    AVProVideo version, Unity version, Windows 10 exact version (eg. 1709). Additionally, how long does it take for the slowdown to occur? Also how frequently are you loading the videos?

    Also I believe CloseVideo is automatically called when a new video is loaded, so you don't actually need to do that (although it should make no real difference if you do).

    Kind Regards,
     
  3. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Thank you (as well as everyone else) for raising this issue. We are looking into this now, will update everyone when we have more information about this.

    Kind Regards,
     
  4. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    I think it was a windows update that added support for videos with stereo metadata. AVProVideo doesn't really handle this for MediaFoundation as we only get video for 1 eye. You will need to re-encode the video to have no stereo metadata for it to appear properly.

    Kind Regards,
     
  5. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    By "shader is transparent", do you mean you are using one of Unity's default shaders? If so, unpacking unfortunately won't work as it's something we do in our own shaders. What is the material being used for? If for UI, you could use something like the UI-Default-Transparent shader, whereas if you are mapping it to an object, you can try using something like the AVProVideo-Lit-Transparent-Diffuse shader.

    Kind Regards,
     
  6. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi Phil, as well as anyone else having this issue,

    It seems this is an issue with Unity 2017.3, where the dll is placed in the wrong directory. We have pushed a fix for this, but in the meantime you can resolve the dll not loading by putting the dll in the directory just under plugins (instead of in x86_64 etc.).

    Kind Regards,
     
    NGC6543 likes this.
  7. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    I assume you are the same person who emailed, we can continue this discussion there. To anyone else wondering, Android unfortunately only supports that range, but you can do a workaround by re-encoding the video at some speed first, before changing the playback rate in Unity.

    Kind Regards,
     
  8. Eric-Hackathorn

    Eric-Hackathorn

    Joined:
    Nov 22, 2013
    Posts:
    18
    Hmm... I must be confused how these things worked. I used the hls.js demo web site because I was under the impression that it uses the browser's native video player and it works fine with Chrome, Firefox, etc. Am I mistaken?
     
  9. jimprucey

    jimprucey

    Joined:
    Aug 12, 2012
    Posts:
    8
    Are there any in depth tutorials on this plugin?
     
  10. dj0002

    dj0002

    Joined:
    Dec 15, 2017
    Posts:
    8
    Hi SunriseRH,

    Something I just thought of: we're using a self-signed SSL certificate while we're still testing. When testing connecting with VLC I had to temporarily accept the non-trusted certificate. Is AVProVideo sensitive to things like this?

    I can't give you the URL unfortunately as it's a work server (and not public-facing most of the time).

    This is a Universal Windows Platform build. We're targeting the HoloLens

    Thanks.
     
    Last edited: Jan 15, 2018
  11. tengsibo

    tengsibo

    Joined:
    Jul 24, 2013
    Posts:
    7
    Hi,i want to play video in segment,for example determine one start frame count and end frame count,then play between these frames. when reach the end frame count,automatically stop playing.
    Any idea i can achieve this?
    Kind regards,
    Yorick
     
  12. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi Eric,

    Although hls.js uses the native browser's video player, it does a bunch of extra things such as parsing the m3u8 file, separating the video into readable chunks etc. We will probably look to add support for hls.js in the future, but HLS is unfortunately currently not supported unless the browser's video player directly supports it.

    Kind Regards,
     
  13. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    So I just tested this on my local server and an SSL authentication prompt appeared the first time round. Afterwards it just let me play (until I restarted Unity).

    Kind Regards,
     
  14. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi Yorick,

    AVProVideo unfortunately doesn't provide an inbuilt method of doing this, but what you can do is convert the start frame to time in ms, and then seek to that and play your video. Afterwards, just check if the video has passed the endpoint, and if it has, pause the video.

    Additionally, you may want to encode your video to have a small GOP size for more accurate and faster seeking.

    Kind Regards,
     
  15. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi Jim,

    So currently we only provide a bunch of example scenes, as well as the user docs. We are looking to create some tutorial videos this year however.

    Kind Regards,
     
  16. SystemDevel

    SystemDevel

    Joined:
    Oct 5, 2013
    Posts:
    36
    Hi, and Sorry.....

    after doing tests I saw that the error was very very silly ... I was not compiling the correct scene. :( :( :(

    Thanks
     
  17. Pedro-Garlaschi

    Pedro-Garlaschi

    Joined:
    Dec 6, 2012
    Posts:
    8
    Hi guys,

    I'm working in a project where i load and unload videos from a player and once in a while ( 1 in 5 in general ) the video get glitchy. it looks like the video is playing ( i've been taking the current time at the Update ) but not been displayed.
    Any help would supper appreciated
    Thanks


    IMG_0002.PNG
     
  18. dj0002

    dj0002

    Joined:
    Dec 15, 2017
    Posts:
    8
    Hi,

    I don't get any authentication prompts on my end. :(

    Are there any test servers on the internet anywhere that I could try connecting to to see which end of the connection is causing the problem?

    Can I request that AVPro's error messages be given more detailed information as to what went wrong? As it stands, "Codec not supported or video resolution too high or insufficient system resources" is a bit hard to debug, especially since I can't dig into the native code that actually returns the error code.
     
  19. Trivium_Dev

    Trivium_Dev

    Joined:
    Aug 1, 2017
    Posts:
    78
    Hi,

    I'm testing using the AVPro Video plugin to play videos on an iOS (iPads only) project. I use Unity's Cloud Build to build my projects since it's more convenient to distribute the builds when they are done (and lets me keep old builds if I ever need to fall back a version). However I can't seem to get Unity Cloud Build to work with the AVPro Video trial plugin. I want to make sure the plugin fixes an issue I can't seem to get around using Unity's built-in VideoPlayer component, but since I can't get the builds to work I can't test it. I tried creating a completely new project and importing the trial package, creating a basic scene that only has a MediaPlayer component and a Display uGui component, and a single video file in the streaming assets folder to play the video, and I still get the error. The error seems to occur after Unity builds the Xcode project, and once Xcode starts building the iOS build I get the following error: "
    clang: error: linker command failed with exit code 1 (use -v to see invocation)". I've Googled around but I can't seem to find a clear answer on how to fix this.

    I'm currently using 5.6.3p2 and the plugin says it is version 1.7.3t (scripts 1.7.4). In the Player/Build settings I have portrait mode only selected, .Net 2.0 (not the subset) api compatibility level, iPad Only target device, and all the other settings the default ones set by Unity when you switch to iOS builds.

    Thanks for you help!
     
  20. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Thanks for getting in touch.

    Could you please let us know more information. For example:

    1) Unity version
    2) AVPro Video version
    3) iPad model and iOS version
    4) Whether you're using the YCbCr option in the MediaPlayer iOS settings
    5) The codec, resolution, frame-rate and file size of your videos

    Thanks,
     
  21. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    In the cloud builds settings you should be able to change the XCode version it uses. Can you try changing it to see if that makes a difference?

    Thanks,
     
  22. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Ok so I just tested the https link in a clean unity project, and it doesn't show the auth request either... I'm not entirely sure what's causing the discrepancy between the two, will have to investigate a bit more.

    With regards to the load errors, you can add a listener to the mediaplayer to get a more specific errorcode. That being said, we are also often often unable to determine the exact error, as the errors from MediaFoundation aren't very descriptive either :(
     
  23. Trivium_Dev

    Trivium_Dev

    Joined:
    Aug 1, 2017
    Posts:
    78
    I tried setting it to XCode 9, 8.3, 8, and 7.3 but none of those worked. A outside developer that I've worked with that has AVPro Video was able to successfully build using the same settings I'm using and the same Unity version in Unity Cloud Build, except they have AVPro 1.7.3t with scripts 1.5.25 (they also have the full version and not the trial).
     
  24. huxley

    huxley

    Joined:
    Apr 27, 2009
    Posts:
    334
    We have recently encountered an issue with our AVPro Android install when trying to play SBS 3D videos under Daydream.

    When the video is loaded, there is a random jump between eyes, where only one perspective is shown at any time. The jump will toggle in 2D showing first the left view, then the right view. Sometimes the jump happens several times a second, but the frequency appears to be random.

    We have done tests using both the AVProVideo-VR-InsideSphere-AndroidOES shader and the AVProVideo-VR-InsideSphere shader, both with the same results.
     
  25. dj0002

    dj0002

    Joined:
    Dec 15, 2017
    Posts:
    8
    I'm glad you were able to reproduce it! Do let me know if you find the root cause :)
     
  26. wushuang212

    wushuang212

    Joined:
    Aug 11, 2012
    Posts:
    4
    I import AVproVidoe 1.7.4 unity package and have a try. There has a bug, when I play a video on a android emulator(Android api level is 4.2.2), sometimes it's ok, but sometimes there is only sound but no video. so what's the problem?
     
  27. 265lutab

    265lutab

    Joined:
    Sep 15, 2014
    Posts:
    155
    When I add AVPro to my UWP project for a Mixed Reality app the UI stops working in builds. I'm using the Virtual Reality Tool Kit (VRTK) in the project for UI interaction. It works in the editor, but when I make a build the UI will not highlight or select with the Mixed Reality controllers. I removed AVPro from my project and it started working again. Since the issue is only in the build I'm not sure how I would go about diagnosing what is causing the error.
     
    Last edited: Jan 19, 2018
    MarinWebTech likes this.
  28. IRobb

    IRobb

    Joined:
    Apr 29, 2014
    Posts:
    16
    Hi!

    We have bought your plugin a year ago through inoibérica company (for checking). I am trying to add a 360 video from youtube as an example (
    ) and google cardboard.

    I am using 2017.1.2p3 and cardboard 1.120 and your last version of avpro for android. I can't find a configuration for viewing this "two strip 360 video".

    Any help on which rotations or configuration do I need to apply to see it? Video is downloaded and save it in streaming assets not through youtube url.
     
    Last edited: Jan 20, 2018
  29. MarinWebTech

    MarinWebTech

    Joined:
    Sep 23, 2014
    Posts:
    3
    Are you using stereo camera setup using the correct camera rig (platform dependent)?? This type of VR does not require a video that is side-by-side, that is for videos that are not 360. The issue is a factor or two more complex.

    From this single source video, here's your answer:
    https://medium.freecodecamp.org/how-to-make-a-360-vr-app-with-unity-51cbe41ad8f1
     
    AndrewRH likes this.
  30. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Plugin version 1.7.3 with scripts 1.5.25 is very strange. Script v1.5.25 is ancient and they shouldn't be able to work together with the newer plugin. I'm not even sure how that's working :)

    Did you have any more luck with this?

    We did just find a bug in our support for Unity 5.6.x, that might be related. We're releasing a fix for it in the next update (1.7.5) which should be released in the next few days.

    Thanks,
     
  31. AndrewRH

    AndrewRH

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

    Could you give us more details, such as your Unity version, the version of AVPro Video plugin you're using etc?
    Are you using the UpdateStereoMaterial component in your scene? Could you send over screenshots or a video of the issue?

    There is a bug currently in the Android OES shader for stereo support, and the fix will be in the next version (1.7.5) which will be released in a few days.

    But if you're having this issue with the other shader then I suspect there is an issue with your setup. Please let me know about the above so we can help further.

    Thanks,
     
  32. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,
    Are you using ExoPlayer or MediaPlayer video API? Perhaps you could try both to see if it makes any difference? The option to select this is on the MediaPlayer component, under "Platform Specifc > Android" section.

    Also, in our experience the support for video playback in the emulator can be a bit unreliable...

    What are the specs of the video you're trying to play? (frame-rate, resolution, codec, file size)

    Thanks,
     
  33. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi!
    That sounds very strange...Is it possible for you to make the simplest project with VRTK and our plugin that exhibits this problem and send it to us? We're happy to take a look.

    Also, it would be useful to know the usual things like Unity version, AVPro Video version, your UWP build settings..etc

    Thanks,
     
  34. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hmm, I'm a bit confused, because that youtube video you posted isn't stereo...

    If you download a stereo video (either top-bottom or left-right), then you can use our 08_Demo_360SphereVideo sample scene. Just change the video file name in the MediaPlayer, and in the Visual section select the type of stereo packing. That's all you should need to do.

    Thanks,
     
  35. AndrewRH

    AndrewRH

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

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

    macOS
    • Fixed a build issue with Unity 2017.3 related to the post build script
    • Fixed a build issue with Unity 2017.3 related to universal/64-bit plugin metadata
    macOS, iOS and tvOS
    • Fixed a build issue with Unity 5.6.x related to a missing zlib dependency
    Android
    • Fixed stereo support in OES shader
    • Fixed support for IsBuffering state in ExoPlayer
    Windows desktop
    • Fixed a rare bug when using DirectShow and Unity 2017.3 that would cause the video texture to display as a single channel or black
    • Fixed a performance bug in the DirectShow player that meant a paused video would continue to upload frames to the GPU
    Thanks,
     
  36. matthew-sanders

    matthew-sanders

    Joined:
    Sep 25, 2015
    Posts:
    5
    Hi SunriseRH,
    In a related question to dj002 about SSL issues when self signed, is there any way for us to manage the protocol side of things and pass a stream into avpro?

    I see that the underlying windows media player has a method called OpenSourceFromStream which supports a IRandomAccessStream. If there was some way to pass in an IInputStream, or regular dotnet Stream then we could handle reading the data from a network (or wherever) and AvPro could just play the bytes.

    So in summary, is there a way to just feed bytes into an AVPro MediaPlayer?

    Thanks,
    Mat
     
  37. IRobb

    IRobb

    Joined:
    Apr 29, 2014
    Posts:
    16
    Its not 3D you're right. Sorry. What its confusing me is that after downloading it as others from youtube I get this type of video:

    upload_2018-1-22_11-32-25.png

    One screen with two areas. Superior area is not fully wrapped if using an sphere. It seems top area is horizontal and bottom area is vertical in a sphere.

    Thanks
     
  38. 265lutab

    265lutab

    Joined:
    Sep 15, 2014
    Posts:
    155
    I sent you a message with a link to download a simple version of the project.
     
    MarinWebTech likes this.
  39. New88th

    New88th

    Joined:
    Jun 20, 2017
    Posts:
    1
    Hi,

    We have existing unity app and we are trying to embed it into iOS framework. We were following recommendations from this article: https://github.com/blitzagency/ios-unity5, and adjusted build settings to be the same as in unity app when possible. But there are some linking issues regarding your plugin:
    Undefined symbols for architecture arm64:
    "_UnityEndCurrentMTLCommandEncoder", referenced from:
    _AVPPluginUnityRegisterRenderingPlugin in libAVProVideoiOS.a(AVProPlugin.o)
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    Meanwhile, the unity application itself works fine. Could you give us some guidance about this error?
    Unity2017.2.0f3

    Thanks
     
  40. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    227
    Hi!
    Is it possible to display a NDI source (ndi://...) via DirectShow (using NewTek's DirectShow Filters coming with their SDK)?
     
  41. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi Mat

    I unfortunately don't think the API we are using (MediaEngine) allows us to pass through an IInputStream. That being said however, you can also switch to DirectShow, which does allow you to pass through a byte buffer. It does need to be once off however (so you unfortunately can't stream the data in).

    Kind Regards,
     
  42. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    I don't believe AVProVideo would be capable of this as we read from a file source, that being said, if the ndi filter is registered as a video capture source, I believe AVPro Live Camera should be able to receive the video feed.

    Kind Regards,
     
  43. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    227
    Hey thanks! I will try Live Camera then.

    EDIT: does not work in Live Camera either.
    AVPro Video opens the url ("ndi://computername/sourcename?video=true") without error but does not display anything. :(
     
    Last edited: Jan 24, 2018
  44. huxley

    huxley

    Joined:
    Apr 27, 2009
    Posts:
    334
    Thanks for your quick response. It seems the issue was caused by someone scaling the Camera to 0,0,0 which the UpdateStereoMaterial was unable to separate eyes.
     
  45. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Out of curiosity, what category is the filter registered as? Also does LiveCamera pick it up?
     
  46. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    227
    From the NewTek NDI SDK Documentation:
    In WPF this works just by pointing the MediaElement's source to the URL (ndi://computername/source).

    The desired setup is: An application window (powerpoint for example) is captured and broadcast as NDI source. This already works. Now we have to to display a bunch of these sources in Unity. NDI was chosen to avoid the requirement of grabber cards (too expensive I guess).
     
    Last edited: Jan 25, 2018
  47. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Ah yea just had a look at this, LiveCamera doesn't pick it up as it's only registered in the DirectShow category. We don't list those as other filters such as video decoders and encoders etc. will be shown as well.
     
  48. AteoMarcel

    AteoMarcel

    Joined:
    Jan 5, 2017
    Posts:
    17
    We tried to add an 360 video with spatial sound to one of our project.
    We used an mkv video file with Opus Codec, however, we run into the problem that such video files couldn't be played at all.
    We always got the error "wrong codec or resolution to high...". We have mp4s with higher resolution (and longer) duration in our app which never run into that problem.

    We also tried a normal (not 360) mkv video (converted with the same software) and could run it without a problem.

    We use the newest version of your plugin and Unity 5.6.0p4. The app is for the GearVR. (And we have a minimum API Level of Android 5.1 or higher).
     
  49. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    Did you set your video API to ExoPlayer, enabled facebook audio 360, and set the channel mode to the channel mode in the video?

    Kind Regards
    Sunrise
     
  50. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    227
    I see, so it is just not listed but would possibly work in theory?