Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

[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,615
    If this is in Windows, then the problem is that your video contains stereo metadata. On our Windows player it doesn't support stereo videos that contain stereo metadata, so this must be removed from the video. We have some FFMPEG commands for how to do this in the FAQ section of our PDF documentation.

    Thanks,
     
  2. canaksoy

    canaksoy

    Joined:
    Nov 5, 2015
    Posts:
    2
    EntryPointNotFoundException: AVPPlayerAddValueDidChangeObserver
    RenderHeads.Media.AVProVideo_OSXMediaPlayer..ctor (Boolean useYuv420Textures) (at Assets/AVProVideo/Scripts/Internal/OSXMediaPlayer.cs:404)
    RenderHeads.Media.AVProVideo.MediaPlayer.CreatePlatformMediaPlayer () (at Assets/AVProVideo/Scripts/Components/MediaPlayer.cs:1460)
    RenderHeads.Media.AVProVideo.MediaPlayer.Initialise () (at Assets/AVProVideo/Scripts/Components/MediaPlayer.cs:428)
    RenderHeads.Media.AVProVideo.MediaPlayer.OpenVideoFromFile (FileLocation location, System.String path, Boolean autoPlay) (at Assets/AVProVideo/Scripts/Components/MediaPlayer.cs:501)
    videoMenuVideo_OnEnable () (at Assets/videoMenuVideo.cs:45)
    UnityEngine.GameObject:SetActive(Boolean)
    vPlayer:startMainApp() (at Assets/vPlayer.cs:692)
    <waitMainApp>c__Iterator0:MoveNext() (at Assets/vPlayer.cs:606)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

    -- second error--

    Problem description:

    EntryPointNotFoundException: AVPPlayerAddValueDidChangeObserver
    RenderHeads.Media.AVProVideo_OSXMediaPlayer..ctor (Boolean useYuv420Textures) (at Assets/AVProVideo/Scripts/Internal/OSXMediaPlayer.cs:404)
    RenderHeads.Media.AVProVideo.MediaPlayer.CreatePlatformMediaPlayer () (at Assets/AVProVideo/Scripts/Components/MediaPlayer.cs:1460)
    RenderHeads.Media.AVProVideo.MediaPlayer.Initialise () (at Assets/AVProVideo/Scripts/Components/MediaPlayer.cs:428)
    RenderHeads.Media.AVProVideo.MediaPlayer.OpenVideoFromFile (FileLocation location, System.String path, Boolean autoPlay) (at Assets/AVProVideo/Scripts/Components/MediaPlayer.cs:501)
    videoMenuVideo_OnEnable () (at Assets/videoMenuVideo.cs:45)
    UnityEngine.GameObject:SetActive(Boolean)
    vPlayer:startMainApp() (at Assets/vPlayer.cs:692)
    <waitMainApp>c__Iterator0:MoveNext() (at Assets/vPlayer.cs:606)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

    Device (which devices are you having the issue with - model, OS version number):

    MacOS

    Media (tell us about your videos - number of videos, resolution, codec, frame-rate, example URLs):

    Cannot play video on Unity Editor
    nothing changed in code. playing mp4 from streaming assets folder.
    only AVPro 1.7.0 (1.9.1) updated from (1.7.0)

    System Information:

    AVPro Video: plugin v1.7.0 scripts v1.9.1
    Target Platform: Android
    Unity: v2018.2.8f1 OSXEditor
    OS: Desktop - MacBookPro11,5 - Mac OS X 10.13.6 - English
    CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz - 8 threads - 16384KB
    GPU: Emulated GPU running OpenGL ES 3.0 - Emulated - OpenGL ES 3.0 [emulated] - 2048KB - 4096

    [SOLVED]
    First import without OSXMediaPlayer.cs file. then import again with selecting the file. after importing AVPro.. When Unity asks API Updater, press NO. Then run API Updater manually.
     
    Last edited: Sep 23, 2018
  3. Davonafe

    Davonafe

    Joined:
    Nov 22, 2015
    Posts:
    6
    Problem description:

    On IOS IPAD there are issues with using the same media player to load and then play videos.
    they are played one after the other so there is no cross loading that needs to be done.
    There is also fading up and down during video start and end that happens using the DoTween Asset.
    We do not run into any runtime exception errors. out application runs fine one time through then fails to run wach video afterwords consistantly.

    Device (which devices are you having the issue with - model, OS version number):

    Working on Win 10 64, Not working on IOS version 11.3

    Media (tell us about your videos - number of videos, resolution, codec, frame-rate, example URLs):

    4 videos, mp4, 24 fps, 1920 x 1080

    System Information:

    AVPro Video: plugin v1.9.1 scripts v1.9.1
    Target Platform: iPhone
    Unity: v2018.2.3f1 WindowsEditor
    OS: Desktop - MS-7885 (MSI) - Windows 10 (10.0.0) 64bit - English
    CPU: Intel(R) Core(TM) i7-5930K CPU @ 3.50GHz - 12 threads - 32671KB
    GPU: Emulated GPU running Metal - Emulated - Metal [emulated] - 6097KB - 4096
     
  4. shoo

    shoo

    Joined:
    Nov 19, 2012
    Posts:
    61
    OUCH!
    I've spent 3 days to make OpenVideoFromBuffer based playback and now I know that this option only avalible on Windows.
    Is it any option to cache media files on other platforms? I need to preload my StreamingAssets folder for WebGL build, I guess OpenVideoFromFile would just buffer some part of file in this case ?
     
  5. NS24

    NS24

    Joined:
    Feb 21, 2018
    Posts:
    15
    @AndrewRH is there any API to detect whether the video is in Stereo?

    At present if I set Stereo Packing to Top Bottom, then Stereo videos play fine in Gear VR, whereas Mono videos don't.

    Conversely if I set Stereo Packing to None, then the Mono video plays fine, but the Stereo does not.

    How can this problem be resolved?
     
  6. MarkHenryC

    MarkHenryC

    Joined:
    Nov 30, 2009
    Posts:
    63
    Do you intend to fix this? I sent you a simple fix in MediaPlayer.cs but haven't heard back. My fix works for me, but it will obviously be overwritten if I do the latest update. I can't see any reference to the fix in your release notes.
     
  7. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,615
    Does it only not work on iOS, or also failing in the macOS Editor?
    Could it possibly be an issue with DoTween?
    How many videos do you have loaded at once?

    Thanks,
     
  8. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,615
    Oops! I'm afraid that there isn't any way to cache media files currently. You would have to do your own code to download the file and then store it somewhere. Usually this is done to the persistantDataPath, but in WebGL this is usually done to the IndexDB and then loaded via a "blob:" url

    Thanks,
     
    shoo likes this.
  9. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,615
    Unfortunately currently we don't include any functionality to determine whether a video is stereo or not. You would need to determine whether the video is stereo or mono and then set the packing mode appropriately.

    Thanks,
     
  10. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,615
    Yes we do intend to fix this - as far as possible. Some parameters are part of the low-level MediaPlayer setup and can't be changed without Destroying the MediaPlayer and recreating it. Thanks for sending over the code via email - we will be looking at including this or something similar in the next update to the plugin :)

    Thanks,
     
  11. matthewlebo

    matthewlebo

    Joined:
    Mar 16, 2016
    Posts:
    7
    i need to run video on android tv and tvOS, the unity video player is slow and flickers often especially when changing from one video to another. would buying this solve those issues? why / how is it different from the unity video player implementation please?
     
  12. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,615
    Hi,
    I don't know why our plugin is different from Unity's VideoPlayer, but we have put a lot of time and effort into it. There is a free trial version available for download from the website if you wish to test it out.
    Thanks,
     
  13. matthewlebo

    matthewlebo

    Joined:
    Mar 16, 2016
    Posts:
    7
    ok testing it out, i sorry i hope i wasnt rude just trying to understand..

    also can your asset stream videos from http url?
     
  14. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,615
    Hey no problem, I didn't think you were sounding rude at all :) Just trying to answer honestly.
    Yes it can stream content via HTTP url. Give the demo version a spin, it should work very easily.
    Thanks,
     
  15. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    303
    I was just wondering, in the MediaPlayer class you've got a line new PS4MediaPlayer around line 1503, is this just there for future support for PS4 or do you support for it via an added plugin? thanks. Apologies if this has been asked already, but I was unable to search this thread for the keyword 'ps4' because the Unity forum search complains the word is too short.
     
  16. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,615
    We did some PS4 development for this plugin once upon a time, but it's not something we can release.
     
  17. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    303
    No worries, it was just causing a compiler error for me is all and wondered if you had an add-on for AVPro I didn’t know about. I’ll comment that line out.
     
  18. bhermer

    bhermer

    Joined:
    Jun 24, 2013
    Posts:
    20
    Hi, I am trying to implement the android offset function.

    I am getting errors, I have created a 30,000 byte buffer file and pre-pended it to a video. The video is currently in the streaming assets folder, also, before I go much further, does AVPro now support this function for videos Not in streaming assets, as we are playing 1-3gb files and multiples of them so streaming assets is a no go (I am looking for some way to secure these videos as they are played on a corporate device, and the videos are sensitive training)

    I have double checked my padding file, it is exactly 30,000 bytes. I can confirm, running the original video without the offset works fine, no settings changes between tests

    padding file = 30,000 bytes
    video file = 26,280,053 bytes
    Combined file = 26,310,053 bytes

    My logcat:

    -30 10:54:15.036 6592 6613 I Unity :
    -30 10:54:15.047 6592 6613 I Unity : [AVProVideo] Opening jar:file:///data/app/uk.rivr.vidtest-2/base.apk!/assets/test.mp4 (offset 30000)
    -30 10:54:15.047 6592 6613 I Unity :
    -30 10:54:15.047 6592 6613 I Unity : (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    -30 10:54:15.047 6592 6613 I Unity :
    -30 10:54:15.168 6592 6627 E Unity : OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_FRAMEBUFFER_OPERATION: Framebuffer is not complete or incompatible with command
    -30 10:54:15.168 6592 6627 E Unity :
    -30 10:54:15.168 6592 6627 E Unity : (Filename: /Users/builduser/buildslave/unity/build/Runtime/GfxDevice/opengles/GfxDeviceGLES.cpp Line: 335)
    -30 10:54:15.168 6592 6627 E Unity :
    -30 10:54:15.173 6592 6613 I Unity : +++++++++++++++++++++++++++++++0
    -30 10:54:15.173 6592 6613 I Unity :
    -30 10:54:15.173 6592 6613 I Unity : (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    -30 10:54:15.173 6592 6613 I Unity :
    -30 10:54:15.265 6592 6613 I Unity : +++++++++++++++++++++++++++++++1
    -30 10:54:15.265 6592 6613 I Unity :
    -30 10:54:15.265 6592 6613 I Unity : (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    -30 10:54:15.265 6592 6613 I Unity :
    -30 10:54:15.286 6592 6613 I Unity : +++++++++++++++++++++++++++++++2
    -30 10:54:15.286 6592 6613 I Unity :
    -30 10:54:15.286 6592 6613 I Unity : (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    -30 10:54:15.286 6592 6613 I Unity :
    -30 10:54:15.327 6592 6613 E Unity : [AVProVideo] Error: Loading failed. File not found, codec not supported, video resolution too high or insufficient system resources.
     
  19. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,615
    Hello,

    Yes we support loading video from other locations besides StreamingAssets. You can copy the videos to another folder on the device and then refer to them by absolute path. See the PDF documentation for information about load locations.

    AVPro Video supports the file offset on Android only currently. You will need the latest version of the plugin (version 1.9.1) for this to work. If you're still having trouble, try switching the video API between ExoPlayer and MediaPlayer (in the MediaPlayer component > Platform Specific > Android). Let me know if you have any problems.

    We also find it handy to pre-pend a blank mp4 file to the video. This will make the video file still play if someone tries to copy and play it, which may help to create a bit more distraction.

    Thanks,
     
  20. AndrewRH

    AndrewRH

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

    I was mistaken. We have added support on Android using the ExoPlayer API (default) only in the upcoming version 1.9.2. In the current version 1.9.1 it is only supported using the MediaPlayer API (in MediaPlayer component > Platform Specific > Android > Video API).

    1.9.2 should be released soon.

    Thanks,
     
  21. bhermer

    bhermer

    Joined:
    Jun 24, 2013
    Posts:
    20
    Thanks, I will give it a go.
     
  22. philipd

    philipd

    Joined:
    Apr 15, 2016
    Posts:
    7
    Hi

    A quick question, hopefully. Is there any way of generating mip maps on Android? I'm noticing bad antialising on videos when small. I've seen this discussed for Windows but not Android. I'm assuming mip maps would improve it but if there's another way then I'd love to know.

    All the best

    Phil
     
  23. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,615
    Hi Phil,

    Yes mip-maps should improve that and it shouldn't be too difficult to do. I will put it on the list so we can try to get it in the next release (1.9.3, since 1.9.2 is coming out in a few hours).

    Thanks,
     
  24. AndrewRH

    AndrewRH

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

    AVPro Video version 1.9.2 has just been released!

    You can find the updated version on the Asset Store and the free trial version on our website.

    Changes include:

    Android
    • Fixed rare crash bug when using ExoPlayer due to commands being called in the render thread
    • Added file offset support when using ExoPlayer and loading from StreamingAssets folder
    iOS
    • Fixed issue where some HLS streams wouldn’t play on older iOS devices
    • Fixed XCode 8/9 compatibility issue
    General
    • Exposed options for automatically pausing / playing the media when application pauses
    • Exposed a mask to control which events the MediaPlayer should trigger. This is a minor optimisation to allow event logic to be skipped.
    • Fixed a minor issue with OnApplicationPaused and m_WasPlayingOnPause
    • Fixed a logic bug where a non-auto-play video loaded from a prefab wouldn’t play after calling Play()
    • Fixed a minor issue with PlaylistMediaPlayer where stereo/alpha/loop/path state wasn’t set correctly
    WebGL
    • Fixed support for WebGL 2.0

    Thanks to everyone that reported bugs that were fixed in this release :)

    Please report any issues here on the forum, or to our customer support email

    Thanks,
     
  25. Monarc

    Monarc

    Joined:
    Jun 20, 2016
    Posts:
    7
    I did set platforms and cpu architecture configurations manually and it worked!
    I think unity has a bug do not recognize the plugin paths correctly.

    But I encountered another issue that the device produces following logs infinitely before destroying MediaPlayer object.
    It doesn't interfere functioning but it makes me hard to see other logs and I'm concerning it will be harm to device performance.

    이미지 295.png


    Thanks!
     
    Last edited: Oct 3, 2018
  26. philipd

    philipd

    Joined:
    Apr 15, 2016
    Posts:
    7
    Thanks that would be really great to have. Really glad to see that you are continuing to develop and improve AVpro. Without it I don't think I would of been able to make my app at all :)
     
    AndrewRH likes this.
  27. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,615
    That's a weird error - I don't get that. It sounds like it saying it can't find one of the methods we're caching...

    Does it say any more? Are you able to expand those?

    Thanks,
     
  28. Monarc

    Monarc

    Joined:
    Jun 20, 2016
    Posts:
    7
    Yes you're right. It can't find some methods related to android.media.MediaCodecInfo.
    Is there any problem of my video files?

    I attached expanded logs about it. Please look into them and let me know what should I do.

    Thanks in advance.
     

    Attached Files:

  29. dbhf

    dbhf

    Joined:
    May 1, 2015
    Posts:
    2
    Hello, some help will be very much appreciated.

    I have a 3 minutes video, 46MB (and other details in the image) in a server, so I am playing the video from an URL, the video plays correctly but around 1:30 the video freezes and I can see this error in the log

    Code (CSharp):
    1. // [AVProVideo] Error: Decode failed.  Possible codec not supported, video resolution too high or insufficient system resources.
    2. // On Android this is generally due to the hardware not having enough resources to decode the video.
    3. // Most Android devices can only handle a maximum of one 4K video at once.
    This is happening only with Android devices, with iOS is working fine, and I am testing with the next
    Android Pixel 2 - Android 8.1

    But the QA has found the same issue across other Android devices
    LG G7 (8.0)
    Motorola Moto G6 (8.0)
    Google Pixel 2 (8.0)

    Have to say no other applications are running on the android device, also to give you a bit more details on memory, the Pixel device has 3.9GB of total memory, I checked the memory usage for that specific app and the average is 86MB and it says max usage 416MB, hope this helps
     

    Attached Files:

    Last edited: Oct 4, 2018
  30. Piranha771

    Piranha771

    Joined:
    Oct 19, 2016
    Posts:
    6
    Hello,

    we are using your Media Player to get tremendously good performance while playing 8 Videos simultaneously in QHD resolution on Windows. Thank you so much for providing a full featured trial, which enabled us to check if we can integrate your player in our stitching system.

    I have 2 questions that I want to ask before purchasing:

    1. You provide different mappings for the Video Cube (Like 360° Facebook mapping) but unfortunately there is no Youtube 360° mapping. Could you provide a mapping fr these kind of videos? Or how easy would it be to add this mapping by our own?

    2. The hardware decoding with your player works like a charm (Unity's player don't) but it only uses the GPU that is the same as the GPU that Unity uses for rendering. I know that Media Foundation API allows you to pass any capable device to it to do the hardware decoding. Would it be possible that you can select which GPU is passed to Media Foundation API? So we could do rendering on one GPU and another one does the video decoding?

    We're just using Windows no other platform.
     
  31. GookGo

    GookGo

    Joined:
    May 5, 2018
    Posts:
    38
    The alpha function isn't working.
    I'm using AVPro movie capture version 3.6.7 with Unity 2.11f1. I've set the function as the manual says as the screenshots below but the result is still not alpha... Could you help me with this issue? Thanks a lot!

    alpha1.PNG 屏幕截图(3).png alpha2.PNG
     
  32. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,615
    How do you know that the video isn't transparent? What are you using to play it back? Are you using a transparent material?
     
  33. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,615
    1) We will have to investigate the YouTube 360 format....If it isn't complicated then it should be possible to implement this yourself using the CubemapCube component as a starting point...

    2) Yes this should be possible for Windows. I don't think this would give you a performance win though, as video decoding happens on a different (dedicated) part of the GPU. Also it would requiring the copying over of the decoded video frame which would be a slow process. We will certainly look into exposing this as an option though on Windows when using D3D11.

    Thanks,
     
  34. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,615
    If the video is always freezing at a specific location, this is usually because either:

    1) There is an error /corruption in the video encoding at that part
    2) The bit-rate is too high at that moment in the video for the decoder to handle it

    I would guess the problem is 1). You can use a tool like FFPROBE to try to analyse the video. Please send it over to us if you're using having problems (www.renderheads.com/contact).

    I can't see any other reason why it would fail on Android. Make sure you're also using the latest version of AVPro Video (1.9.2), and try setting the Android video api to either ExoPlayer or MediPlayer (in MediaPlayer component > Platform Specific > Android > Video API).

    Thanks,
     
  35. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,615
    I don't think it's a problem with your video. More likely there is an issue with the AVPro Video files. Perhaps try deleting the plugin and reimporting it again (both the /Assets/AVProVideo and /Assets/Plugins folders). Or try creating a blank project and see if it works then.

    Also worth making sure you using using the latest version of AVPro Video (1.9.2).

    Thanks,
     
  36. GookGo

    GookGo

    Joined:
    May 5, 2018
    Posts:
    38
    I'm using the windows default video playback software and I guess if it's transparent, the background of my last screenshot shouldn't be deep blue?
     
  37. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,615
    Windows video player doesn't support transparent playback. It will show the colour of the RGB channels only (including blue). Thanks,
     
  38. shoo

    shoo

    Joined:
    Nov 19, 2012
    Posts:
    61
    Hello!

    Please consider some option for turning off auto play next item in PlaylistMediaPlayer.

    I was need "next/preview" logic with transition for my app, and playlist was good feature for me, but I wanted to switch videos manually, so I commented line 280 "NextItem();"
     
  39. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,615
    Great idea! We'll add this into the next version. For now I've attached the two files with this feature added. Just copy them over the existing files.

    Thanks,
     

    Attached Files:

  40. MESHED-space-GmbH

    MESHED-space-GmbH

    Joined:
    Nov 11, 2015
    Posts:
    22
    hi, even when i load your original "04_Demo_uGui" demo an build it as webgl - android , windows, and on the mac this example works, but it dont load the video on ipads or iphones ...
     
  41. Piranha771

    Piranha771

    Joined:
    Oct 19, 2016
    Posts:
    6
    Thank you for your answer :)

    I will look into that.
    Btw.: The YouTube mapping is as follows:


    No, it gives us a huge performance gain, because our cards that displaying all the videos have a very old, very weak video decoder chip.

    We've already tested that. There are no bandwidth problems on a decent system:
    1) Have two Graphic Cards. 1 Displays connected on each Card.
    2) Spawn Unity on the second monitor using Display.displays[index]
    3) Play 8K videos on the second monitor.
    Observation: Decoding of the 8K videos is happening on the first card,
    2nd card does nothing but rendering and couldn't handle a 8K video at all, but is displaying it smoothly now.

    The only option missing now is having an option to point to the card with the best decoder instead of always using the primary video card.

     
  42. shoo

    shoo

    Joined:
    Nov 19, 2012
    Posts:
    61
    Thank you!

    Also take a note:
    - PL always autoplay on start, mb it is better to have option "autoplay"
    - When loop mode on, I expect PL, it current == 0 and Prev() called, I expect that PL would play Count + 1 video, but it play nothing
    But I've fixed this two easily for my purposes.

    - Transition doesn't work on start, maybe it better to make transition from Apply's default texture to first started video
    - Also, in the end of video/PL, it is good to have transition to default texture too, but ofc it is better to start transition with offset from end. Not like video stops and after it transition starts, so user sees static picture
    This two options will help me a lot!


    And last one is critical for me!
    Let's say I need to clear my media texture so it will start from _defaultTexture on next play. In my app I use
    _mplaylist.Control.CloseVideo();

    Then, by UI buttons I start same video twice:
    _mplaylist.JumpToItem(<id always same>);

    So, when I try to start video third time, it doesn't play for me! It goes only for same ID, if I change ID then it plays well.
    I guess it is something about checking isMediaAlreadyLoaded inside OpenVideoFile function, but I am unable to fix it now.

    Maybe I am doing wrong using _mplaylist.Control.CloseVideo(), but I need something to stop current playback and return applied renderer to default texture
     
  43. Jotesting

    Jotesting

    Joined:
    Jul 24, 2012
    Posts:
    5
    Hi,

    we are streaming videos through HLS for iOS and Android. Its working on iOS and most of the android devices. We only have problems on Google Pixel 2 with OS version 9. The video stream is not loading there. Its loading on Google Pixel 2 with OS version 8.


    Any ideas how to fix that?

    Thanks
     
    Last edited: Oct 9, 2018
  44. Debashishb06

    Debashishb06

    Joined:
    Feb 7, 2013
    Posts:
    7
    Thanks it works..
     
  45. phileday

    phileday

    Joined:
    Feb 8, 2014
    Posts:
    85
    Hi

    Just noticed your question about Youtube mapping. The mapping cubes are right but there is one problem which I've not really find a good way to recreate (VR Toolbox seem to have this working though). The pixels are layed out evenly over the cubes. the density gets less at the edges to make the whole pixel density more even. Here is an explanation from youtube.

    https://forum.unity.com/threads/released-avpro-video-complete-video-playback-solution.385611/page-55

    This means that if you just use a cubemap with youtube the straight lines of the horizon will appear bent. I would really apreciate an obj or 3D model of a perfect projection but I'm currently making do with an obj kindly provided by the people at VR Toolbox.

    Hope that helps, if anyone finds a good projection model let me know :)

    Phil
     
  46. phileday

    phileday

    Joined:
    Feb 8, 2014
    Posts:
    85
    Hi it's me again.

    I've just updated to the latest AVPro build and I've run into a problem when loading an external file which wasn't there before.
    The code I'm using to load in the file is:
    myMovie.OpenVideoFromFile(MediaPlayer.FileLocation.AbsolutePathOrURL, mediafolder + "/" + moviefilename, false);

    Before it would start and be paused at the beginning. Now it always plays the video.

    I've reverted back to a previous version of the plugin for now.

    Is this a new bug or am I doing something wrong? My code hasn't changed with both plugins.

    All the best

    Phil
     
  47. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,615
    hmm, that's strange! Hope we didn't break something...
    Which platforms are you having this trouble with?
    We'll investigate
     
  48. phileday

    phileday

    Joined:
    Feb 8, 2014
    Posts:
    85
    It's ok, I played around and tried to get it working but in the end I revert back to the previous version that was working for me.

    I'm currently working on Both Android and PC. The problem I was having was playing back in the editor on PC. I don't know if you can recreate it but if you can't I might be able to come up with a simple project that loads in a file to demonstrate the issue.

    Let me know if I can provide any more info to help out with the issue.
     
  49. remy_rm

    remy_rm

    Joined:
    Jan 16, 2017
    Posts:
    17
    Hi Andrew.

    I am using the AVpro mediaplayer to playback 360 degree .m3u8 (hls) files, and i was wondering if there is a way to find out what video part (.ts file) the mediaplayer is requesting.

    What i want to do is download the needed video file (.ts) from a server only when it is requested, so i do not have to download all fragments at once. Downloading the file first and the opening it from local is important, so it cannot be streamed.

    The current workflow is like this:
    - App launches > Requests an XML file from the server containing data on what video to play.
    - XML Data is read and the first needed m3u8's filename is extracted (FooBar.m3u8).
    - FooBar.m3u8 is requested from the server and downloaded to local storage.
    - The active MediaPlayer.m_VideoPath is set to `Application.persistentDataPath + "/FooBar.m3u8"`
    - The MediaPlayer will try to play the m3u8 file, which throws the expected error `[AVProVideo] Error: Loading failed. File not found, codec not supported, video resolution too high or insufficient system resources.` Because there are no sub .m3u8 or .ts files to play from at this point.

    My current understanding is that after the MediaPlayer read FooBar.m3u8 it will try to read the first avialable EXT-X-STREAM-INF file, like FooBar_720p.m3u8 or FooBar_1080p.m3u8, and then get the first .ts file from there being FooBar_720_000.ts or FooBar_1080p_000.ts. However I do not currently know which version the stream is requesting to play, and i do not want to pre-emptively download all the files. So I am wondering if there is a way to read which file the MediaPlayer is requesting next, before it actually requests it so i can send a request to my server to download the file first?

    What I am currently trying it the following:
    I request the FooBar.m3u8 from the mediaPlayer over "http://localhost:5003/" and receive the requested filename that goes through this port using a httpListener. This works for the first file request (FooBar.m3u8) but after that it doesn't seem to request "FooBar_1080p.m3u8" over localhost anymore, but over another port. Though i'm not exactly sure if it even does request anything else after the initial m3u8 as i'm currently not receiving an error from the mediaPlayer that it is unable to play the video file.

    I'm currently on version 1.8.2
     
    Last edited: Oct 11, 2018
  50. shawww

    shawww

    Joined:
    Sep 30, 2014
    Posts:
    43
    Hey Andrew,
    I've used AVProVideo in the past, and it's been great. We're doing a thing where we swap meshes and textures every frame, and Unity VideoPlayer's frame indexing has in the past not been accurate on long-running videos.
    We're building to Magic Leap. Magic leap's internal MLMediaPlayer is painfully limited, and it's unlikely that it's a focus for the dev team for some time.
    So +1 for AVProVideo ML support. I'd buy it again if that's what it takes.
    It's basically just a reskinned Android, so I think it's more about just running the source code through their build chain to build the plugin (in Unity there's a Lumin> Build Plugin menu item).
    I have a few Magic Leaps and can test, if that's helpful :)
    My email is swalters@andtindrum.com -- thanks! :)
     
    AndrewRH likes this.
unityunity