Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

[Released] AVPro Video - complete video playback solution

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

  1. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    206
    Hi,

    We don't have anything specific for that. However a few years ago someone created this: https://github.com/ScatterCo/avpro2playables . It was for a much older version of AVPro Video, but it might give you a starting point perhaps?

    Kind regards,
    Chris
     
    schema_unity likes this.
  2. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    206
    Hi,

    Are you using the latest version of AVPro Video?
    Which shader are you using?
    Does it look correct in Linear colourspace?
    What are the specs of the videos you are using?

    Kind regards,
    Chris
     
  3. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    206
    Hi Phil,

    Is it a black flicker?
    Are you using "low latency" streaming option?
    Is it a particular graphics card?
    What are the GPU/CPU work levels like when playing the video?
    What are the specs of the videos? resolution? FPS? bitrate?

    Kind regards,
    Chris
     
  4. julbrich

    julbrich

    Joined:
    Aug 17, 2022
    Posts:
    1
    Hello

    I was wondering if there was any planned support for VisionOS, and if/when that would be coming.
     
  5. ickydime

    ickydime

    Joined:
    Nov 20, 2012
    Posts:
    110
    I'm curious about the recommended playback rates in the documentation where it suggests 0.25, 0.5, etc. Are they recommended because playbackrate gets rounded to certain values?

    We would like to set playbackrate to precise numbers like 0.74736 and be constantly changing the rate as we are working on an exercise application where the faster the user goes, the faster the video should playback. If the user slows down it may drop to 0.44321 and then if they go real fast it could go to 1.2323 or similar.

    Something seems off (and I don't know if it is the video playback) but the video tends to reach its end before the actual distance is reached. The video's completion percentage increases faster throughout playback than the distance travelled so the delta between the video completion and the distance actually completed slowly grows throughout the workout.

    Soooo. Is there any rounding being done on playbackrate? In the editor when I set it, I can get it back out and it is identical so the variable itself isn't rounded.
     
  6. phileday

    phileday

    Joined:
    Feb 8, 2014
    Posts:
    112
    @Chris-RH

    Sorry I'm just replying, I didn't realise I was the last comment in the previous page.

    I'll answer as best as I can but there is a fundamental issue I has with reporting the problem.

    Is it a black flicker?
    I believe so.
    Are you using "low latency" streaming option?
    No, should I?

    Is it a particular graphics card?
    Not sure.

    What are the GPU/CPU work levels like when playing the video?
    Again not sure.

    What are the specs of the videos? resolution? FPS? bitrate?
    and a third time not sure.

    So as you can see the answers are very vague. This is because it's an issue that is being reported to me and something I've only noticed a couple of times myself. I'll say the the times I've noticed it it's been on a very high spec machine running Intel and an Nvidia card.

    As it's something that I personally can't reproduce I was wondering if you had ever come across these issues and if there is any advice on settings I might of put on that might be causing it. For instance would having "low latency" help or would multi thread rendering affect anything. I regularly update Unity (I'm on the 2022 builds) so it could well be solved in that.

    One quick question. I provide muxed subtitle support where possible. I'm using the language code to retrieve the relevant full names of the languages however AVPro seems to return a two letter language code when it should be three letters. For example "en" instead of "eng". In VLC it returns "eng". Is there a reason for this? In this case I can provide examples of videos (open source videos so no problem with sharing) that do this.

    Thanks for your help and thanks for making such a great plugin.

    Phil
     
  7. Ste-RH

    Ste-RH

    Joined:
    May 17, 2019
    Posts:
    130
    AVPro Video version 2.8.5 has just been released!

    DOWNLOAD THE FREE TRIAL VERSION HERE

    Changes include:

    General
    • Enhancements
      • #1627 Added support for scaling to the ResolveToRenderTexture component
    Android
    • Enhancements
      • #1619 Added ability to force TCP as the default RTP transport
    Windows
    • Fixes
      • Fixed issue with videos not playing in 32-bit builds
    iOS/macOS/tvOS
    • Fixes
      • Fixed issue with display aspect ratio (DAR) not being applied
      • #1460 Fixed issue with the colour transform not being applied correctly for full range (pc) videos
      • #1626 Fixed issue with ExtractFrame clearing the screen instead of the target render texture
      • #1625 Potential fix for crash

    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
     
  8. Ste-RH

    Ste-RH

    Joined:
    May 17, 2019
    Posts:
    130
    We plan on supporting VisionOS in AVPro Video version 3. We do not have a date for it's release, but are hoping to make it some point before the end of the year.
     
  9. ickydime

    ickydime

    Joined:
    Nov 20, 2012
    Posts:
    110
    Does AVPro round playbackrate? Currently testing in Windows and iOS. The docs have recommended rates but it is unclear why those rates are recommended.

     
  10. JimmyIGT

    JimmyIGT

    Joined:
    Dec 2, 2021
    Posts:
    1
    Hi I bought the core version and was wondering if there is a way to swap video's like the Video Playlist Beta but based on certain triggers to choose which video to play next? Essentially like a unity animator events system.

    We have a simple video base game where the character animations are videos and need swapping to the specific animation video. I have done this we the inbuilt video system enabling different video clips via an animator but it had hitching and bought this to eliminate it.

    Cheers,
    James
     
  11. frangagn

    frangagn

    Joined:
    Sep 20, 2018
    Posts:
    48
    Is there any way to disable the AVPRO Video logo on the video screen when the screen is idle or when an exception is encountered?
     
  12. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    119
    Hi,

    I'm a longtime Ultra Edition user and I'm having an issue on Android I never seen before, a strong "time jittering" behavior that appears everytime a video starts playing, and affecting everything in scene. I mean, not only the video timeline jumps back and forth but also the camera, the UI and everything else seems to literally jump back and forth in time together with the video stream.

    This is an app I developed more than a year ago and published on various platforms (WebGL, Windows, MacOS, Android, iOS and Oculus) without any problems. The issue started showing just on devices with the latest Android versions, while it's still correctly working on Android 10. No problems at all in editor.

    Following is a video showing the issue:

    The navigation movements are automatic (standard Unity "AI Navigation" package) and as you can see, everytime the player enters a trigger that starts a video, the problem occurs (0:25 and following, 1:48 and following,...) while it disappears when no videos are playing (first few seconds and from 1:03 to 1:47).

    Here's the usual Android settings i used for the video players:


    I also tried to change a few parameters - e.g. Exo Player instead of Media Player, disable Multithreaded Rendering and so on - without any success.

    The app is available on Google Play, in case you would test yourself:
    https://play.google.com/store/apps/details?id=com.EditriceNuovoMondosrl.GIUSSANI100&hl=en&gl=US

    The current Google Play version uses an older AVPro Video package but I tested it with the latest package, and the issue is still present.

    Hope you can suggest me a solution.
     
    Last edited: Sep 7, 2023
  13. cnsjjj

    cnsjjj

    Joined:
    Aug 13, 2022
    Posts:
    33
    I want to render a video on a plane. How can I control the aspect ratio of the video to achieve the scale to fit function. At the same time, fill the empty areas with black.
    The left side of the picture below is VideoPlayer, which contains the Aspect Ratio option. Setting it to fit inside can support this function. But I don’t know how AVPro can achieve similar functions.
    Can you give me some help and suggestions? Thank you very much!

    upload_2023-9-14_13-38-29.png

    upload_2023-9-14_13-38-56.png
     
  14. amz012_utida

    amz012_utida

    Joined:
    Nov 16, 2016
    Posts:
    4
    AVPro Video uses the latest version. I am using Unity uGUI defaults Due to the specifications of the app, it cannot be created with linear, so I have not confirmed it with linear. This is a 1080 x 1920 px, frame rate 28, average bit rate 4Mbps, MP4 video recorded using AVPro Movie Capture.
     
    Last edited: Oct 4, 2023
  15. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    206
    Hi @JimmyIGT,

    Its not something that we specifically support, but you should be able to code it. We have API documentation to help you with coding: https://www.renderheads.com/content/docs/AVProVideo/api/RenderHeads.Media.AVProVideo.html

    Kind regards,
    Chris
     
  16. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    206
    Our logo is only on the trial versions. It won't be one the version of the platform that you purchase it from.

    Kind regards,
    Chris
     
  17. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    206
    Hi @RiccardoAxed,

    What are the specs of the videos?
    How many are playing concurrently?
    Where are they playing from (local or streaming?)
    What Android version and device(s) have you tested on?
    Can you provide a full logcat?
     
  18. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    206
    Hi @cnsjjj

    If you use Display UGUI, you can stretch to fill
    https://www.renderheads.com/content/docs/AVProVideo/articles/component-display-ugui.html

    Kind regards,
    Chris
     
  19. cnsjjj

    cnsjjj

    Joined:
    Aug 13, 2022
    Posts:
    33
  20. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    119
    Just ordinary mp4, h264 at various resolutions, from hd 1920x1080 downwards. The video that starts at 30s in the clip I attached is just 800x600.

    Just one at a time.

    Both, always having the same problem.

    I tested the app on a Samsung S10 with Android 12 and it works without issues, but every other phone with Android 13 seems to have the problem. For instance, a Galaxy S23 Ultra (Android 13) has the problem.

    Ok I'll try to generate one as soon as possibile.
    Anyway, as I was saying in my previous post, the app is available on Google Play, so you could test yourself:
    https://play.google.com/store/apps/details?id=com.EditriceNuovoMondosrl.GIUSSANI100&hl=en&gl=US
     
  21. SB

    SB

    Joined:
    Nov 19, 2012
    Posts:
    5
    Hi, I have the following problem with MediaPlayer on macOS: I want to use MediaPlayer with Unity Audio. In MediaPlayer, I have set the AudioOutput to "Unity" in the settings for macOS. When the loaded video is played for the first time, the sound comes through Unity Audio, as desired. However, on repeated playback (loop, stop / play), the sound no longer comes through Unity Audio, but is output directly.

    This can be easily tested in the editor: Load a movie with audio into the MediaPlayer, activate "loop" and play the video in the Inspector (in editor mode). Since the sound is supposed to come via the AudioSource, nothing is correctly heard. When the video starts again from the beginning, you hear the sound via the direct output, which should not be the case.

    Or you send the output of the AudioSource into an AudioMixerGroup, and watch the level meter (in play mode). During the first pass of the video you see the audio signal on the level meter, from the second pass on you don't see it anymore.

    I hope you have a solution for this.
    ---
    Edit: I have since done builds for macOS and iOS to test the behavior, and unfortunately the problem also occurs in the build for both platforms.
     
    Last edited: Oct 12, 2023
  22. vertexx

    vertexx

    Joined:
    Mar 18, 2014
    Posts:
    350
    Forgive me if this has been asked before...Is it possible to replicate the Unity Camera's "Field of view" in your software?
    Sometimes I will set the main camera field of view to be 70 or even 90 but when recording the scene/project your capture app takes the camera back to the default 60 field of view. Can this (field of view) be changed using some method or another ?
    EDIT. Sorry..meant to mention this is on the component "capture from camera360".
     
    Last edited: Oct 14, 2023
  23. CaptainPyFace

    CaptainPyFace

    Joined:
    Apr 12, 2013
    Posts:
    9
    Hi I've noticed that if the Demo_MediaPlayer scene is streaming video via URL in a WebGL build, the video does not play in Safari Mac if sound is enabled, but does is sound is muted. Can this be fixed somehow? Safari iOS works fine btw as well as all the browsers I've tested
     
  24. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    206
    Hi @CaptainPyFace,

    We don't officially support WebGL, mostly because of various issues that come up with browser compatibility.

    For Safari, you need to make sure you are using WebGL 1.0.
    Are you auto-playing the media? In Safari, videos are not allowed to auto-play unless given permission by the user (in the preferences menu). This doesn’t affect videos that have no audio track. More details can be found here: https://webkit.org/blog/7734/auto-play-policy-changes-for-macos/ I wonder if you could start the video muted and then unmute it after a few frames?

    Kind regards,
    Chris
     
  25. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    206
    @vertexx

    No, its not possible.

    Kind regards,
    Chris
     
  26. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    206
    Hi @SB,

    That's strange.
    Can you reproduce this in a fresh project using just AVPro video?
    What version of AVPro Video are you using?
    Which Unity version are you using?
    Which macOS/iOS version?
    What are the specs of the videos used (codecs, resolution, FPS etc)?
    Are the videos streamed or played locally?

    Kind regards,
    Chris
     
  27. SpaceAgeInteractive

    SpaceAgeInteractive

    Joined:
    Feb 4, 2018
    Posts:
    65
    For anyone who is encountering the following error when building a Unity 2022 project for the Meta Quest with AVPro:

    Dependency ':exoplayer-datasource:' requires 'compileSdkVersion' to be set to 33 or higher.
    Compilation target for module ':launcher' is 'android-32'


    This error is due to Exoplayer requiring a min SDK level of 33 due to a Google Play Store requirement, but Meta requires a min SDK level no higher than 32 (as of 2023/11/01) so you cannot actually set the min SDK level to 33 otherwise Meta's build uploader will reject your build. In order to build with a min SDK level of 32 and bypass the error, you you must patch your installation of Unity 2022:

    1. In Unity, set the 'Minimum API Level' to Level 32. For the Meta Quest, you cannot currently set it any higher than this.
    2. Navigate to C:\UnityEditor\2022.3.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\GradleTemplates
    3. Create a backup of mainTemplate.gradle and launcherTemplate.gradle
    4. Open mainTemplate.gradle in a text editor and change the line compileSdkVersion **APIVERSION** to compileSdkVersion 33
    5. Change the line targetSdkVersion **TARGETSDKVERSION** to targetSdkVersion 32
    6. Repeat steps 3 and 4 for launcherTemplate.gradle
    7. Install Unity 2023 (I installed 2023.1.19f1) and navigate to the folder C:\UnityEditor\2023.1.19f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms
    8. Copy the android-33 folder into your Unity 2022 installation folder C:\UnityEditor\2022.3.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms
    9. Build the project and it should now work.

    More discussion about the problem can be found here.
     
  28. Ste-RH

    Ste-RH

    Joined:
    May 17, 2019
    Posts:
    130
    AVPro Video version 2.9.0 has just been released!

    DOWNLOAD THE FREE TRIAL VERSION HERE

    Changes include:

    General
    • Enhancements
      • #1059 | #1552 Added Paused and Unpaused events
      • #1627 | #1490 Added support for handling video orientation into the ResolveToRenderTexture component
    • Fixes
      • #1639 Fixed incorrect transform for videos that are landscape flipped
    Android
    • Changes
      • Upgraded ExoPlayer from 2.19.0 to 2.19.1
    • Fixes
      • When using the Unity audio pipe, samples from the buffer are now no longer drained/returned when video is paused
    • Enhancements
    iOS
    • Fixes
      • #1653 Fixed issue with Unity audio output mode failing due to changes in how the audio processing tap works with iOS 17
      • #1671 Disabled audio spectrum visualisation in the Media Player demo scene on iOS due to it causing GPU issues on certain devices with iOS 17

    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
     
  29. LoneSurvivor82_1

    LoneSurvivor82_1

    Joined:
    Jul 6, 2021
    Posts:
    9
    Hi,
    I wrote a simple backend-solution which is deployed on Azure to stream videos which are stored in an Azure blob storage back to the client. I need to send a Bearer Token for authorization because the service app is not configured for anonymous access.

    To test the general approach with AVPro Video, I setup a sample scene with AVPro trial version and I created a new Azure service app on anonymous access level with the same implementation in the endpoint. If I set the URL to this endpoint in the AVProVideo-component, everything works fine -> the video is played correctly in the player.

    If I set the URL of the endpoint to that controller in my token-based service app and I provide the Azure token by a custom HTTP Authorization Header, the code in the endpoint is entered (I can set a breakpoint there and the execution stops correctly) but the video isn't played and an error is shown in the Unity console: Error: Loading failed. File not found, codec not supported, video resolution too high or insufficient system resources.

    In your documentation it says: Custom HTTP header fields can be specified which can help with server side validation (requires using the WinRT API). This is only supported for adaptive media (HLS/DASH).

    I don't have adaptive media and I don't need it because I need the possibility to play videos in a company environment.

    Would it be possible to extend the asset to just support Custom Http Headers like Authorization with Bearer Token for "normal" streamed videos?
     
    Last edited: Nov 10, 2023
  30. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    206
    Hi @LoneSurvivor82_1

    Its now one of our possible future enhancements on github.

    Kind regards,
    Chris
     
    LoneSurvivor82_1 likes this.
  31. phileday

    phileday

    Joined:
    Feb 8, 2014
    Posts:
    112
    @Chris-RH

    I previously posted about a flicker that was happening in Media Foundation for some users (see post above). I've been sent an example of this happening on one of the users system:



    I experience this sometimes on my works system but not to this extent. Note that this isn't happening when using WinRT and that in the example video in the youtube video is actually paused. You didn't reply to my previous message, although you had released a new version so I think it just got lost in the mix. The example in the video is also using the latest AVPro Ultra build.

    If I can provide more information let me know.

    Phil
     
    Last edited: Nov 28, 2023
  32. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    206
    Hi @phileday

    It could be related to the GPU decoder being worked too hard - perhaps check in Task Manager > Performance > GPU tab to make sure the GPU video decoder isn't too high.
    It would be interesting to compare the results that you get using WinRT, Media Foundation and DirectShow. Also, out of interest, do you get the black flashes when using DirectShow?

    It would be interesting to know what GPU they are using. I wonder if a particular type is more prone to it. Also, are they using up to date GPU drivers.

    I would also disable anything not being used such as 'stereo support' and 'hap/notchlc support' and see if that helps.

    Another thing to test it to disable the audio, as it could be to do with the audio sample rate.

    Are all the streams that are being tested Youtube streams or are they from other sources too? It would be useful to know the specs of the video (and its audio).

    Kind regards,
    Chris
     
  33. Orkhyd

    Orkhyd

    Joined:
    Jan 6, 2021
    Posts:
    1
    Hi, do you have any plan of supporting the SRT video protocol for AVPro ?
     
  34. Chris-RH

    Chris-RH

    Joined:
    Apr 21, 2022
    Posts:
    206
    Hi @Orkhyd,

    It’s not natively supported on any of the platforms at the moment, so quite unlikely in the short term.

    Kind regards,
    Chris
     
  35. phileday

    phileday

    Joined:
    Feb 8, 2014
    Posts:
    112
    This is the weird thing. Whenever I've seen the issue it's been on a more powerful computer than my own. In fact I can max out the GPU on my own computer without getting the issue.

    The biggest problem I've got is that I can't find a way to recreate it. It works fine on my lower powered machine.

    Regarding the content, it appears to mostly be of the adult Varity. These tend to be very high resolution and stereo.

    Interesting you mention Stereo support. So in Whirligig all stereo work is done by me. I go into the apply to materials script and remove all the reformatting of any materials. The only thing I want the player to do it display the full frame without trying to do any stereo formatting itself. This used to be a problem as Media Foundation tried to take over the stereo rendering and would only show one eye. You now have a way of disabling that behavior which I use. Is there any chance it could be to do with that?

    Sorry I can't be more useful. I've only had this reported to me and very rarely I see it on my work PC (not my PC) which is the higher end one. The GPU in that is NVidia GeForce RTX 3080.

    I'll look into your suggestions and see if I can come up with a better way of recreating the issue. Thanks for the help.

    Phil