Search Unity

[Released] AVPro Video - complete video playback solution

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

  1. phileday

    phileday

    Joined:
    Feb 8, 2014
    Posts:
    123
    Hi all

    I make a media player that works on Windows and android and I'm looking at adding an option to play from shared network locations. Is it possible to play from a share network with AVPro? The standard address doesn't work "\\examplenetwork\temp\example.mp4". Is there something I'm missing?

    Regarding network locations help from anyone who has a better understanding than me would be very apricated. Listing network locations using C# in Unity would be good. If anyone knows any resources that would help please let me know.

    All the best

    Phil
     
  2. phileday

    phileday

    Joined:
    Feb 8, 2014
    Posts:
    123
    I've been researching a lot today and one thing I've found is that AVPro will play from an IP address but not a name mapping, so for example.
    \\192.161.8.101\videos\example.mp4
    works but
    \\myshares\video\example.mp4
    doesn't

    So I'm currently trying to find out a way to list all the ip address for shared drives, work out how to list the folders in the root of the drive (for some reason this doesn't work like it should), work out how to put in the password and username and make it work on Android.

    If anyone can help. I would be happy to pay a freelancer to work this out with me. Please let me know.
     
  3. applet_llc

    applet_llc

    Joined:
    Feb 1, 2018
    Posts:
    4
    Dear phieday san

    I know that if the shared folder is on a Windows PC, I can use WebDAV to show it on the network so that I can play it from AVPro Video.
    I am using the following WebDAV client module in an app called Channel Player to play it in AVPro Video's Player.

    WebDav.Client 2.7.0 by skazantsev MIT License.
    https://www.nuget.org/packages/WebDav.Client/

    Meta Quest2 version of Channel Player
    https://www.oculus.com/experiences/quest/3655438977836731/
    SteamVR version of Channel Player
    https://store.steampowered.com/app/1156810/Channel_Player/
     
  4. phileday

    phileday

    Joined:
    Feb 8, 2014
    Posts:
    123
    Thanks for the reply. I'll look into that and see if I can get it working with Whirligig :)
     
  5. applet_llc

    applet_llc

    Joined:
    Feb 1, 2018
    Posts:
    4
    Thank you for your reply.
    SMB and DLNA libraries are also in nuget, but I'm not sure about the implementation to pass to the Video Player, so I'm putting them on hold.
     
  6. tomicz

    tomicz

    Joined:
    Mar 16, 2015
    Posts:
    152
    Is it possible to record in-game audio and microphone audio at the same time on iOS?
     
    Last edited: Jan 26, 2023
  7. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    222
  8. tomicz

    tomicz

    Joined:
    Mar 16, 2015
    Posts:
    152
    Chris-RH likes this.
  9. avclubvids

    avclubvids

    Joined:
    Jan 6, 2015
    Posts:
    27
    I've just noticed that there is what appears to be a Gamma shift between what Quicktime and other video players read from an h265 and what AVPro/Unity reads. Color is the same inside Unity as it is on Android devices, so I assume this is more of an Android thing than an AVPro thing. Is this a known issue, and does it have a solution? Even just knowing what an h265 video is expected to be in terms of gamut and gamma would be all I need to make it look the way I want it to. Example of Quicktime (top) vs. AVPro (bottom):
    Screenshot 2023-02-07 at 12.09.53 PM.png Screenshot 2023-02-07 at 12.09.33 PM.png
     
  10. bbangerter

    bbangerter

    Joined:
    Sep 17, 2014
    Posts:
    7
    We are currently using the built in unity video player, but on lower end machines we are noticing audio stuttering when playing some of our videos.

    So I downloaded the trial version of AVPro to test against to see if this would resolve our issue. I have been able to get the AVPro player working in editor, but when I do a build and run our app none of the videos play. Is this a limitation of the trial version? eg, won't run in an actual build? In editor, everything is working fine, displaying the watermark as expected for the trial version.
     
  11. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    222
    Hi @avclubvids

    1. Which devices are you seeing issues with?
    2. Have you compared the results using Unity's videopplayer?
    3. Are you playing using our Mediaplayer demo scene and which API?
    4. Which shader are you using?
    We have certainly noticed that there is a difference in colour on Android devices, which is the same if played using AVPro Video or Unity Videoplayer. It might be GPU/device related.

    Kind regards,
    Chris
     
  12. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    222
    Hi @bbangerter,

    Would you be able to fill out a bug template on our github page, so we can get a better idea of what devices and video specs you are using please. https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues
    The Trial version is the same as the regular version, but watermarked, so there should be no issues building with it.

    Kind regards,
    Chris
     
  13. Ste-RH

    Ste-RH

    Joined:
    May 17, 2019
    Posts:
    145
    AVPro Video version 2.7.2 has just been released!

    DOWNLOAD THE FREE TRIAL VERSION HERE

    Changes include:

    macOS/iOS/tvOS
    • Fixes
      • #1440 Fixed issue with changes to the "Resume playback after audio route change" flag not being observed after player creation
      • #1440 Fixed issue with playback not being resumed when restoring the application to the foreground

    Download Links

    Editions

    On the Unity Asset Store we've made several editions of AVPro Video available so you can pick the one that's best for your project:

    Core Edition
    Core Windows Edition
    Core Android Edition
    Core macOS/iOS/tvOS Edition
    Ultra Edition
    • Enterprise Edition (contact us for multi-site licensing / support options)

    You can read this page to learn more about the features, pricing and upgrades for the different editions.

    DOWNLOAD THE FREE TRIAL VERSION HERE

    Thanks to everyone who reported bugs or feature requests! We're looking forward continuing to support this product into the future and adding more features.

    Please report any issues to our Github Issues
     
  14. bbangerter

    bbangerter

    Joined:
    Sep 17, 2014
    Posts:
    7
    I figured out my issue. I had not moved my mp4's to the streamingassets folders.
     
    Chris-RH likes this.
  15. avclubvids

    avclubvids

    Joined:
    Jan 6, 2015
    Posts:
    27
    Hi Chris! Answers:
    1. I'm on a Meta Quest 2 for this issue
    2. I have not tried the default Unity video player, but I have tried DeoVR playing the same h265 on the headset and got the same incorrect color – do you know if they are using their own video player or are they AV Pro under the hood? I'll try the Unity video player next to see if there is a difference in the editor or headset.
    3. I'm using my own scene but I used the demo scene as a reference when building it. I'm using the Exo Player API and enabled OES.
    4. I'm using the AVProVideo/VR/InsideSphere Unlit (stereo+color) - Android OES ONLY shader
    The one theory that I have right now is that it's possible that Unity or maybe Android are not reading the gamut/gamma flags in the movie file correctly, or at all. But what I want to know is what do they expect it to be, and I can just make it that.
     
  16. avclubvids

    avclubvids

    Joined:
    Jan 6, 2015
    Posts:
    27
    Unity video player (UVP) definitely has different color than AVPro, but still not the same as Quicktime player (a comparison screenshot is attached below). I discovered a few more things worth mentioning as possible contributors to the gamut/gamma shifts:
    1. The project was set to Linear color space, I changed it to Gamma and UVP got closer to correct, but AVP did not change
    2. The UVP will not play media from the Streaming Assets folder AFAIK, so I had to copy it into another folder for testing. There is an sRGB toggle when a video is not in Streaming Assets, is this flag used for anything?
    3. I tried adding a DisplayP3 color gamut in the project settings but it did not change anything in the Editor
    *EDIT: I forgot to upload the image, sorry:
    Screenshot 2023-02-14 at 12.42.24 AM.png
     
    Last edited: Feb 15, 2023
  17. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    222
    @avclubvids,

    Out of interest, are you using the OES path for Android?

    Kind regards,
    Chris
     
  18. Ste-RH

    Ste-RH

    Joined:
    May 17, 2019
    Posts:
    145
    AVPro Video version 2.7.3 has just been released!

    DOWNLOAD THE FREE TRIAL VERSION HERE

    Changes include:

    macOS
    • Fixes
      • Fixed issue with Hap videos not displaying
    iOS/tvOS
    • Fixes
      • #1449 Fixed issue with background audio playback

    Download Links

    Editions

    On the Unity Asset Store we've made several editions of AVPro Video available so you can pick the one that's best for your project:

    Core Edition
    Core Windows Edition
    Core Android Edition
    Core macOS/iOS/tvOS Edition
    Ultra Edition
    • Enterprise Edition (contact us for multi-site licensing / support options)

    You can read this page to learn more about the features, pricing and upgrades for the different editions.

    DOWNLOAD THE FREE TRIAL VERSION HERE

    Thanks to everyone who reported bugs or feature requests! We're looking forward continuing to support this product into the future and adding more features.

    Please report any issues to our Github Issues
     
  19. avclubvids

    avclubvids

    Joined:
    Jan 6, 2015
    Posts:
    27
    Yes, I'm using OES with the Exo Player API and the shader I'm using is "AVProVideo/VR/InsideSphere Unlit (stereo+color) - Android OES ONLY"
     
  20. WayneVenter

    WayneVenter

    Joined:
    May 8, 2019
    Posts:
    56
    @AndrewRH How can I disable or replace the default "bleep" when you start a video playback, its way to high pitch and a little annoying. I use scripting to call mediaplayer.Play(), but can't find any Inspector element on the MediaPlayer that sets this audio bleep.
     
  21. WayneVenter

    WayneVenter

    Joined:
    May 8, 2019
    Posts:
    56
    OK, this is odd, the bleep only plays when doing in editor, when building to Android it's not there, so ignore the request, but leaving it here for anyone else getting a bleep at play start in editor.
     
    Chris-RH likes this.
  22. avclubvids

    avclubvids

    Joined:
    Jan 6, 2015
    Posts:
    27
    @Chris-RH – by any chance would you recommend I switch to URP or HDRP for this project? I'm using the built-in pipeline, and I do have the Post Processing stack v2 in use, so I'm looking into workflows now that might be able to leverage the PPSv2 color tools to reverse whatever the heck is causing the shift shown in my original post.
     
  23. avclubvids

    avclubvids

    Joined:
    Jan 6, 2015
    Posts:
    27
    As a band-aid, I used the Post Processing Stack v2's color correctors to get an eye match between Unity/Android and Quicktime. It ain't pretty but at least it's close enough to what it should be until there is an objective way to get AVP to read the media with the same color as Quicktime and other video players:

    Screenshot 2023-02-24 at 8.03.41 PM.png
     
  24. Philkrom

    Philkrom

    Joined:
    Dec 26, 2015
    Posts:
    90
    Hello, is there somewhere a recent tutorial about building a 360 videoplayer with AVProVideo for Oculus Quest or OpenXR ?
    Thanks for your answer.
    Philippe
     
  25. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    222
    Philkrom likes this.
  26. Philkrom

    Philkrom

    Joined:
    Dec 26, 2015
    Posts:
    90
    Thanks for your answer, Chris.
    Of course, I have seen this scene is included in the package. I was just wondering if I could find somewhere a package already set up for XR, including controls, mediaPlayerUI, thumbnails playlist, btns for video options (Mono, stereo TopBottom/LeftRight, 360/180/flat...), environment etc. A ready to go VR player based on your asset. This would be a big timesaver even if this is a paid addon. Does anything like that exist ?
    Best regards.
    Philippe
     
  27. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    222
    Hi Philippe,

    No, we leave that as an exercise for the developer. Requirements vary so much between platforms and use-cases that it would inevitably be set up wrong for a lot of people.

    Kind regards,
    Chris
     
  28. n_saikiran

    n_saikiran

    Joined:
    Sep 1, 2016
    Posts:
    20
    I have been using the latest free trial version of AV Pro Movie Capture, using the "Capture from screen" component.
    Attached is the screenshot of settings being used.

    When I record the video in Unity Editor, everything is working as desired. But in standalone build, the video is coming in a dark tone. I am using Linear color space on Windows platform.

    Can you let me know what am I missing here?
     

    Attached Files:

  29. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    222
    Hi @n_saikiran,

    Could you fill out a complete issue form on our github please: https://github.com/RenderHeads/UnityPlugin-AVProMovieCapture/issues
    Could you include test videos to show the difference and also include a capture PNG to see if that is correct

    Kind regards,
    Chris
     
  30. n_saikiran

    n_saikiran

    Joined:
    Sep 1, 2016
    Posts:
    20
    Hi @Chris-RH, thanks for the quick response.
    Following is the issue submitted on github with all the details you have asked.
    https://github.com/RenderHeads/UnityPlugin-AVProMovieCapture/issues/270

    Capture from Screen with output target as image sequence is working as desired in standalone build but output target as video is giving darkish videos.
     
  31. jiro0309

    jiro0309

    Joined:
    Oct 11, 2022
    Posts:
    19
    Hi, Video is working well on Unity Editor, but I cant see video after build PC version, can you please help me to solve this problem?
     
  32. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    222
    Hi @jiro0309,

    Are you streaming the video from a URL or playing from Streaming assets?
    Are you building and testing on the same device as Unity Editor?

    Kind regards,
    Chris
     
  33. n_saikiran

    n_saikiran

    Joined:
    Sep 1, 2016
    Posts:
    20
    @Chris-RH From the documentation, got to know that CameraCapture is more expensive than ScreenCapture
    https://www.renderheads.com/content/docs/AVProMovieCapture/articles/usage-camera-capture.html

    1. Are there any other optimization settings which we can set when capturing video in a complex scene - Currently, the captured video is not being played smoothly?

    2. Should we set the Application target frame-rate? Right now, I am not setting any for the Standalone build. Does it have any affect on the video that is being captured?

    3. Also, in the ScreenCapture how can we set the resolution of video? I had found the resolution setting in CaptureFromCamera component but couldn't find it in CaptureFromScreen component.
     
  34. jiro0309

    jiro0309

    Joined:
    Oct 11, 2022
    Posts:
    19
    @Chris-RH
    I built sample video scene - Demo_360Stereo, and run it after build, but only black screen also.
     
  35. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    222
    @jiro0309

    Are you streaming from a URL or from a path?
    Is this just running the default demo with no alterations?

    Kind regards,
    Chris
     
  36. qilin598866753

    qilin598866753

    Joined:
    Nov 28, 2021
    Posts:
    20
    Hi, when i destroy a MediaPlayer, some Error debug come:
    03-25 10:54:16.086
    ERROR

    /BufferQueueProducer(21258): [SurfaceTexture-26-21258-0](id:530a00000000,api:3,p:21258,c:21258) detachBuffer: slot 0 is not owned by the producer (state = FREE)
    03-25 10:54:16.086
    ERROR

    /BufferQueueProducer(21258): [SurfaceTexture-26-21258-0](id:530a00000000,api:3,p:21258,c:21258) detachBuffer: slot 1 is not owned by the producer (state = FREE)
    03-25 10:54:16.086
    ERROR

    /BufferQueueProducer(21258): [SurfaceTexture-26-21258-0](id:530a00000000,api:3,p:21258,c:21258) detachBuffer: slot 2 is not owned by the producer (state = FREE)
    03-25 10:54:16.086
    ERROR

    /BufferQueueProducer(21258): [SurfaceTexture-26-21258-0](id:530a00000000,api:3,p:21258,c:21258) detachBuffer: slot 3 is not owned by the producer (state = FREE)
    03-25 10:54:16.086
    ERROR

    /BufferQueueProducer(21258): [SurfaceTexture-26-21258-0](id:530a00000000,api:3,p:21258,c:21258) detachBuffer: slot 4 is not owned by the producer (state = FREE)
    03-25 10:54:16.086
    ERROR

    /BufferQueueProducer(21258): [SurfaceTexture-26-21258-0](id:530a00000000,api:3,p:21258,c:21258) detachBuffer: slot 5 is not owned by the producer (state = FREE)
    03-25 10:54:16.086
    ERROR

    /BufferQueueProducer(21258): [SurfaceTexture-26-21258-0](id:530a00000000,api:3,p:21258,c:21258) detachBuffer: slot 6 is not owned by the producer (state = FREE)
     
  37. qilin598866753

    qilin598866753

    Joined:
    Nov 28, 2021
    Posts:
    20
    it seems no effect on video play, but i am nor sure. My device is HONOR (ANY-AN00), Android 11
     
  38. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    222
    @n_saikiran ,

    I think you meant to post on the Movie Capture forum: https://forum.unity.com/threads/released-avpro-movie-capture.120717/

    1. Make sure that you are using good enough hardware.
    Offline render should produce a better result if you are able to use it.
    Make sure that the profiler and any logging is disabled.

    2. I'd leave application target rate as it is.

    3. It will capture at whatever resolution you have already set your screen to be.
     
  39. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    222
    @qilin598866753,

    I believe this is an exoplayer issue. It shouldn't cause any problems.
    Are you using flutter or adverts too by any chance?
     
  40. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,096
    Hi,
    Is there a roadmap available?
    I am interested in this asset but need DRM support. Would like to know if you plan to integrate it and what's the time schedule for this.
     
  41. ryan_unity372

    ryan_unity372

    Joined:
    Jun 29, 2021
    Posts:
    8
    Hello, when using the video speed features, is there any way to make sure the pitch does not change? Or at least change much? I am using AVPro on Android.
     
  42. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    222
    Hi @Hosnkobf,

    DRM support is something that we are planning on implementing, but we don't have a specific time schedule for it. We're a small team who also work on other projects, so it will get implemented when we have time to focus on it.

    Kind regards,
    Chris
     
  43. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    222
    Hi @ryan_unity372,

    We don't have any specific settings that do that. It is just something that naturally occurs when increasing the audio speed.
    I wonder if you set the audio output to Unity and then script it to change the pitch when seeking via the audio source?

    Kind regards,
    Chris
     
  44. ryan_unity372

    ryan_unity372

    Joined:
    Jun 29, 2021
    Posts:
    8
    I am currently using the Unity AudioSource output. The AudioOutput.cs class sets the audiosource.pitch to the rate of the video so they match.

    In the AudioOutput.cs class, I tried commenting out the line that sets

    audioSource.pitch = rate;

    and it just desynchronized the time of the audio to the video. Any workarounds you can think of as a possible solution to this?
     
  45. ryan_unity372

    ryan_unity372

    Joined:
    Jun 29, 2021
    Posts:
    8
    Following on from this, I've added the Pitch Shifter effect to the output channel on the audiomixer as a solution. It's not the best quality, but does what it needs to do.
     
    Chris-RH likes this.
  46. qilin598866753

    qilin598866753

    Joined:
    Nov 28, 2021
    Posts:
    20
    Hi, My project use video frequently, in order to completely unload the video, i destroy the old MediaPlayer when play new one (because MediaPlayer in diffrent gameobject, it's difficult to reuse). After a period of time, Exception appears:
    AndroidJavaException

    android.net.ConnectivityManager$TooManyRequestsException

    1
    android.net.ConnectivityManager$TooManyRequestsException
    2
    android.net.ConnectivityManager.convertServiceException(ConnectivityManager.java.3609)
    3
    android.net.ConnectivityManager.sendRequestForNetwork(ConnectivityManager.java.3797)
    4
    android.net.ConnectivityManager.registerDefaultNetworkCallback(ConnectivityManager.java.4289)
    5
    android.net.ConnectivityManager.registerDefaultNetworkCallback(ConnectivityManager.java.4256)
    6
    com.google.android.exoplr2avp.scheduler.RequirementsWatcher.registerNetworkCallbackV24(RequirementsWatcher.java.135)
    7
    com.google.android.exoplr2avp.scheduler.RequirementsWatcher.start(RequirementsWatcher.java.90)
    8
    com.google.android.exoplr2avp.offline.DownloadManager.<init>(DownloadManager.java.279)
    9
    com.google.android.exoplr2avp.offline.DownloadManager.<init>(DownloadManager.java.231)
    10
    com.renderheads.AVPro.Video.Player_ExoPlayer.InitialisePlayer(Player_ExoPlayer.java.38)
    11
    com.renderheads.AVPro.Video.Player_Base.Initialise(Player_Base.java.57)
    12
    com.renderheads.AVPro.Video.Manager.CreatePlayer(Manager.java.30)
    13
    com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    14
    com.unity3d.player.UnityPlayer.access$600(Unknown Source.0)
    15
    com.unity3d.player.UnityPlayer$g$1.handleMessage(Unknown Source.150)
    16
    android.os.Handler.dispatchMessage(Handler.java.102)
    17
    android.os.Looper.loop(Looper.java.233)
    18
    com.unity3d.player.UnityPlayer$g.run(Unknown Source.20)
    19
    UnityEngine.AndroidJNISafe.CheckException () (at <00000000000000000000000000000000>.0)
    20
    UnityEngine.AndroidJNISafe.CallObjectMethod (System.IntPtr obj, System.IntPtr methodID, UnityEngine.jvalue[] args) (at <00000000000000000000000000000000>.0)
    21
    UnityEngine.AndroidJavaObject._Call[ReturnType] (System.String methodName, System.Object[] args) (at <00000000000000000000000000000000>.0)
    22
    RenderHeads.Media.AVProVideo.MediaPlayer.CreateMediaPlayer (RenderHeads.Media.AVProVideo.MediaPlayer+OptionsAndroid options) (at <00000000000000000000000000000000>.0)
    23
    RenderHeads.Media.AVProVideo.MediaPlayer.CreateMediaPlayer () (at <00000000000000000000000000000000>.0)
    24
    RenderHeads.Media.AVProVideo.MediaPlayer.Initialise () (at <00000000000000000000000000000000>.0)
    25
    RenderHeads.Media.AVProVideo.MediaPlayer.OpenMedia (System.Boolean autoPlay) (at <00000000000000000000000000000000>.0)
    26
    RenderHeads.Media.AVProVideo.MediaPlayer.OpenVideo (System.String path, System.Boolean autoPlay) (at <00000000000000000000000000000000>.0)
    27
    StandaloneDialog.ConfigInfo (StandaloneDialog+DialogConfig config, UILabel contextLabel, UILabel npcNameLabel, UnityEngine.GameObject heroAv, TypewriterEffect typewriter) (at <00000000000000000000000000000000>.0)
    28
    StandaloneDialog.ShowId (System.Int32 id) (at <00000000000000000000000000000000>.0)
    29
    StandaloneDialog+<ShowAllCor>d__62.MoveNext () (at <00000000000000000000000000000000>.0)
    30
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <00000000000000000000000000000000>.0)
     
    Last edited: Mar 31, 2023
  47. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    222
  48. qilin598866753

    qilin598866753

    Joined:
    Nov 28, 2021
    Posts:
    20
  49. VadimWG

    VadimWG

    Joined:
    Jul 22, 2021
    Posts:
    2
    Hi.
    When I try to play a video in my game using DisplayUGUI component and Unity mask, it works completely fine on both Unity Editor and on Android, but it has some black squares on iOS. Maybe you can advise what might be a reason for this?
     

    Attached Files:

  50. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    222
    @vadim-wgames

    I'm not sure, is it perhaps a transparency issue?

    Kind regards,
    Chris