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,611
    Currently the stream selection is automatic. You can select streams manually by using HLSStream class to parse the manifest and then play back specific stream URLs.
     
  2. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Which GPU is being used?
    What codec is the video using?
    Which version of Unity and AVPro Video are you using?

    What does Task Manager say about CPU/GPU resources during playback?
    It's possible that it's just too much for the hardware, and you may have to either reduce frame-rate, bit-rate, or resolutiion.
     
  3. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Yes, when the same mediaPlayer is used to play multiple videos - between loads the textures are destroyed, so there will be a time when you see a jump. There are a few ways around this. You could use 2 MediaPlayers and switch between them when they're loaded (see our demo scene 02_Demo_imGui and 03_Demo_VideoControls) for this. Or you could use our PlaylistMediaPlayer component that handles all of this. Having two MediaPlayers can be more intensive. Some people have tried to use a single MediaPlayer, where they use Graphics.Blit to grab the last image and display that while the next video is loading. Some use fade to black between videos.

    I hope this helps.

    Thanks,
     
  4. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Please try upgrading to the latest version (1.10.0) as I believe this issue has been fixed.

    Interesting about that React framework - I didn't know you could integrate Unity like that - cool!

    If this doesn't work, please post the issue to our GibHub page so the team can investigate:
    https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues

    Thanks,
     
  5. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Yes, if your video is encoded as all key-frames, then you could be able to seek around ito each frame. You should be able to test this very easily, even using our sample BigBuckBunny720p video.

    We include some helper methods to convert from a frame number to a seek time:
    public static int ConvertTimeSecondsToFrame(float seconds, float frameRate);
    public static float ConvertFrameToTimeSeconds(int frame, float frameRate);

    These are in the Helper static class.

    You can this seek with:

    mediaPlayer.Control.Seek(timeMs);

    Thanks,
     
  6. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    481
    I did this for a project and it worked great. That was the key (haha) thing to getting it to work smoothly - ensuring that the video is encoded as all key-frames and no inter-frames.

    Cheers,
    Sam
     
    AndrewRH likes this.
  7. kuchida

    kuchida

    Joined:
    Dec 25, 2012
    Posts:
    5
    Thank you for the reply.

    The Encoding is H264.
    The GPU is GeForce GTX 1080 Ti.
    The Version of Unity is 2018.2.10f1.
    AVPro Version is 1.9.12.
    The CPU is about 20% used at maximum.
    The GPU is about 40% used at maximum.
    So it seems that there is room.

    When the video stops, decoding seems to stop and the GPU usage rate is 0%.
    What do you think?
     
  8. NS24

    NS24

    Joined:
    Feb 21, 2018
    Posts:
    15
    Hi @AndrewRH

    I just wanted to echo some of the problems getting the Oculus Quest to play video.

    I managed to build the 13_Demo360StereoSpatialAudio scene which seems to work fine.

    However using any of the other files we have (stereo or mono) I just get a black screen.

    I checked mLogcat but could not find any real indication of what the problem might be, so it would be good to know what your plans might be to investigate some of these issues, and what we might be able to do to help?


    kind regards,

    Nalin
     
  9. JJunior

    JJunior

    Joined:
    May 22, 2019
    Posts:
    12
    Hi there, thank you for your fast replay, I really appreciate.

    Can you tell me more about the Graphics.Blit solution? I think this would be the best work around for this issue. I have to use another mesh/texture to display over the video texture while its loading or I can use the same mesh I am using to play the video? Do you have any code showing how to do it?
     
  10. dayjur

    dayjur

    Joined:
    Sep 6, 2014
    Posts:
    34
    Hi,

    Android, Unity 2019.1.9f1
    I have MediaPlayer.Events.AddListener in OnEnable() and MediaPlayerEvent.EventType.ReadyToPlay is being called right away on App start on nexus android tv when I have not even loaded a video. Im using MediaPlayer for Video API.
     
  11. MikeGDev

    MikeGDev

    Joined:
    Dec 19, 2017
    Posts:
    25
    Are there any updates for adding Vulkan support?
     
  12. shoo

    shoo

    Joined:
    Nov 19, 2012
    Posts:
    60
    Hello! When I use AVPro with Unity for 6k 360 video, it looks kind of ripple. It is looks really bad compare to Samsung Player. Is there any solution to make picture better? I've tried already antialiasing, texture filtration and aniso, and nothing resolve the problem. I only found the way to make picture worse - set texture filter to point.
     
    Last edited: Aug 15, 2019
  13. Modernllama

    Modernllama

    Joined:
    Nov 30, 2012
    Posts:
    18
    Hi,

    I'm noticing a odd bug with the player on Oculus Go. Basically fails to initialize the video player if i quit my app using Application.Quit() and then open the app again after. If however, I close the app from the Oculus home area and then replay, the video player initializes fine. Just wondered if you knew of this and could identify what may be causing it? The file definitely exists. I've added some logs at the bottom.

    Thanks!

    Code (CSharp):
    1. 2019-08-14 11:53:01.374 4464-4968/? E/Unity: java.net.UnknownHostException: Unable to resolve host "config.uca.cloud.unity3d.com": No address associated with hostname
    2.  
    3.     (Filename:  Line: 451)
    4. 2019-08-14 11:53:01.524 4464-4963/? E/Unity: [AVProVideo] Failed to create player instance
    5.  
    6.     (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
    7. 2019-08-14 11:53:01.533 4464-4963/? I/Unity: [AVProVideo] Initialising AVPro Video (script v1.9.5 plugin v1.9.3) on Adreno (TM) 530/OpenGL ES 3.2 V@393.0 (GIT@b8c103d, I8a36212832) (Date:05/17/19) (MT True) on Android
    8.  
    9.     (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
    10. 2019-08-14 11:53:01.533 4464-4963/? E/Unity: [AVProVideo] Failed to create player instance
    11.  
    12.     (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
    13. 2019-08-14 11:53:01.542 4464-4963/? E/Unity: [AVProVideo] No file path specified
    14.  
    15.     (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
    16. 2019-08-14 11:53:01.543 4464-4963/? E/Unity: [AVProVideo] Failed to create player instance
    17.  
    18.     (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
    19. 2019-08-14 11:53:01.543 4464-4963/? E/Unity: [AVProVideo] No file path specified
    20.  
    21.     (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
    22. 2019-08-14 11:53:01.787 4464-4994/? I/VrApi: FPS=61,Prd=56ms,Tear=0,Early=0,Stale=0,VSnc=1,Lat=1,Fov=0,CPU2/GPU=-1/-1,2342/214MHz,OC=F,TA=0/0/0,SP=N/N/N,Mem=680MHz,Free=1269MB,PSM=0,PLS=0,Temp=0.0C/25.0C,TW=0.00ms,App=2.22ms,GD=0.00ms,CPU&GPU=0.00ms,LCnt=1
    23. 2019-08-14 11:53:01.795 4464-4995/? I/UtilPoller: GPU Util 0.013960 / CPU Util 0.744681 (avg 0.643308)
    24. 2019-08-14 11:53:01.882 4464-4963/? I/Unity: [Singleton] Using instance already created: Stack
    25.  
    26.     (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
    27. 2019-08-14 11:53:02.184 4464-4991/? I/Clocks: LockClocks( cpu=2, gpu=2 ) - start
    28. 2019-08-14 11:53:02.185 4464-4991/? I/Clocks: CPU levels [0, 5]
    29. 2019-08-14 11:53:02.185 4464-4991/? I/Clocks: GPU levels [0, 5]
    30. 2019-08-14 11:53:02.185 621-2061/? D/VrApiService: CPU_CLUSTER_0: Client 4464 sends freq request [11, 11]
    31. 2019-08-14 11:53:02.185 621-2061/? D/VrApiService: CPU_CLUSTER_0: Next Perf Level = (11, 11)
    32. 2019-08-14 11:53:02.185 621-2061/? D/VrApiService: CPU_CLUSTER_1: Client 4464 sends freq request [11, 11]
    33. 2019-08-14 11:53:02.185 621-2061/? D/VrApiService: CPU_CLUSTER_1: Next Perf Level = (11, 11)
    34. 2019-08-14 11:53:02.191 621-2061/? D/VrApiService: CPUBW: Client 4464 sends freq request [8, 11]
    35. 2019-08-14 11:53:02.192 621-2061/? D/VrApiService: CPUBW: Next Perf Level = (8, 11)
    36. 2019-08-14 11:53:02.193 621-2061/? D/VrApiService: GPUBW: Client 4464 sends freq request [9, 11]
    37. 2019-08-14 11:53:02.193 621-2061/? D/VrApiService: GPUBW: Next Perf Level = (9, 11)
    38. 2019-08-14 11:53:02.193 621-2061/? D/VrApiService: GPU: Client 4464 sends freq request [2, 2]
    39. 2019-08-14 11:53:02.194 621-2061/? D/VrApiService: GPU: Next Perf Level = (2, 2)
    40. 2019-08-14 11:53:02.195 4464-4991/? I/Clocks: LockClocks( cpu=2, gpu=2 ) - end (10.8 ms)
    41. 2019-08-14 11:53:02.196 4464-4986/? I/TimeWarpProgs: [0xc3d552c8] Built layerProgram 0:0x448007:0x0 in 5.2 ms
    42. 2019-08-14 11:53:02.199 872-1280/? W/ActivityManager: Unable to start service Intent { act=com.google.android.gms.ads.identifier.service.START pkg=com.google.android.gms } U=0: not found
    43. 2019-08-14 11:53:02.201 872-894/? W/ActivityManager: Unbind failed: could not find connection for android.os.BinderProxy@b891b74
    44. 2019-08-14 11:53:02.203 4464-4992/? I/TimeWarp: Waited 5.463 seconds for first call to warp swap.
    45. 2019-08-14 11:53:02.203 4464-4992/? I/TimeWarp: Waited 0.000 seconds for first vsync.
    46. 2019-08-14 11:53:02.203 4464-4992/? I/TimeWarp: Setting global CAC to 1
    47. 2019-08-14 11:53:02.255 4464-4969/? E/Unity: java.net.UnknownHostException: Unable to resolve host "cdp.cloud.unity3d.com": No address associated with hostname
    48.  
    49.     (Filename:  Line: 451)
    50. 2019-08-14 11:53:02.528 4464-4991/? I/Clocks: ReleaseClocks - start
    51. 2019-08-14 11:53:02.529 621-621/? D/VrApiService: CPU_CLUSTER_0: No client requests exists, release clocks
    52. 2019-08-14 11:53:02.530 621-621/? D/VrApiService: CPU_CLUSTER_1: No client requests exists, release clocks
    53. 2019-08-14 11:53:02.534 621-621/? D/VrApiService: GPU: No client requests exists, release clocks
    54. 2019-08-14 11:53:02.535 621-621/? D/VrApiService: CPUBW: No client requests exists, release clocks
    55. 2019-08-14 11:53:02.535 621-621/? D/VrApiService: GPUBW: No client requests exists, release clocks
    56. 2019-08-14 11:53:02.536 4464-4991/? I/Clocks: ReleaseClocks - end (8.4 ms)
    57. 2019-08-14 11:53:02.536 4464-4991/? I/Clocks: LockClocks( cpu=3, gpu=2 ) - start
    58. 2019-08-14 11:53:02.539 4464-4991/? I/Clocks: CPU levels [0, 5]
    59. 2019-08-14 11:53:02.539 4464-4991/? I/Clocks: GPU levels [0, 5]
    60. 2019-08-14 11:53:02.540 621-2061/? D/VrApiService: CPU_CLUSTER_0: Client 4464 sends freq request [13, 13]
    61. 2019-08-14 11:53:02.540 621-2061/? D/VrApiService: CPU_CLUSTER_0: Next Perf Level = (13, 13)
    62. 2019-08-14 11:53:02.541 621-2061/? D/VrApiService: CPU_CLUSTER_1: Client 4464 sends freq request [13, 13]
    63. 2019-08-14 11:53:02.541 621-2061/? D/VrApiService: CPU_CLUSTER_1: Next Perf Level = (13, 13)
    64. 2019-08-14 11:53:02.543 621-2061/? D/VrApiService: CPUBW: Client 4464 sends freq request [8, 11]
    65. 2019-08-14 11:53:02.543 621-2061/? D/VrApiService: CPUBW: Next Perf Level = (8, 11)
    66. 2019-08-14 11:53:02.545 621-2061/? D/VrApiService: GPUBW: Client 4464 sends freq request [9, 11]
    67. 2019-08-14 11:53:02.545 621-2061/? D/VrApiService: GPUBW: Next Perf Level = (9, 11)
    68. 2019-08-14 11:53:02.545 621-2061/? D/VrApiService: GPU: Client 4464 sends freq request [2, 2]
    69. 2019-08-14 11:53:02.545 621-2061/? D/VrApiService: GPU: Next Perf Level = (2, 2)
    70. 2019-08-14 11:53:02.546 4464-4991/? I/Clocks: LockClocks( cpu=3, gpu=2 ) - end (9.5 ms)
    71. 2019-08-14 11:53:02.603 4464-4970/? E/Unity: java.net.UnknownHostException: Unable to resolve host "cdp.cloud.unity3d.com": No address associated with hostname
    72.  
    73.     (Filename:  Line: 451)
    74. 2019-08-14 11:53:02.797 4464-4995/? I/UtilPoller: GPU Util 0.071829 / CPU Util 0.666667 (avg 0.567822)
    75. 2019-08-14 11:53:02.826 1671-1713/? I/VRLifecycleSessionManager: Stored session info.
    76. 2019-08-14 11:53:02.830 4464-4994/? I/VrApi: FPS=61,Prd=56ms,Tear=0,Early=0,Stale=0,VSnc=1,Lat=1,Fov=0,CPU2/GPU=-1/-1,1286/315MHz,OC=F,TA=E/0/0,SP=F/N/N,Mem=1017MHz,Free=1264MB,PSM=0,PLS=0,Temp=31.0C/25.0C,TW=0.00ms,App=2.22ms,GD=0.00ms,CPU&GPU=0.00ms,LCnt=1
    77. 2019-08-14 11:53:03.236 4464-4963/? I/Unity: Attempting to load cached data
    78.  
    79.     (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
    80. 2019-08-14 11:53:03.788 4464-4994/? I/VrApi: FPS=1,Prd=3284ms,Tear=0,Early=0,Stale=0,VSnc=1,Lat=1,Fov=0,CPU2/GPU=3/2,1286/315MHz,OC=F,TA=E/0/0,SP=F/N/N,Mem=1017MHz,Free=1262MB,PSM=0,PLS=0,Temp=31.0C/25.0C,TW=1.50ms,App=1.14ms,GD=0.00ms,CPU&GPU=0.00ms,LCnt=1
    81. 2019-08-14 11:53:03.801 4464-4995/? I/UtilPoller: GPU Util 0.120856 / CPU Util 0.586957 (avg 0.472576)
    82. 2019-08-14 11:53:04.103 1606-2069/? I/OVRPlatform: [FBNS] ClientImpl.cpp:209 Failed to connect to the MQTT server (edge-mqtt.facebook.com:443): 15 Lookup error.
    83. 2019-08-14 11:53:04.103 1606-2069/? I/OVRPlatform: [FBNS] ClientImpl.cpp:127 Received a CONNACK without valid credentials
    84. 2019-08-14 11:53:04.787 4464-4994/? I/VrApi: FPS=38,Prd=52ms,Tear=0,Early=35,Stale=25,VSnc=1,Lat=1,Fov=0,CPU2/GPU=3/2,1286/315MHz,OC=F,TA=E/0/0,SP=F/N/N,Mem=1017MHz,Free=1258MB,PSM=0,PLS=0,Temp=31.0C/25.0C,TW=1.51ms,App=1.06ms,GD=0.00ms,CPU&GPU=0.00ms,LCnt=1
    85. 2019-08-14 11:53:04.805 4464-4995/? I/UtilPoller: GPU Util 0.095570 / CPU Util 0.690722 (avg 0.491352)
    86. 2019-08-14 11:53:04.933 1671-1671/? D/UnifiedTelemetryLogger: binding with UnifiedTelemetryService
    87. 2019-08-14 11:53:04.934 1671-1671/? E/UnifiedTelemetryLogger: Failed to get UnifiedTelemetryService
    88. 2019-08-14 11:53:05.187 4464-4976/? E/Unity: java.net.UnknownHostException: Unable to resolve host "cdp.cloud.unity3d.com": No address associated with hostname
    89.  
    90.     (Filename:  Line: 451)
    91. 2019-08-14 11:53:05.240 4464-4991/? I/Clocks: ReleaseClocks - start
    92. 2019-08-14 11:53:05.242 621-729/? D/VrApiService: CPU_CLUSTER_0: No client requests exists, release clocks
    93. 2019-08-14 11:53:05.243 621-729/? D/VrApiService: CPU_CLUSTER_1: No client requests exists, release clocks
    94. 2019-08-14 11:53:05.246 621-729/? D/VrApiService: GPU: No client requests exists, release clocks
    95. 2019-08-14 11:53:05.247 621-729/? D/VrApiService: CPUBW: No client requests exists, release clocks
    96. 2019-08-14 11:53:05.248 621-729/? D/VrApiService: GPUBW: No client requests exists, release clocks
    97. 2019-08-14 11:53:05.248 4464-4991/? I/Clocks: ReleaseClocks - end (8.1 ms)
    98. 2019-08-14 11:53:05.248 4464-4991/? I/Clocks: LockClocks( cpu=4, gpu=2 ) - start
    99. 2019-08-14 11:53:05.249 4464-4991/? I/Clocks: CPU levels [0, 5]
    100. 2019-08-14 11:53:05.249 4464-4991/? I/Clocks: GPU levels [0, 5]
    101. 2019-08-14 11:53:05.250 621-729/? D/VrApiService: CPU_CLUSTER_0: Client 4464 sends freq request [17, 17]
    102. 2019-08-14 11:53:05.250 621-729/? D/VrApiService: CPU_CLUSTER_0: Next Perf Level = (17, 17)
    103. 2019-08-14 11:53:05.250 621-729/? D/VrApiService: CPU_CLUSTER_1: Client 4464 sends freq request [17, 17]
    104. 2019-08-14 11:53:05.251 621-729/? D/VrApiService: CPU_CLUSTER_1: Next Perf Level = (17, 17)
    105. 2019-08-14 11:53:05.252 621-729/? D/VrApiService: CPUBW: Client 4464 sends freq request [8, 11]
    106. 2019-08-14 11:53:05.252 621-729/? D/VrApiService: CPUBW: Next Perf Level = (8, 11)
    107. 2019-08-14 11:53:05.253 621-729/? D/VrApiService: GPUBW: Client 4464 sends freq request [9, 11]
    108. 2019-08-14 11:53:05.253 621-729/? D/VrApiService: GPUBW: Next Perf Level = (9, 11)
    109. 2019-08-14 11:53:05.253 621-729/? D/VrApiService: GPU: Client 4464 sends freq request [2, 2]
    110. 2019-08-14 11:53:05.253 621-729/? D/VrApiService: GPU: Next Perf Level = (2, 2)
    111. 2019-08-14 11:53:05.254 4464-4991/? I/Clocks: LockClocks( cpu=4, gpu=2 ) - end (5.1 ms)
    112. 2019-08-14 11:53:05.784 4464-4994/? I/VrApi: FPS=2,Prd=56ms,Tear=0,Early=2,Stale=71,VSnc=1,Lat=1,Fov=0,CPU2/GPU=3/2,1593/315MHz,OC=F,TA=E/0/0,SP=F/N/N,Mem=1017MHz,Free=1260MB,PSM=0,PLS=0,Temp=31.0C/25.0C,TW=1.50ms,App=1.31ms,GD=0.00ms,CPU&GPU=0.00ms,LCnt=1
    113. 2019-08-14 11:53:05.806 4464-4995/? I/UtilPoller: GPU Util 0.183288 / CPU Util 0.584270 (avg 0.481672)
    114. 2019-08-14 11:53:06.236 4464-4963/? W/Unity: CurvedUI: The Z position of "Download Button Parent" Button, or one of its parents is not 0 in relation to the canvas. The interactions may not be accurate.
    115.  
    116.     (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
    117. 2019-08-14 11:53:06.784 4464-4994/? I/VrApi: FPS=14,Prd=49ms,Tear=0,Early=12,Stale=52,VSnc=1,Lat=1,Fov=0,CPU2/GPU=4/2,1593/315MHz,OC=F,TA=E/0/0,SP=F/N/N,Mem=1017MHz,Free=1258MB,PSM=0,PLS=0,Temp=31.0C/25.0C,TW=1.57ms,App=2.47ms,GD=0.00ms,CPU&GPU=0.00ms,LCnt=1
    118. 2019-08-14 11:53:06.808 4464-4995/? I/UtilPoller: GPU Util 0.252549 / CPU Util 0.554348 (avg 0.430732)
    119. 2019-08-14 11:53:07.529 1847-1847/? D/UnifiedTelemetryLogger: binding with UnifiedTelemetryService
    120. 2019-08-14 11:53:07.529 1847-1847/? E/UnifiedTelemetryLogger: Failed to get UnifiedTelemetryService
    121. 2019-08-14 11:53:07.786 4464-4994/? I/VrApi: FPS=49,Prd=54ms,Tear=0,Early=46,Stale=13,VSnc=1,Lat=1,Fov=0,CPU2/GPU=4/2,1593/315MHz,OC=F,TA=E/0/0,SP=F/N/N,Mem=1017MHz,Free=1256MB,PSM=0,PLS=0,Temp=31.0C/25.0C,TW=1.56ms,App=3.45ms,GD=0.00ms,CPU&GPU=0.00ms,LCnt=1
    122. 2019-08-14 11:53:07.810 4464-4995/? I/UtilPoller: GPU Util 0.310182 / CPU Util 0.565657 (avg 0.452122)
    123. 2019-08-14 11:53:08.298 4464-4963/? I/Unity: Events to save: 1
    124.  
    125.     (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
    126. 2019-08-14 11:53:08.785 4464-4994/? I/VrApi: FPS=60,Prd=56ms,Tear=0,Early=60,Stale=0,VSnc=1,Lat=1,Fov=0,CPU2/GPU=4/2,1593/315MHz,OC=F,TA=E/0/0,SP=F/N/N,Mem=1017MHz,Free=1261MB,PSM=0,PLS=0,Temp=31.0C/25.0C,TW=1.58ms,App=3.50ms,GD=0.00ms,CPU&GPU=0.00ms,LCnt=1
    127. 2019-08-14 11:53:08.814 4464-4995/? I/UtilPoller: GPU Util 0.260141 / CPU Util 0.541667 (avg 0.448165)
    128. 2019-08-14 11:53:09.786 4464-4994/? I/VrApi: FPS=53,Prd=55ms,Tear=0,Early=52,Stale=10,VSnc=1,Lat=1,Fov=0,CPU2/GPU=4/2,1593/315MHz,OC=F,TA=E/0/0,SP=F/N/N,Mem=1017MHz,Free=1260MB,PSM=0,PLS=0,Temp=31.0C/25.0C,TW=1.53ms,App=2.70ms,GD=0.00ms,CPU&GPU=0.00ms,LCnt=1
    129. 2019-08-14 11:53:09.817 4464-4995/? I/UtilPoller: GPU Util 0.260073 / CPU Util 0.455556 (avg 0.390189)
    130. 2019-08-14 11:53:09.947 1357-1702/? I/[CT]: [ORIENTATION:SensorFusionImpl-H]: SensorFusion 2: ResetCorrections
    131. 2019-08-14 11:53:10.003 4464-4963/? W/Unity: [AVProVideo] No camera set for UpdateStereoMaterial component. If you are rendering in stereo then it is recommended to set this.
    132.  
    133.     (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
    134. 2019-08-14 11:53:10.126 4464-4963/? I/Unity: [AVProVideo] Opening /storage/emulated/0/Android/data/com.virti.simulationappvr/files/388/.mp4 (offset 0)
    135.  
    136.     (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
    137. 2019-08-14 11:53:10.128 4464-4963/? E/Unity: [AVProVideo] m_Video is null!
    138.  
    139.     (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
    140. 2019-08-14 11:53:10.128 4464-4963/? E/Unity: [AVProVideo] Failed to open /storage/emulated/0/Android/data/com.virti.simulationappvr/files/388/.mp4
    141.  
    142.     (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
     
  14. awesome_suri

    awesome_suri

    Joined:
    Dec 10, 2016
    Posts:
    3
    Hi Andrew,

    Thanks for your help last time. I've encountered another problem (which I actually already have for a while). I play a video on Oculus GO and when the headset is going to hibernation (via the button or automatically) and back, the app crashes in various ways. Sometimes the app just restarts on its own but mostly, the view gets black while the audio continues. When I go out of the app and go back, the app crashes and closes. I get these logs when it turns black:

    Code (CSharp):
    1. 08-16 19:14:33.939 29962 30002 E Unity   : OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_OPERATION: Operation illegal in current state
    2. 08-16 19:14:33.939 29962 30002 E Unity   :  #0 0xd59c069c (libunity.so) ? 0x46b69c
    3. 08-16 19:14:33.939 29962 30002 E Unity   :  #1 0xd5f5b6fc (libunity.so) ? 0xa066fc
    4. 08-16 19:14:33.939 29962 30002 E Unity   :  #2 0xd5f99e08 (libunity.so) ? 0xa44e08
    5. 08-16 19:14:33.939 29962 30002 E Unity   :  #3 0xd5f99f30 (libunity.so) ? 0xa44f30
    6. 08-16 19:14:33.939 29962 30002 E Unity   :  #4 0xd5da8c84 (libunity.so) ? 0x853c84
    7. 08-16 19:14:33.939 29962 30002 E Unity   :  #5 0xd59b8b40 (libunity.so) ? 0x463b40
    8. 08-16 19:14:33.939 29962 30002 E Unity   :  #6 0xd59b98a0 (libunity.so) ? 0x4648a0
    9. 08-16 19:14:33.939 29962 30002 E Unity   :  #7 0xd59b1a98 (libunity.so) ? 0x45ca98
    10. 08-16 19:14:33.939 29962 30002 E Unity   :  #8 0xd5b4cc08 (libunity.so) ? 0x5f7c08
    11. 08-16 19:14:33.939 29962 30002 E Unity   :  #9 0xf06fd8d0 (libc.so) __pthread_start(void*) 0x13
    12. 08-16 19:14:33.939 29962 30002 E Unity   :  #10 0xf06cffe2 (libc.so) __start_thread 0x3
    13. 08-16 19:14:33.939 29962 30002 E Unity   :
    14. 08-16 19:14:33.939 29962 30002 E Unity   : (Filename: /Users/builduser/buildslave/unity/build/Runtime/GfxDevice/opengles/GfxDeviceGLES.cpp Line: 340)
    I use:
    - Unity 2018.3.11f1
    - AVPro 1.10.0

    I load the MP4 via URL locally from the device.
    This error does not always happen. Sometimes within the first video played, sometimes after several videos have been watched. I'm now trying to do a workaround but maybe you know the cause.

    Thanks!
     
    bertrandlevet likes this.
  15. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Have you tried upgrading your GPU drivers? Also try upgrading to the latest version of AVPro Video.

    Does that help?
     
  16. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Hi Nalin,

    Are you using the latest version of the AVPro Video plugin? Perhaps you could provide details by posting the issue to our GitHub Issues page?

    Thanks,
     
  17. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    I don't have any code right now to show. You would create another RenderTexture (the same dimensions as the video) and then use Graphics.Blit(srcTexture, targetTexture); to copy from the AVPro Video texture to your texture. This would happen when it's time to close the MediaPlayer so that it can load the next video. The texture can be retrieved by mediaPlayer.TextureProducer.GetTexture(). Then you need to display that texture. If you're using the ApplyToMesh/ApplyToMaterial component, you can set the Default Texture. This is the texture that is shown when there is no texture available to display from the MediaPlayer component. So you shouldn't need a second mesh, you can use the existing mesh.
     
    JJunior likes this.
  18. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    At this point it's highly unlikely to happen. If we get time we'll investigate it more. We've hardly had any requests for this. If you want you can add it as a feature request on our GitHub issues page.
     
  19. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Which version of AVPro Video is this with?

    For best chance of having it fixed, please add the issue to GitHub Issues here:
    https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues

    Thanks,
     
  20. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Hmm this is interesting. Could you please report the issue in details here:
    https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues

    I wonder if some sort of scaling is happening somewhere....Please provide screenshot comparisons if possible. Also if you could provide the source video that would help.

    Thanks,
     
  21. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    This issue has been fixed. Please upgrade to the latest version of the plugin :) Thanks,
     
  22. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Thanks for reporting this. This isn't an issue we've seen before. Please could you post it to GitHub Issues here:
    https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues

    Please also let us know whether you're using the MediaPlayer or ExoPlayer API setting, and if you're using the OES setting.

    Thanks,
     
  23. thinhpq2

    thinhpq2

    Joined:
    Aug 19, 2019
    Posts:
    1
    Hi Andrew,
    I got problem with memory when playing video by AVPro WebGL on some PCs (not all) with Chrome:

    It's ok with Firefox.

    Please help to fix it

    Thank you.
     
    Last edited: Aug 19, 2019
  24. kuchida

    kuchida

    Joined:
    Dec 25, 2012
    Posts:
    5
    I updated the GPU driver and tried AVPro with the latest version, but there is still a problem.
    Please help to fix it.
    Thank you.
     
  25. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Hmmm looks like a memory leak.
    Make sure you're running the latest Chrome and that you have the latest graphics drivers and version of AVPro Video.

    Thanks,
     
  26. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Are you sure that it's not a bandwidth issue?
    Also, tried upgrading network drivers?
     
  27. leoleoroy

    leoleoroy

    Joined:
    Jul 21, 2017
    Posts:
    5
    Hello:

    I used avpro to play VR video and I met a problem after update windows version.

    I play the video files are mkv(mkv Container and audio must be using the Opus codec encoded with Facebook Audio 360), and I checked the low latency option.

    My original windows version was 1803, and my video play is fluently.
    Then, After I updated to 1903, all video become very lag (likely 30fps -> 15fps)
    I try three different computers, all has this problem.

    But when I uncheck low latency option, the video play is well.(But uncheck low latency will order video and audio not synchronize in mkv)

    Any ideas for how we might resolve this issue?
    Thank you for your assistance:)

    My setting:

    Video encoding:Hevc
    Audio encoding:Opus
    Container:Mkv
    resolution: 4096x4096
    framerate: 29.97

    Unity Version:2018.3.10f1
    Avpro Plugin:1.10.0
    Hardware decoding: on
    Use low latency: on
    Audio mode: facebook audio 360
    Channel mode: (TBE_8_2)
     
    Last edited: Aug 20, 2019
  28. kuchida

    kuchida

    Joined:
    Dec 25, 2012
    Posts:
    5
    That is certain. Because I am trying to download and play a video from a locally hosted server.
    The video codec is VP9, can this be the cause of the problem?

    From the log, AVPro seems to stop downloading and decoding at the stiff part.
    If the same file is played locally instead of via the server, it will play smoothly.

    Windows and network drivers are also up to date.

    We really need some help : (
     
    Last edited: Aug 23, 2019
  29. mkneib

    mkneib

    Joined:
    Aug 3, 2016
    Posts:
    6
    your latest documentation says:

    ---
    Android
    ■ Improved loading with file offsets - now works from Android Asset
    Bundles, file:// URL scheme, OBB and ZIP files
    ---

    do you have a codesnippet how to open a videofile from an assetbundle?

    greetings
    micha
     
    Last edited: Aug 20, 2019
  30. Shane-Pangea

    Shane-Pangea

    Joined:
    Dec 12, 2012
    Posts:
    25
    Right out of the box, the sample demo scenes with this plugin are having issues with the video playback. The video frames stutter on the first few frames. The audio does however continue fine. This happens across multiple versions of Unity (2018.3.5, 2019.2, etc) and across multiple platforms (Standalone, Android, iOS). As well as both streaming and local videos.

    Here you can see it happening.


    Could this possibly be an issue with Mac's graphics card? Is anyone else experiencing this?

    Steps to recreate:
    1. Create a new Unity project
    2. Download and add latest plugin from AVPro Video website
    3. Open Demo scene (⁨Assets⁩ ▸ ⁨AVProVideo⁩ ▸ ⁨Demos⁩ ▸ ⁨Scenes⁩▸ ⁨01_Demo_BackgroundShader)
    4. Press Play in Editor

    System:
    • Macbook Pro (Retina, 15-inch, Mid 2014)
    • macOS Mojave 10.14.6
    • Processor: 2.5 GHz Intel Core i7
    • Memory: 16 GB 1600 MHz DDR3
    • Graphics: NVIDIA GeForce GT 750M 2 GB, Intel Iris Pro 1536 MB
     
  31. doom3214

    doom3214

    Joined:
    Jan 24, 2016
    Posts:
    7
    Unity 2019.1.7f1
    Version 1.9.17 (v1.10.0)
    Windows

    It seems there are times where the first frame ready is not called especially when auto play is off in the inspector + opening a file with auto play default false. Could you check on that? It seems to happen 1 out of 10. Do you think there any reason that first frame ready is not called? FinishedBuffering was called but FirstFrameReady was not. It gets called immediately after I force it to play.
     
    Last edited: Aug 23, 2019
  32. Shane-Pangea

    Shane-Pangea

    Joined:
    Dec 12, 2012
    Posts:
    25
    No, it still happens even when auto play is off and manually calling play. Even in a macOS Standalone it happens. It appears to be some issue with the Mac's graphics card. Really weird!
     
  33. Shane-Pangea

    Shane-Pangea

    Joined:
    Dec 12, 2012
    Posts:
    25
    I'm not sure if this helps, but here are the order of events being triggered on Mac vs Windows. The order of them are different. (Windows works fine, no stuttering frames.)

    Mac: (Stuttering frames)
    AVProVideo-Event-Stack-Mac.png

    Windows: (Looks good)
    AVProVideo-Event-Stack-Windows.PNG
     
  34. Shane-Pangea

    Shane-Pangea

    Joined:
    Dec 12, 2012
    Posts:
    25
    [SOLVED] Stuttering frame issue on Mac!

    After comparing the last two Output panels between Mac and Windows, I realized that the issue was running Metal on macOS. Disabling 'Metal Editor Support' in Project Settings made everything work great! Woohoo!
     
    AndrewRH likes this.
  35. doom3214

    doom3214

    Joined:
    Jan 24, 2016
    Posts:
    7
    I was having the issue on window though :(
     
  36. dezley

    dezley

    Joined:
    Aug 23, 2019
    Posts:
    1
    Hi, is there a reason as to why setting the httpHeaderJson is supported on some platforms but not on others?

    Specifically the following function:
    Code (CSharp):
    1. private string GetPlatformHttpHeaderJson()
    2.         {
    3.             string result = null;
    4.  
    5. #if UNITY_EDITOR_OSX
    6.             result = _optionsMacOSX.httpHeaderJson;
    7. #elif UNITY_EDITOR_WIN
    8. #elif UNITY_EDITOR_LINUX
    9. #elif UNITY_STANDALONE_OSX
    10.             result = _optionsMacOSX.httpHeaderJson;
    11. #elif UNITY_STANDALONE_WIN
    12. #elif UNITY_WSA_10_0
    13. #elif UNITY_WINRT_8_1
    14. #elif UNITY_IOS || UNITY_IPHONE
    15.             result = _optionsIOS.httpHeaderJson;
    16. #elif UNITY_TVOS
    17.             result = _optionsTVOS.httpHeaderJson;
    18. #elif UNITY_ANDROID
    19.             result = _optionsAndroid.httpHeaderJson;
    20. #elif UNITY_WEBGL
    21. #endif
    22.  
    23.             if (!string.IsNullOrEmpty(result))
    24.             {
    25.                 result = result.Trim();
    26.             }
    27.  
    28.             return result;
    29.         }
     
  37. Shane-Pangea

    Shane-Pangea

    Joined:
    Dec 12, 2012
    Posts:
    25
    This is what helped me get clarity about my GPU issues on Mac. It's from the AVProVideo Manual. It might help you diagnose your Windows issue.

    Screen Shot 2019-08-23 at 9.37.10 AM.png
     
  38. doom3214

    doom3214

    Joined:
    Jan 24, 2016
    Posts:
    7
    Thanks, I tested it but it doesnt solve it. From further testing, it seems firstframeready just doesn't work properly when its auto play to false. I can clearly see the debug log requiring to called started before firstframeready is called. Glad you able to solve yours though :).

    Dev, can you kindly test using h.265 60fps 4k videos, it seems that the issue that causing this. I tried using your default scene with a different video file and i am able to recreate this issue.
     
    Last edited: Aug 23, 2019
  39. Shane-Pangea

    Shane-Pangea

    Joined:
    Dec 12, 2012
    Posts:
    25
    Is the firstframeready issue only happening on a Windows standalone and/or in Editor? Are you seeing it on any other published platform?
     
  40. doom3214

    doom3214

    Joined:
    Jan 24, 2016
    Posts:
    7
    Standalone and editor. Haven't tested on any other platform but I'm certain it has something to do with h.265 4k 60fps videos. After more strain testing this is the cause of it. I use the demo scene they provided and firstframeready was not called if I call using that type of vid
     
  41. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    This is an known issue. It only affects Metal graphics API, and it only happens in the TRIAL version. It's also only on certain Mac's

    Thanks,
     
  42. Shane-Pangea

    Shane-Pangea

    Joined:
    Dec 12, 2012
    Posts:
    25
    Ah ok. Well at least you found the cause. Thats step #1. :) Looks like you (or someone) reported it to the repo yesterday. Good luck!
     
  43. Maven-Design

    Maven-Design

    Joined:
    Jul 1, 2015
    Posts:
    1
    Hello, I am using the latest version for Windows as well as MacOS.
    I have noticed that changing the playbackrate on Windows to 3 or higher, stops the playback.
    On Mac, users report that it stops playing with speed 2.5 (may be 2 and higher).
    The documentation says that up to speed 4 should be supported.

    Any advice would be appreciated, thanks.
     
  44. AndrewRH

    AndrewRH

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

    So playback-rate depend on a few things like:
    1) How the video is encoded
    - if the video is too high resolution/frame-rate, or the compression is too complex - then it will take too long to decode and increasing playback rate will be too expensive. You can encode videos so that they are faster to decode (at the expense of file size). For example using FFMPEG you can use the -tune fastdecode option.
    2) What hardware you're running on
    - the CPU and GPU are used for video decoding. If you increase the playback rate to 2x then you're asking the hardware to do double the work, so specs matter
    3) Operating system quirks

    Thanks,
     
    Maven-Design likes this.
  45. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Thanks for submitting this to GitHub, we'll follow up with this there
     
  46. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Some platforms just don't expose these options easily in their API's....
    In AVPro Video 2.x we will have this option available for Windows

    Thanks,
     
  47. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    I believe that is incorrect, it should say Android App Bundle (AAB). We don't support loading from Unity asset bundle files.

    Thanks,
     
  48. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    168
    Hello, I'm using the 360Sphere prefab to play some 4k videos on GearVR.
    I've noticed that looking straight ahead (no head rotation) the video play smoothly, but rotating the head 90 degrees on the left or on the right side the video is jerking.
    This issue does not happen in Editor, only on GearVR (+ Samsung Galaxy S8)
    Is there any way to avoid this annoying effect or is it limit of the graphic card of my device?
    Many thanks
     
  49. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,611
    Umm....that's WEIRD.....I've not heard of that before. I can't think of anything that would cause that.
     
  50. Xavier78

    Xavier78

    Joined:
    Oct 13, 2013
    Posts:
    20
    Hi I am using a "InsideSphereUnlit(Stereo) - Android OES ONLY" texture on my player, which looks fine in editor, but when I build out to Lenovo solo daydream the videos look dark, no changes to the render settings, or by adding a light has fixed it. It almost looks like Apply Gamma is stuck on(as whites still look white, but darks are to dark). Any ideas on how to make it brighter?

    FIX* So I fixed this by changing "PlayerSettings\OtherSettings\ColorSpace" from Linear to Gamma.
     
    Last edited: Aug 27, 2019