Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Released] AVPro Video - complete video playback solution

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

  1. contempt

    contempt

    Joined:
    Jul 31, 2012
    Posts:
    88
    I'm experiencing poor playback of a VR scene for the HTC Vive whenever the video is enabled it pulls the framerate down to 60fps, without video it exceeds 120fps. I am playing back the video on a large surface in the 3D world but we're running Titan Xp GPUs and it shouldn't have any performance issues. When I profile my project the biggest spike occurs at regular intervals and the biggest ms hog is mediaplayer.update() according to the profiler. Can you recommend anything I can do to get my VR scene running faster with AVProVideo? Thanks.
     
  2. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,
    Okay that's interesting - could you tell me:
    1) Which OS version are you running?
    2) Which Unity version are you using?
    3) Which version of AVPro Video are you using?
    4) When you open the video file, what does AVPro Video log in the Unity console window?
    5) What format, codec, frame-rate and resolution is that video you're trying to play?

    Thanks,
     
  3. draky

    draky

    Joined:
    Nov 24, 2016
    Posts:
    12
    Hey Andrew,

    We are experiencing a problem with the sphere player. We have a VR video that is a 360mono mp4, 4090x2048, 30fps that we are trying to play on phones (Samsung S6/7/8) and tablets (Samsung S1/S2).

    There are no issues on the phones, but when we try and play the video on the tablets we get the following error:

    "[[AVProVideo] Error: Loading failed. Possible codec not supported, video resolution too high or insufficient system resources."

    Any ideas what could be causing this?

    We are using the latest version of AVPro (1.6.4) and Unity v5.5.1f1
     
    Last edited: May 17, 2017
  4. Selaphiel

    Selaphiel

    Joined:
    Jan 31, 2014
    Posts:
    23
    Yes my second problem was solved by downsampling 4k video to 3840x1920, which made me to run two videos simultaneously.
     
  5. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370
    Can I still ask about the status of playmaker actions? :D

    I'm updating my app to make it "not hardcoded" and I really need to find a way to ...
    - Know when a video has ended
    - Know the length of a video

    :p
     
  6. vrglobal

    vrglobal

    Joined:
    May 15, 2017
    Posts:
    2
    Tried unity 5.5.3p3, 5.6.1f1 and problem still occurs. It disappears only when using native plugin for input field (taken from https://github.com/YousicianGit/UnityNativeEdit) but I cannot use it (compatibility problems with other UI plugins). I tested also new Unity build in VideoPlayer (using following render modes: Render Texture, Camera Far Plane, Material Overwrite) and everything works fine in it. Maybe it's not connected to that bug with webcam or it isn't fixed properly (as some comments says).
     
  7. xpansivevr

    xpansivevr

    Joined:
    Jun 22, 2016
    Posts:
    27
    Hi, can anyone using a Samsung Galaxy S8 / S8+ confirm if its now possible to playback 3840x3840 30 FPS T/B via AVP pro.

    Thanks - Nick
     
  8. lucasTOG

    lucasTOG

    Joined:
    Oct 12, 2016
    Posts:
    7
    That's the same error we are getting, also only with tablets.
     
  9. Yen-Le

    Yen-Le

    Joined:
    Mar 21, 2015
    Posts:
    1
    Hello,

    I have problem when playing a 2160x2160 video. The screen is black on iPad 4.
    Note that I can play video normally on Android Galaxy S6.
    I get the same problem even using AVPro Video latest trial downloaded today (1.6.4t).

    FYI:
    1) AVPro Video version 1.4.4
    2) Unity 5.5.2f1
    3) Target device: iPad 4
    4) Video player packing: Top-bottom

    Video:
    1) Size: 2160x2160
    2) Lenght: 00:01:00
    3) Codec: H.264
    4) Profile: Main
    5) pix_fmt=yuv420p
    6) Audio: AAC

    Many thanks.
     
  10. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Posts:
    102
    In my experience the lowest iOs device that i could get to play a 2160x2160@30fps video file is an iPhone 6s. It has an A8 chip whereas the iPad 4 has an A6 chip. They both don't have hardware h.265 decoding so you're stuck with good old h.264 if you want to support these models.

    The iPad 4 should have no issues playing back Full HD at 30fps, I guess you can drop the stereo for a tablet, no way to stick it to your head anyway.

    To me the lowest supported iOs device for stereo 360 should be the 6s. Anything lower than 2160 in stereo is just to blurry.
     
    AndrewRH likes this.
  11. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370


    I just found this... LOL
     
  12. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    We have 64 brand new PlayMaker actions coming in the next update :) This should be released this week. Thanks!
     
    GamerPET likes this.
  13. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes I suspect that the resolution is just slightly too large for the iPad4 to decode - try 2048x2048 or 1920x1080

    Also, did you try enabling the YCbCr option (in the iOS section of Platform Specific panel in MediaPlayer)? This option has better performance on iOS and also uses less memory for video playback, allowing higher resolution videos to be played.

    Thanks,
     
  14. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I suspect the video resolution is too high for this device - did you try downscaling it?
    Thanks,
     
  15. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Sorry I don't have access to S8 for testing...I would be surprised though if it supports more than 4K...
     
  16. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hmmm that's strange. I tested it myself just using the Unity InputField, but the performance was fine...Perhaps you could make a video of what you're seeing? Feel free to email us at unitysupport@renderheads.com

    Thanks,
     
  17. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370
    I'm curious whoat those actions would be :D

    Right now I'm manualy loading a video one after another which ofcourse has a 0.5 seconds spike where the screen is white... so it's not seamlesly. In theory I need to have like 2 MediaPlayers... load the 2nd file on the 2nd Mediaplayer... then swap the MediaPlayer on the sphere... load a new video on the 1st MediaPlayer... etc. Havn't done it yet but that might be the solution to my current problem.
     
  18. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes, you should take a look at either the 02_Demo_imGui.unity or 03_Demo_VideoControls.unity scene. The first one uses fading to black between videos loads, and the second one uses two mediaplayers and swaps between then.
     
  19. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,
    Okay that's interesting - could you tell me:
    1) Which OS version are you running?
    2) Which Unity version are you using?
    3) Which version of AVPro Video are you using?
    4) When you open the video file, what does AVPro Video log in the Unity console window?
    5) What format, codec, frame-rate and resolution is that video you're trying to play?

    Thanks,
     
  20. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,935
    @AndrewRH
    Hi there,
    I bought your plugin ages ago but finally got a chance to use it properly. I'm very happy with the results so far. (Please dont abandon it :p)
    Now question is, by default UGUI media display show AVPro logo, i removed the logo and now i see grey color. How do i change this grey color to some other color?
     
  21. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    We're not abandoning anything :)
    Yes, you just need to set a default texture - so you would need to create a flat texture of the colour that you want to appear.
    Thanks,
     
    jGate99 likes this.
  22. 785130190

    785130190

    Joined:
    May 11, 2017
    Posts:
    21
    How could I give you the project?I have several c# files.I wrapped AvProVideo with my code. Can you give me a email address?
     
  23. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    unitysupport@renderheads.com

    Thanks,
     
  24. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,
    According to Apple here, the iPad 4 only supports up to 1080p, 30 frames per second, High Profile level 4.1 with AAC-LC - so you will have to lower your video resolution for that device.

    Thanks,
     
  25. 785130190

    785130190

    Joined:
    May 11, 2017
    Posts:
    21
  26. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    That's strange...
    Well, you can just put the zip file on dropbox/gdrive/onedrive etc, and PM me the link?
    Thanks,
     
  27. JS-Lee

    JS-Lee

    Joined:
    Jun 29, 2015
    Posts:
    8
    Does this Plug-in support Android 7.0 with Unity?

    Does this Plug-in support mpeg stream with 4K resolution(30 FPS) on Android?
     
  28. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes, Android is supported, including Android 7.0. It can handle 4K streams at 30fps using HLS or progressive.

    Thanks,
     
  29. JS-Lee

    JS-Lee

    Joined:
    Jun 29, 2015
    Posts:
    8
    Hi Andrew,

    I have an UVC camera with 4K resolution. it connect Android with direct USB connect, not with network.

    This camera can send only motion-jpeg stream. But the software decoder is 5 FPS (I use libjpeg-turbo). So I want to use hardware decoder to solve it.

    Does your product support motion-jpeg stream with high resolution?
     
  30. Adkaros

    Adkaros

    Joined:
    Dec 14, 2015
    Posts:
    16
    I see in the documentation that if you have Windows 10 as well as Nvidia 1070 card you can play 8k videos- Does this mean you can also play 8K 360 videos?
     
  31. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Ahh, I see - no AVPro Video doesn't support USB connected webcams, sorry. It would need to produce a URL stream to connect to..
     
  32. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes that's right - 8K is possible with Windows 10, Nvidia 1060+ card and H.265 codec
     
  33. JS-Lee

    JS-Lee

    Joined:
    Jun 29, 2015
    Posts:
    8
    Hi Andrew,

    I already connect USB camera and got jpeg data in byte array. So, you doesn't need worry connecting problem.

    I already tried libjpeg-turbo and Unity.loadimage decode, but they are too slow.

    In short, my problem is that how to decode 4K motion-jpeg with 30 FPS. I already prepare byte data to decode.
     
  34. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    You would have to write Java or C++ plugin to work wit the webcam to achieve any decent speed. Even with hardware decoding, I wouldn't expect it to decode MJPEG 4K at 30fps...It'd be slower I'm sure..
     
  35. JS-Lee

    JS-Lee

    Joined:
    Jun 29, 2015
    Posts:
    8
    Hi Andrew,

    So, you means AVPro viedo doesn't hardware decode with self feature.

    I must write another code to decode jpeg.

    Is this right?
     
  36. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    Hi
    3 questions
    I need to load video at runtime.
    1-Will the AVProvideo component allow this?
    2-What video file type restrictions are there?
    3-Are there any demos(standalone, desktop) that show video upload functionality?
     
  37. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    AVPro Video supports hardware decoding of video files and streaming video, but it doesn't support passing in byte arrays for any sort of decoding.
     
  38. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    1) Yes loading a video file at runtime is definitely supported

    2) It depends on which platforms you're targeting. The safest bet is MP4 file using H.264 compression and AAC audio, up to 1080p30. Beyond that it really depends on the platform. If you let us know about your use case then I can try to offer other formats that might be useful.

    3) I don't know what you mean by "video upload"? If you mean simply loading videos at runtime, then this is demonstrated in all of our demo scenes.

    Thanks,
     
  39. meMidgety

    meMidgety

    Joined:
    Jan 30, 2016
    Posts:
    1
    I was wondering if there is a size limit of any sort. I am currently using unity 5.6.0f1 and I'm having an issue playing files over 100mbs. The bit rate on the videos are also over 150mbs if that matters at all.
    The mesh that the video is played on becomes the default texture. The video is playing, because I do hear audio and the Media_Player component shows that the video is playing.

    Edit: These videos are 720p

    Thanks.
     
    Last edited: May 24, 2017
  40. 785130190

    785130190

    Joined:
    May 11, 2017
    Posts:
    21
    https://drive.google.com/open?id=0BwRjDVWVKvnaTmFzMV9iUFlfSVU
    First put any video you like into StreamingAssets/Video.Rename it to Flat0.mp4.
    Open with Unity 5.3.5f.Enter the start.unity,press 1(KeyCode.Alpha1) on the keyboard.If there's no crash,press again.
    I hope there's something wrong with my code that cause the crash.
     
  41. JS-Lee

    JS-Lee

    Joined:
    Jun 29, 2015
    Posts:
    8
    Hi Andrew,

    What's different between AVPro Video and AV
    Pro Video (Enterprise Edition)
     
  42. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    Hi Andrew
    First of all huge thanks for your prompt reply. Let me clarify. I am creating a video composting app that will let users MANUALLY upload their videos. ie they need to press an 'Upload' button to initiate the upload. Alternatively I could enable drag and drop to load videos. Is there such a demo?
     
  43. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    No there is no limit on file size. That bit-rate does seem very high though! Which platform is this on? It definitely sounds like there is something about the video format that it doesn't like. Also make sure the profile level isn't too high. If in doubt please send us (www.renderheads.com/contact/) your video so we can take a look.
    Thanks,
     
  44. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    No there is no demo for this - this is application specific and outside of the AVPro Video features. Sorry that we can't help you more on this.
     
  45. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    The enterprise edition simply includes an additional license that grants the end user the right to use the plugin over multiple sites. This is useful for large companies with offices / branches / subsidiaries in many locations. Instead of having to purchase a license for each office that needs it, this single license will cover all of their sites. The standard edition is based on Unity's standard Asset Store License Agreement, which only allows installation at a single site. You can think of it as a site license and a multi-site license.

    Thanks,
     
  46. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I found the problem. You were loading the next video, but still displaying the texture from the previous video which was being destroyed. So just change txUIVideo.cs line 98 to this:

    Code (CSharp):
    1. mMediaPlayer.Events.RemoveAllListeners();
    2. mTexture.mainTexture = null;
    3. mMediaPlayer.OpenVideoFromFile(MediaPlayer.FileLocation.RelativeToDataFolder, file, false);
    4. mMediaPlayer.Events.AddListener(onVideoEvent);
    Also - you might want to upgrade from 1.3.9 to 1.6.4 of AVPro Video as many improvements have been made, including to the included NGUI component.

    I hope that helps you.
     
  47. 785130190

    785130190

    Joined:
    May 11, 2017
    Posts:
    21
    That's GREAT!!! Thanks a lot!!!Just as I said,there's something with my code.
     
  48. xpansivevr

    xpansivevr

    Joined:
    Jun 22, 2016
    Posts:
    27
    Hi Andrew, any news on this? 180 stereoscopic has some real benefits when it come to pixel density / resolution especially on mobile devices.

    Its no wonder that the adult industry use it as standard!

    See: John Carmack on Wide-Angle Stereoscopic Video
     
  49. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Is it not possible just to use a sphere with the texture transform scaling X set to 2? This will cause the video to also appear on the back half of the sphere, but this can be hidden. Or just use a hemisphere mesh?
     
    Cambesa likes this.
  50. 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