Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

[Released] AVPro Video - complete video playback solution

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

  1. inthenighttime

    inthenighttime

    Joined:
    Jun 5, 2018
    Posts:
    3
    Yes the issue is as I move the camera it is not headtracking moving the spatial image. I.E a sound on the right if I move the camera to the right should sound centered but moving the camera does not change the spatial image at all as it should. The ambisonic spatial sphere is staying stagnant in one position no matter the movement of the camera. Defeats the purpose of having spatial audio if it doesn't react to camera movement.
     
  2. m4lumm

    m4lumm

    Joined:
    Nov 15, 2012
    Posts:
    15
    Hi. We are using version 2.0.6 and have experienced the crash with every version since, including today's release (2.0.10). The crash happens in Unity and in a Windows 10 player. It only happens when playing (local or stream) Hap Alpha files. It only happens on certain machines. I have emailed my system report to your team.

    Thanks for the support! We really love the tool and our only issue is with Hap Alpha files (which is important to one of our projects).
     
  3. rosssssss

    rosssssss

    Joined:
    Jan 27, 2017
    Posts:
    32
    Thanks, the videos are streaming from the internet.
     
    Last edited: Mar 30, 2021
  4. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    Did you email to unitysupport@renderheads.com? Don't see your email. Sounds like it might be a hardware issue though, could you please provide more details about the different hardware you're using in your email.

    Thanks.
     
  5. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,708
    Hi All,

    AVPro Video version 2.0.11 has just been released!

    Changes include:

    Android
    • Fixed
      • Shader compile error in VR OES shaders
      • Material variable setting bug which stopped OES mode rendering

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

    Thanks,
     
  6. rosssssss

    rosssssss

    Joined:
    Jan 27, 2017
    Posts:
    32
    Hello, we're currently live-streaming some of our content and then viewing with AVPro in Android - what I'm wondering is does AVPro have some kind of built in buffering system that would allow us to store say the last 15 minutes of footage - so that the user can skip back about and rewatch segments? Or is there some other standard way of doing this - like with the m3u8 stream server itself somehow?
    Thanks!
     
    Last edited: Apr 1, 2021
  7. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    Hi @inthenighttime

    We currently only expose direction and loudness i.e. rotation. The API does have a notion of a small delta of a single unit (so an offset of about a metre) that we could expose. If this is something you'd like us to do please log a feature request on our Github here with a description: https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues?q=is:issue+is:open+sort:updated-desc.

    Thanks.
     
  8. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    Hi @rosssssss
    Android caching support will be out in our 2.1.0 release but unfortunately this will not include support for live-streams as it's not currently a feature of ExoPlayer.
     
  9. shubhank008

    shubhank008

    Joined:
    Apr 3, 2014
    Posts:
    86
    Are internal/video embedded subtitles supported ? That seems to be a big trouble for non-english video playback supportf or unity with subtitles as part of the video (soft subs)
     
  10. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    Hi @shubhank008

    AVPro Video supports embedded text tracks as well as sideloaded SRT files. Please see the following link for more details: https://www.renderheads.com/content/docs/AVProVideo/articles/feature-subtitles.html.

    If you would like to test your use case please see our free trials here: https://github.com/RenderHeads/UnityPlugin-AVProVideo/releases.

    Thanks!
     
  11. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    102
    I have a peculiar situation where AVPro for Mac module will work correctly when I do a straight up build, but it wont work when I build to an xcode project. Any idea Why this might be?

    I have the following error in XCode:

    DllNotFoundException: AVProVideo

    at (wrapper managed-to-native) RenderHeads.Media.AVProVideo_OSXMediaPlayer.AVPPluginRegister()

    at RenderHeads.Media.AVProVideo_OSXMediaPlayer.Initialise () [0x0000d] in <348880e9499c43409aadd3067715db3b>:0

    at RenderHeads.Media.AVProVideo_OSXMediaPlayer..cctor () [0x00016] in <348880e9499c43409aadd3067715db3b>:0

    Rethrow as TypeInitializationException: The type initializer for 'RenderHeads.Media.AVProVideo_OSXMediaPlayer' threw an exception.

    at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr)

    at RenderHeads.Media.AVProVideo.MediaPlayer.CreatePlatformMediaPlayer () [0x00002] in <348880e9499c43409aadd3067715db3b>:0

    at RenderHeads.Media.AVProVideo.MediaPlayer.Initialise () [0x00000] in <348880e9499c43409aadd3067715db3b>:0

    at RenderHeads.Media.AVProVideo.MediaPlayer.Start () [0x00008] in <348880e9499c43409aadd3067715db3b>:0


    I checked already the plugins/x86 and plugins/x86_64 folder dlls and they seem to be correctly set.
     
  12. m4lumm

    m4lumm

    Joined:
    Nov 15, 2012
    Posts:
    15
    Hello. Do left-right and top-bottom alpha packed .MP4 files work on Android? It does not seem to be working for us. In that case, what alpha file format do you suggest for Android devices? Thanks!
     
  13. blevok

    blevok

    Joined:
    Feb 16, 2017
    Posts:
    65
    Hello, i own version 1 for android and windows, and i would like to upgrade both to version 2 core, because i want the expanded subtitle features and other benefits, but i see a possible issue that could prevent me from being able to upgrade.

    On this page(link) the editions chart says that Hap and NotchLC codecs are watermarked on windows and android, but the footnotes say "Hap Codec only supported on Windows and macOS platforms" and "NotchLC Codec only supported on Windows platform".

    That sounds like it will play with a watermark on windows but not play on android, but that contradicts what the chart says. So will it play on windows with a watermark, and not play at all on android? Or will it play on both platforms with a watermark?

    If it will play on either platform, how can i detect the codecs or the watermark and prevent the file from playing at all? I don't want the users to see a watermark under any circumstances, i would rather the video just not be able to play.

    And one other question, regarding the auto detection of stereo packing. Can i prevent it from auto detecting the stereo packing and only set it explicitely in code?

    Thanks.
     
  14. MMeyers23

    MMeyers23

    Joined:
    Dec 29, 2019
    Posts:
    65
    Hi, it seems I am unable to successfully apply the video to a material that uses a cubemap texture input. The shader in question only receives textures that are formatted by unity as cube texture (ie not 2d textures). AVPro applies the texture to my material, however it does not display in runtime, presumably because it is not in the correct texture format. The video works when applied to the AVPro built in shaders, but I do not wish to use those. My shader I am using is rather simple, and works with any cube formatted texture. It seems like it should be a simple task to apply the video to my material in this format. Any guidance?
     
  15. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    Hi @richardzzzarnold,

    Which version of AVPro Video are you using?
     
    Last edited: Apr 12, 2021
  16. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    102
    I am using AVPro Video 1.x (MacOS) 1.10.1, with Unity 2020.2.0a9, and XCode12.2.
     
  17. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    Thanks. Could you please try updating to the latest version of AVPro 1.x (1.11.7) as a first point of call?
     
  18. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
  19. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    Hi @blevok

    Currently Android supports neither Hap or NotchLC. There's a small error in the documentation, where it says they will play with a watermark on the Core version - that's the plan, but currently they do not play at all. So for now, you won't run into this problem.

    In terms of auto-detection of stereo packing - if the metadata is there for stereo packing it will auto detect - but if it doesn't have metadata for stereo packing you could set this explicitly.

    Thanks.
     
  20. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    Hi @MMeyers23

    We do not output textures as cube maps. Could you not duplicate and modify our AVProVideo/Skybox/3x2 Cube shader?

    Thanks.
     
  21. blevok

    blevok

    Joined:
    Feb 16, 2017
    Posts:
    65
    Okay thanks for the response, but this is very concerning. It sounds like i will see a watermark on windows now, and at some point the same may happen on android. I need a way to prevent this, but i don't see anything in the API docs that provide codec info, so can that be added somewhere, or at least a way to detect if a watermark is applied?
    Why would the core version even be designed to play those codecs if they're reserved for only the ultra version?

    This is a major problem, and i think i can't upgrade either platform because of it. If i use version 2 for android and version 1 for windows, there will probably be a lot of conflicts due to having both versions in the same project. I really need a way to guarantee that no watermark will ever be seen by the users.


    Are you saying there's no way to prevent stereo settings from automatically changing if the metadata is present? Is there at least an event or some way to know that packing settings will automatically change so i can update my UI buttons?
     
  22. inthenighttime

    inthenighttime

    Joined:
    Jun 5, 2018
    Posts:
    3
    Thanks for your reply I fear I'm not clearly stating the issue. If you expose direction and loudness than this should be working but it is not. I'll give it another go. With spatial audio you create an audio sphere that the viewer than is placed inside. As the viewer rotates their head in in a HMD or camera in unity towards a direction whatever sound in that direction should than be changed to now appear as though it is in front of them. The sphere doesn't move but the listener's head moves within the sphere. For example, I have a 360 video where a character is off to the left. When the camera is pointed straight they should sound to the left. But when I move the camera i.e mouse drag to face that person they should sound slightly louder and centered. This is not happening. The mix was exported as 8_2 TBE file specifically for AVproplayer and it is channel mapped accordingly. Thanks again.
     
  23. shubhank008

    shubhank008

    Joined:
    Apr 3, 2014
    Posts:
    86
    So I tried using the trial and for local file it seems fine and subs also working and seems good for my use, but when trying to play same file via URL/path, the demo keeps loading the file (like buffering) but doesn't play any part of it. Tried playing, pausing and even seeking, nothing.
    Further, when exiting play mode of Unity, it just hangs unity forever until I end task using task manager.

    Any idea why ?

    These are last lines from editor log after I end task it

    Code (CSharp):
    1. [AVProVideo] Using playback path: MF-MediaEngine-Hardware (1280x720@0.00)
    2. UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    3. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    4. UnityEngine.Logger:Log(LogType, Object)
    5. UnityEngine.Debug:Log(Object)
    6. RenderHeads.Media.AVProVideo.Helper:LogInfo(String, Object) (at Assets\AVProVideo\Runtime\Scripts\Internal\Helper.cs:180)
    7. RenderHeads.Media.AVProVideo.WindowsMediaPlayer:Update() (at Assets\AVProVideo\Runtime\Scripts\Internal\Players\WindowsMediaPlayer.cs:748)
    8. RenderHeads.Media.AVProVideo.MediaPlayer:Update() (at Assets\AVProVideo\Runtime\Scripts\Components\MediaPlayer.cs:632)
    9. (Filename: Assets/AVProVideo/Runtime/Scripts/Internal/Helper.cs Line: 180)
    10.  
    11. Refresh: detecting if any assets need to be imported or removed ...
    12.  
    13. Refresh Completed time: 0.068516s
    14.     Asset Scan time: 0.066138s
    15.     Asset Hashing: 0.000000s [0 B, 0.000000 mb/s]
    16.     Asset Import (Scripting) time: 0.000000s (count: 0)
    17.     Post Processs Assets (Scripting) time: 0.000000s
    18.     Asset Rehashing: 0.000000s [0 B, 0.000000 mb/s]
    19.     Asset Import (Non Scripting) time: 0.000000s (count: 0)
    20.     Post Process Assets (Non Scripting) time: 0.000000s
    21.     Dependent Assets to Import Queue time: 0.000000s
    22.  
    23. Launched and connected shader compiler UnityShaderCompiler.exe after 0.08 seconds
    24. Launched and connected shader compiler UnityShaderCompiler.exe after 0.07 seconds
    25. [AVProVideo] Shutdown
    26. UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
    27. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    28. UnityEngine.Logger:Log(LogType, Object)
    29. UnityEngine.Debug:Log(Object)
    30. RenderHeads.Media.AVProVideo.Helper:LogInfo(String, Object) (at Assets\AVProVideo\Runtime\Scripts\Internal\Helper.cs:180)
    31. RenderHeads.Media.AVProVideo.MediaPlayer:OnApplicationQuit() (at Assets\AVProVideo\Runtime\Scripts\Components\MediaPlayer.cs:765)
    32. (Filename: Assets/AVProVideo/Runtime/Scripts/Internal/Helper.cs Line: 180)
     
  24. shubhank008

    shubhank008

    Joined:
    Apr 3, 2014
    Posts:
    86
    Have sent you a PM with the URL I am trying to play

     
  25. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    102
    Installed 1.11.7, unfortunately, changes in the scripts mean I will need to completely rebuild my project:(
     
  26. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    Hi @richardzzzarnold

    Most of the changes were bug fixes and small improvements, there shouldn't be any breaking changes. What do you mean by completely rebuild?
     
  27. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    Hi @inthenighttime

    Would it be possible to send a sample reproducible project to unitysupport@renderheads.com?

    Thanks.
     
  28. shubhank008

    shubhank008

    Joined:
    Apr 3, 2014
    Posts:
    86
    Anything about this issue ? I am waiting to buy between vlc asset or AVPro (ideally) but has not been able to play any of the videos from URL and facing that constant hang/freeze problem, while the same urls are working in VLC asset (tested in trial package of both assets).
    Sent you a detailed DM as well but didnt get any reply.

     
  29. jacobotrf

    jacobotrf

    Joined:
    Nov 29, 2016
    Posts:
    1
    I am doing live steaming in real time (like a youtube direct) with aws. Sometimes if the user has a bad connection, the video stops and it play when the connection is restored. The problem is that the video continues where the video stopped . Is there a way to reconnect the video to the actual moment of the live streaming instead of where the video was stopped?

    Thanks
     
  30. Lordmin

    Lordmin

    Joined:
    Mar 9, 2017
    Posts:
    54
    1. I want to read the video length of an mp4 file in a path outside the project on Windwos10.

    Can you give me sample code?

    2. Is there a way to check the wrongly created mp4 file before opening it? In our project, the following error code occurs. [[AVProVideo] Error: Loading failed. File not found, codec not supported, video resolution too high or insufficient system resources.]

    Thank you.
     
  31. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    Well you won't see a watermark on Windows or Android currently for Hap/Notch on the Core Edition but the plan is to add it. I've logged a feature request on our Github so that when we do add it we will add a way to detect whether there will be a watermark. You can follow progress here: https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/726

    As for your second issue - a way to avoid it would be to switch the material. Even if we detect that it is/isn't stereo, the frame that is generated is the same i.e. it contains both left and right eye. At rendering time we pass that information into our shaders which will then render whichever eye Unity is rendering. You could use the same information to control how the video is rendered. Eg. you could switch to a shader that doesn't know anything about stereo. Does that make sense?
     
    blevok likes this.
  32. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    Hi @Lordmin

    Which version of AVPro Video are you using?

    Thanks.
     
  33. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    Hi @jacobotrf

    You hook into the event when the stream un-stalls and then seek to the current time, something like this should work:

    Code (CSharp):
    1. TimeRange seekableRange = Helper.GetTimelineRange(mediaPlayer.Info.GetDuration(), mediaPlayer.Control.GetSeekableTimes());
    2. mediaPlayer.Control.Seek(seekableRange.endTime);
    Does this help?
     
  34. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    Hi @shubhank008

    From the URL's you sent it looks like they are 10bit H264 mkv's which are not supported - your options would be to either transcode to 8bit H264 mkv or if you need it to be 10bit, to transcode to 8bit H265 which is supported. Another option would be to install LAV Filters and then set the API to DirectShow, then the videos you sent would play.

    Thanks.
     
  35. shubhank008

    shubhank008

    Joined:
    Apr 3, 2014
    Posts:
    86
    That shouldn't be the case as all the same URLs are playing in not only VLC asset but also in AVPro Video (the trial) when the files are locally downloaded, that was the issue I mentioned both in post and DM that the problem is with remote/URL playing and how its hanging Unity instead of a error or graceful exit.

    The issue is not with playback of video but:
    1. Same videos not playing from URL, no errors, nothing
    2. Unity Editor and even inspector preview hanging up without any error or graceful exit when you change video or load video or exit play mode.
     
  36. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    What platform are you using @shubhank008? We tested the files locally on AVPro Video on Windows 10 and they don't play. Didn't test on MacOS because MacOS doesn't support mkv files.
     
  37. bukanyijixyz

    bukanyijixyz

    Joined:
    Apr 13, 2019
    Posts:
    2
    My project includes other resources StandaloneFileBrowser.dll The mode of avpro is Windows.VideoApi.DirectShow ;
    After the project is released, playing the byte [] video is a black screen, but it is normal to play it in unityeditor.
     

    Attached Files:

  38. shubhank008

    shubhank008

    Joined:
    Apr 3, 2014
    Posts:
    86
    Windows 10 x64
     
  39. shubhank008

    shubhank008

    Joined:
    Apr 3, 2014
    Posts:
    86
    Afaik are LAV filters shipped with the asset or would need to be shipped and installed by my App itself ? I am still not sure how or why they are playing locally on my side, specially when the last link I sent (test.mkv) is a 8bit x264 mkv.
    But that still doesn't solve that hanging issue of Unity editor or inspector.
     
  40. blevok

    blevok

    Joined:
    Feb 16, 2017
    Posts:
    65
    That's perfect, thank you.

    Yes that makes sense and should work just fine.

    Thank you for understanding these concerns and providing/planning workable solutions. I'll be starting to upgrade within the next few days.
     
    TerryRH likes this.
  41. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    Hi @bukanyijixyz

    Have you checked the logs to see if there are any errors?

    Could you provide other information like:
    1. Which version of AVPro Video are you using?
    2. Which version of Unity you are using?
    3. Are other videos playing?
     
  42. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    You would need to install LAV Filters separately. Test.mkv is 10bit, not 8bit, and we don't support 10bit h264 mkv.
     
  43. Dmitry-Kuz

    Dmitry-Kuz

    Joined:
    Nov 15, 2016
    Posts:
    4
    Hi team,

    I have a bug with AudioOutput. When I try to use my .mp4 file (in "Demo_MediaPlayer" scene), this component does not work (I keep hearing sound in the scene, but AudioSource does not receive sound). My file is similar to your example and I can't figure out what my problem is. I made a one-minute video:


    Here is an example of my .mp4 I made with Natcorder: https://drive.google.com/file/d/1zuqYsEGXwsYUctNyc5BsqbrauVszh8-0/view?usp=sharing

    I use AVPro version 2.0.0 and Unity 2019.4.15f1

    Thanks!
     
  44. Lordmin

    Lordmin

    Joined:
    Mar 9, 2017
    Posts:
    54

    I'm using Version 1.11.7
     
  45. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    Hi @Dmitry-Kuz

    A fix for this will be in our upcoming release. In the meantime, a workaround fix has been posited here: https://github.com/RenderHeads/UnityPlugin-AVProVideo/issues/734.

    Let us know if you have further questions.

    Thanks!
     
    Dmitry-Kuz likes this.
  46. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,708
    Hi All,

    AVPro Video version 2.1.0 has just been released!

    Changes include:

    General
    • Added
      • New documentation on caching (new Ultra Edition feature) and 10-bit video
    • Fixed
      • [#709] Fixed issue with orientation changes not being handled when re-using a media player instance and the DisplayUGUI component
      • Fixed compiler issues with PlaylistMediaPlayer and refactored this component
    Windows
    • Improvements
      • Better playback performance for Hap and NotchLC content
    • Fixed
      • Fixed issue where sometimes a Hap or NotchLC video playback would abort playback and show an error message
      • [#719] Fixed issue where using 360 Audio would cause the video to not load when the audio rendering device didn't support the sample rate of the source media. This was the case with the Vive Index which was locked to 44.1Khz and media was 48Khz
    Android
    • Added
      • [#379] Caching remote streams to local filesystem on playback to reduce network bandwidth on subsequent playback (new Ultra Edition feature)
      • [#655] GetAudioBufferedSampleCount() implemented
    • Improvements
      • Upgraded ExoPlayer from 2.12.1 to 2.13.1
      • [#626] Added support for specifying the maximum preferred resolution for adaptive streams
    • Fixed
      • [#497] Fixed glitch in OES rendering mode when switching resolutions where one resolution requires different padding
      • [#716] Fixed script causing startWithHighestBitrate option to not be used
      • Made IsSeeking() more reliable
      • PluginProcessor.cs now correctly processes libSampleRate-android.so
    macOS/iOS/tvOS
    • Fixed
      • [#685] Fixed issue with state not being correct after calling OpenMedia or CloseMedia
      • [#704] Fixed issue with opening videos in quick succession leading to undefined behaviour
      • [#710] Fixed issue with metadata flag not being set when metadata is present
      • [#729] Fixed issue with MediaEventType.Error not being triggered when the player status is failed
      • [#734] Fixed issue with audio tracks being ignored for capture when no language metadata is present
    iOS
    • Improvements
      • [#379] Added support for caching of HLS videos (new Ultra Edition feature)
    WebGL
    • Fixed
      • [#723] Fixed "gl" typo in javascript introduced in 2.0.10
      • Fixed support for Linear colorspace

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

    Thanks,
     
  47. trojant

    trojant

    Joined:
    May 8, 2015
    Posts:
    26
    Hi, In Unity2019.4.17, I used AVpro1.11.7 to release a Windows10 - x86_64 application, and it contain 4 or 5 Horizontal arrangement Videos,then they are all playlist media player, videos are streaming asset. Now it would only be application crashing after your application has been running for a while, not on the first play. when all videos is playing, textures of memory has been increasing in profiler. Was it a memory leak bug?What Can I do? Thank you. Or what are the coding requirements for MP4 video files?
     
    Last edited: Apr 21, 2021
  48. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    Hi @Lordmin,

    1. There are a few ways to do this but here is a simple example (this is for AVPro Video 1.x):
    Code (CSharp):
    1.  MediaPlayer mp;
    2. float timeout;
    3. string path = @"file://yourpath";
    4.    
    5.     void Start()
    6.     {
    7.         GameObject go = new GameObject();
    8.         mp = go.AddComponent<MediaPlayer>();
    9.         mp.OpenVideoFromFile(MediaPlayer.FileLocation.AbsolutePathOrURL, path, true);
    10.     }
    11.  
    12.     void Update()
    13.     {
    14.         if (mp != null && mp.Info!= null)
    15.         {
    16.             float duration = mp.Info.GetDurationMs();
    17.             if (duration != 0.0f)
    18.             {
    19.                 Debug.Log("Duration: " + duration);
    20.                 mp.CloseVideo();
    21.             }
    22.             else
    23.             {
    24.                 timeout += Time.deltaTime;
    25.                 if (timeout >= 5f)
    26.                 {
    27.                     Debug.Log("Took too long");
    28.                     mp.CloseVideo();
    29.                 }
    30.             }
    31.         }
    32.     }
    2. There isn't really a way to check if a video will be supported without loading it - but you could do this behind the scenes and then listen for the error event.

    I hope that helps!
     
  49. TerryRH

    TerryRH

    Joined:
    Dec 3, 2019
    Posts:
    88
    Hi @trojant

    What do you by 'what are the coding requirements for MP4 video files?'.

    Would it be possible to send us a crash log for your application? Does it crash every time at the same place?

    Thanks.
     
  50. trojant

    trojant

    Joined:
    May 8, 2015
    Posts:
    26
    The App crash is random after the application has been running for a while.
    Latest test results:
    I Use the playlistmedia player (beta).When the number of video items exceeds 2, and each time the video is switched and played to the next video,so textures of the memory will increase in profiler. Yesterday, the result increased from 100M to 7G.
    When the number of video items is one or two, textures of the memory will not increase in profiler.
     

    Attached Files:

unityunity