Search Unity

[Released] AVPro Video - complete video playback solution

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

  1. zyzyx

    zyzyx

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

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    It doesn't work right now, but yea I think it might be possible, but we would need to test it to be sure
     
    zyzyx likes this.
  3. AteoMarcel

    AteoMarcel

    Joined:
    Jan 5, 2017
    Posts:
    17
    Hi thank you for your answer.

    We used ExoPlayer and enabled facebook audio.
    It just was the case that we used the wrong channel encoding.
    (In our audio program the options were called completely different so we were unsure which one was the correct).

    We can now play the video, however, sometimes when we stop the video do something between and then load the video again and play it we have no sound anymore.

    This bug appears especially if we put the gearVR away and picked it up again (without leaving or restarting the app).

    (We load the video from a folder on the phone its not inside Unity).

    Do you happen to know why this might happen?

    All the best

    Marcel
     
    Last edited: Jan 26, 2018
  4. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    This shouldn't happen, but I will do some testing and get to you on this
     
  5. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    222
    I hope you find some time to look into it. Would be great if this was supported at some point in the future.
     
  6. Covfefeh

    Covfefeh

    Joined:
    Jan 14, 2018
    Posts:
    6
    Hi,

    I'm working on a VR project that combines multiple videos and animated 3D objects. I would love to be able to "scrub" through a timeline, so that I could keyframe to specific video frames. Will AVPro work with the Playables API / Timeline feature?
     
  7. LostPanda

    LostPanda

    Joined:
    Apr 5, 2013
    Posts:
    129
    @SunriseRH can your support play sequence images function in avpro video? thanks
     
  8. Wimouss21

    Wimouss21

    Joined:
    Aug 11, 2016
    Posts:
    3
    Hi @SunriseRH !

    I have been testing your plugin and it seems like you are "guessing" the video type.
    This doesn't work all the time (eg in Exoplayer using inferContentType: https://github.com/google/ExoPlayer/issues/2513 )

    I would like to know if you are provided an overload of OpenVideoFromFile() where I can specify the video type directly?

    eg:
    Code (CSharp):
    1.  
    2. string url = "https://host.com/s/HBCHDC/SdusdjiIJ?mbr=true&manifest=m3u&assetTypes=Video";
    3. // for an HLS stream
    4. OpenVideoFromFile(MediaPlayer.FileLocation.AbsolutePathOrURL, url, MediaPlayer.FileType.HLS);
    5. // or for DASH
    6. OpenVideoFromFile(MediaPlayer.FileLocation.AbsolutePathOrURL, url, MediaPlayer.FileType.DASH);

    Also I've found a bug on ApplyToMesh, on iOS when YCbCr optimization is enabled, only the Red channel of the video is render (no blue, nor green). The solution is easy, just disable YCbCr option.
     
    Last edited: Jan 28, 2018
  9. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    Do you mean loading a set of images and playing them as a video? If so then this is unfortunately not possible.

    Kind Regards
    Sunrise
     
  10. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    Thanks for that link. It is something that we can look into, although we would need to figure out a way how to make it more general first as this is a very exoplayer specific thing. But yea you are correct in that we are currently using the exoplayer inference for media type.

    With regards to the iOS issue, are you using your own shader?

    Kind Regards,
     
  11. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    Scrubbing accuracy is dependent on platform. Generally for more accurate and faster seeking, you want to encode your videos with a GOP size of 1. Furthermore, certain platforms such as Android MediaPlayer on older android phones is keyframe accurate (as opposed to frame accurate). Seeking is also quite an expensive operation, especially on mobile phones, so you should just take that into account.

    With regards to timeline integration, we do not currently support this, and you will need to implement your own bridge between the two systems.

    Kind Regards,
     
  12. T-Pozantzis

    T-Pozantzis

    Joined:
    Dec 12, 2012
    Posts:
    3
    Thanks for the reply. I did figure it out in the end :)
     
  13. Jotesting

    Jotesting

    Joined:
    Jul 24, 2012
    Posts:
    5
    Hey,

    thanks for the great plugin. We are streaming videos on iOS and its working great. But when we have a bad internet connect like 3G then sometimes the video doesnt play but we only hear the sound of the video. Any idea how to solve it?

    Thanks
     
  14. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    725
    @AndrewRH have you thought of using *.asmdef files for your scripts?

    I'm using it on my project and if I reference any of your scripts I have compilation errors because your scripts are not in an assembly.

    I have test it and you only need to create two *.asmdef files:

    - Assets/AVProVideo/Scripts (set to Any platform).
    - Assets/AVProVideo/Scripts/Editor (set to Editor only and reference previous *.asmdef file).

    It only works on 2017.3+ but on older versions it's harmless because Unity doesn't recognize that file types so you could create them without any breaking changes.
     
    shoo likes this.
  15. dj0002

    dj0002

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

    I notice that AVPro automatically pauses video playback when the application is suspended, and plays when resumed. We're streaming real-time from a video server, so when we resume our app it plays back all buffered video since the app was suspended. Is there any way to discard the video buffer when the app is resumed, or otherwise ignore any backed-up video while paused?

    Thanks
     
    amunyoz likes this.
  16. brandonheat92

    brandonheat92

    Joined:
    Jul 24, 2015
    Posts:
    1
    Problem description:

    Hi, i have a slider as a seek bar for video. When i slide the video has stuttering effect,
    i use Seek() to feed the value.
    I am using windows 10 and unity version 2017.3.0f3
    Thanks in advance

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

    Desktop, windows 10

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

    1920x1080, mp4

    System Information:

    AVPro Video: plugin v1.7.0 scripts v1.7.0
    Target Platform: Standalone
    Unity: v2017.3.0f3 WindowsEditor
    OS: Desktop - MS-7982 (MSI) - Windows 10 (10.0.0) 64bit - English
    CPU: Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz - 8 threads - 16346KB
    GPU: NVIDIA GeForce GTX 1080 Ti - NVIDIA - Direct3D 11.0 [level 11.1] - 11132KB - 16384
     
  17. pestantium

    pestantium

    Joined:
    Jun 30, 2011
    Posts:
    47
    Have an app for Oculus Rift(PC/Desktop). Video hosted on a vimeo. Video: 4K, 360, h264. AVPro Video v1.7.5
    I cant pass review - "... there is frame rate issues"
    We are testing app on nVidia 970 and have ho issues (already try to post on a review team stat file oda). Review team test an app on
    gpuInfo=AMD Radeon R9 200 Series
    cpuInfo=Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz.

    OVRFrame3943.jpg

    Can "Use low latency" help with that?
    Any other way to improve performance?
     
  18. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    This behavior occurs because the decoder is still running, but because Unity is suspended, no render events are sent and thus we are unable to get frames from the decoder. There is unfortunately no way to flush the buffer here, but what you can do is pause/stop the stream when it's off focus, and then play again when focus is regained. Another way is to just seek to whatever position you should be at (which I believe should cause a buffer flush.

    Kind Regards,
     
  19. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    Can you elaborate on the stuttering behavior? Is it slow, or is the video oscillating etc.
    Do our demo scenes with the demo videos show the same behavior?

    Kind Regards,
     
  20. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    Low latency doesn't help with better performance unfortunately. How is your MediaPlayer set up currently? What API are you using, and also are you using hardware encoding? (Found under Platform Specific -> Windows).

    To decrease decoding costs, you can try encoding your video with the -fastdecode tune. Also how heavy is your scene? If they are testing with the lower range R9200 series cards, it might be a bit too heavy on the card to do both the decoding and rendering both eyes. In this case, you could try using software decoding instead (especially since your video is only 4k).

    kind Regards,
     
  21. pestantium

    pestantium

    Joined:
    Jun 30, 2011
    Posts:
    47
    As API I use - Media Foundation
    I cant use -fastdecode tune - Vimeo recode file with different resolution, that I use.
    Hardware decoding is on.

    Is any info/tweaks that encoding on nVidia work better than on AMD?
     
  22. pestantium

    pestantium

    Joined:
    Jun 30, 2011
    Posts:
    47
    My scene is clear: 360 sphere and player. I try to use a Software Decoding - it decreasing performance even on nVidia 970. So didn't try to push a build with software decoding to review.
    So I think I will hide solution to play 4K video, and stay on 2K and HLS streaming.

    PS: Test my 4K video file on some Oclulus players in store - performance are lower than with AVPro Video.
     
  23. dev_Visyon360

    dev_Visyon360

    Joined:
    Sep 29, 2016
    Posts:
    1
    We are having some serious problems using AVPro in the iPhone X, it normally plays a video but when we try to open the next (the same or any other), it freezes and only audio is played.

    We close the video as needed and the video resolution, format or bitrate proved to be irrelevant.

    The same Unity project is running just fine on all devices except the ones featuring the A11 chipset, did you experience something like this before?

    Thank you!
     
    Last edited: Feb 2, 2018
  24. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    I unfortunately don't know... You could perhaps try using the DirectShow API with LAVFilters, and then configure LAV Filters to test its various supported hardware decoders, but I have some doubts that they will be faster than the MediaFoundation decoder. Also opening the video may block since I assume you are opening the video via a url.

    Other than the above I'm afraid I don't really have many other ideas.

    Kind Regards
    Sunrise
     
  25. SpingDeveloper

    SpingDeveloper

    Joined:
    Nov 21, 2017
    Posts:
    13
    Hi,

    I have a question about this package, especially the Android version of this package. I'm running into issues when using the GoogleVR Unity3D videoplayer for playing large videos. Our setup is:
    • 35 different videos all around 800MB's (4k stereoscopic 360vr) loaded from a folder on a Pixel 2 from the internal memory (no streamingassets).
    • Each video has a different scene with a GoogleVR setup loading the correct video from the internal storage and start playing it when the user presses the play button
    • When the user is done playing the video he goes to a interactive scene does some stuff and then goes the the next video
    How does AVPro work with a lot of loading and unloading scenes with video's of around the given size? I expect it won't be a problem but I need to know for sure. Are there any things I should know about doing this?
     
  26. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    This shouldn't be a problem as long as the videos are loaded 1 at a time. There have been reports of overheating before with 4k 360 videos in vr before with phones like the samsung galaxy s6, although with a more powerful pixel 2 I don't believe that should be an issue. That being said, we do offer a fully featured watermarked trial version here, so you can do some testing to check for heating and other potential issues.

    One thing that should be noted with the trial version however is that it doesn't properly support our OES optimization currently due to watermarking issues. This means that it's possible to eke out a more performance in the purchased version.

    Kind Regards,
     
  27. teamvrp

    teamvrp

    Joined:
    Apr 10, 2017
    Posts:
    1
    Hello,

    I am having an issue with a Media Player only showing a video a single time. If I try to view it again I just get the blank plane that the video usually plays on.

    With the Unity editor in Play mode I can press the "Load" button in the inspector section and the video will load back up and play properly.

    Is there a setting somewhere that will allow the video to be played multiple times with out having to press "Load" button after each play?

    Thank you.
     
  28. Choi-Gyu-Bum

    Choi-Gyu-Bum

    Joined:
    Jun 10, 2015
    Posts:
    3
    On iOS, Movie go red using NGUI (ApplyToTextureWidgetNGUI).



    I'm using Unity 5.6.4f1, AVPro Video 1.7.5, NGUI 3.11.4, iPhone5 (iOS 10.1.1), iPad mini 4 (iOS 11.2.5)
     
  29. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    Andrew is on holiday currently, but this does sound like a great idea. Will add it to our internal ticketing system.

    Thanks for the suggestion!
     
  30. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    The reason why the image is red is because the textures are separated up into the luma and chroma channels, and our ngui extension doesn't handle that. To fix it, you can either modify the script to recombine the yuv420 data into an rgb one, or you can turn off the "use YpCbCr420" option under MediaPlayer->Platform Specific->iOS.

    Kind Regards,
     
  31. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    Do you mean that you want the video to loop? If so you can just check the loop option. Otherwise, you can seek to 0, and then play again.

    Kind Regards,
     
  32. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    I spoke to our apple guru about this, and he said that it might be an issue with the HLS manifest. Could you provide us a link (you can email it to our support email if you don't wish to post it here) to your stream so we can know for sure?

    Kind Regards,
     
  33. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    We unfortunately don't have access to an iPhone X at the moment so it will be a bit difficult to test, but to my knowledge this hasn't been reported before. I did speak to our apple guru about this and he says one thing you do is try the opengles3 renderer, and let us know if it works so we might know where to start looking.

    Kind Regards,
     
  34. agarcialeon

    agarcialeon

    Joined:
    Sep 4, 2014
    Posts:
    8
    Hi, I have one question about your solution. For WebGL do you play videos using the HTML5 API as in the WebGLVideoTexture example (now Video Player component) by using the URL or do you process the bytes of the video?

    I'm trying imagine if there is any video solution for WebGL that doesn't depend on video URL.

    Thanks in advance.
     
  35. IikkaDevelopingThings

    IikkaDevelopingThings

    Joined:
    Sep 8, 2017
    Posts:
    7
    Hello! I've got two questions:

    1. I've got a project with AVPro and currently the video player runs fine in editor, everything works, but in WebGL I don't get the video texture, but a black screen instead. Sound plays, the interaction works, there's a visible button on top of the video, but the video is just 100% black.

    2. Is there any way of lerping a video from 100% playback rate to paused. Essentially I want to pause the video, but not abruptly, and I feel like lerping through slomo into paused would do this nicely. Currently the video pauses for like 0.3 seconds whenever I change the playback speed. If this isn't possible, is there any workaround you'd suggest for "smooth pause"?
     
  36. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    We use the native browser decoder, which takes in a url via the video tag.

    Kind Regards,
     
  37. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    1. What video are you trying to load? It could be that WebGL doesn't support it. Can you provide us a link or email us the actual video?
    2. There unfortunately isn't. One way you can try do it is to pause the player increasingly. The main issue here is that things won't look smooth even if you do do something like lerp it since there are only so many frames. Better frame resampling techniques (such as optical flow) tend to be very expensive so they are probably not what you want for a real time resample.

    Kind Regards,
    Sunrise
     
  38. IikkaDevelopingThings

    IikkaDevelopingThings

    Joined:
    Sep 8, 2017
    Posts:
    7

    1. Turns out the problem was the video being in VR mode. Removing the VR mode from the video file itself solved the issue :) For whatever reason WebGL doesn't seem to appreciate VR mode videos.

    2. Okay dokay! I might give the pause thing a shot, thanks for the tip :)
     
  39. Thomas_DV

    Thomas_DV

    Joined:
    Jul 4, 2016
    Posts:
    2
    Hey there,

    Very recently we started noticing some of our 360° video content (both mono and stereo) is being cut in half vertically when played through the Unity AVPro Video Player on Windows. This issue even seems to affect old releases (with older versions of the Video Player) that were perfectly functional until a few days ago.

    Is this a known issue? We suspect a Windows update might have messed with some of the decoding APIs AVPro use, so we'd have expected this to be a widespread issue, but we can't find any mention of it anywhere.
     
  40. nakamurata

    nakamurata

    Joined:
    Jan 10, 2017
    Posts:
    4
    Hi,

    Problem description:

    I want to play LeftRight movies of 180 degrees, but when I play it will grow vertically.
    12_Demo_180 SphereVideo Changing content and setting "Packing" to "LeftRight".

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

    WindowsMR

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

    180 left-right View

    System Information:

    AVPro Video: plugin v1.7.5 scripts v1.7.5
    Target Platform: Metro
    Unity: v2017.2.0p2-MRTP5 WindowsEditor
    OS: Desktop - H270-HD3 (Gigabyte Technology Co., Ltd.) - Windows 10 (10.0.0) 64bit - Japanese
    CPU: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz - 8 threads - 32727KB
    GPU: NVIDIA GeForce GTX 1080 Ti - NVIDIA - Direct3D 11.0 [level 11.1] - 11132KB - 16384
     
  41. SunriseRH

    SunriseRH

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

    Is this on Windows MediaFoundation? Do the videos turn out fine in DirectShow? This might be caused due to there being stereo metadata in your videos, although why this is happening now and not earlier last year I'm not sure (as it was windows patch mid last year that caused this issue). You could try re-encoding the videos without stereoscopic metadata and see if it helps fix things.

    Kind Regards,
     
  42. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hi,

    Can you elaborate on what you mean by "grow vertically", preferably with some screenshots?

    Kind Regards,
     
  43. nakamurata

    nakamurata

    Joined:
    Jan 10, 2017
    Posts:
    4
    It is "Stretched vertically" instead of "grow virtical".
    I am sorry for the sentence that relied on the translation tool.
    Screenshot is difficult for content protection.
     
  44. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    It could be that you have stereo metadata in your video, try re-encoding it without the stereo metadata and see if it fixes things.

    Kind Regards,
     
  45. Thomas_DV

    Thomas_DV

    Joined:
    Jul 4, 2016
    Posts:
    2
    Re-encoding the videos fixed the issue, thank you :)
     
  46. hennessynewcentury

    hennessynewcentury

    Joined:
    Jan 28, 2018
    Posts:
    14
    Why AVPro dont play AC3 file??? Its so sadly for me. 150$, when i can use simple Unity Video Player...
     
  47. nakamurata

    nakamurata

    Joined:
    Jan 10, 2017
    Posts:
    4
    I think that LeftRightVideo 360 is a single lens 16: 9, but 180 is 1: 1, but is there an item to set the ratio of video?
     
  48. Luba

    Luba

    Joined:
    Oct 1, 2014
    Posts:
    43
  49. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Not sure what I'm looking at here? :)
     
  50. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    The ratio of the video shouldn't matter, as it gets mapped to geometry (eg a sphere)
     
unityunity