Search Unity

[Released] AVPro Video - complete video playback solution

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

  1. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    The video FPS should be available for all platforms except Android.

    You can query it via the API:

    Code (CSharp):
    1. mp.Info.GetVideoFrameRate()
    Hope that helps.

    Thanks,
     
  2. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Unity broke their OBB (split application binary) support for quite a few Unity versions...It seems to be working again in 2017..
     
  3. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    :D
     
    GamerPET likes this.
  4. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    There are some here:
    https://developer.apple.com/streaming/examples/

    They're called "preliminary" I guess because HEVC support is new for HLS..

    It is also nice to see that this stream has a fallback path for H.264...

    Thanks,
     
    Rulfer likes this.
  5. 785130190

    785130190

    Joined:
    May 11, 2017
    Posts:
    21
    That's what I want,thanks!
     
  6. 785130190

    785130190

    Joined:
    May 11, 2017
    Posts:
    21
    There's a problem,GetVideoFrameRate is Commented-Out Code!I forget the version,and I can't find the version number.
     
  7. billywang

    billywang

    Joined:
    Apr 14, 2016
    Posts:
    5
    So, The problem is Unity OBB problem? It can't be solved with now unity version?
    Or Unity 2017 can solve this problem?
    I will try another way to test, and hope helpful!!
     
  8. toripopo

    toripopo

    Joined:
    Sep 15, 2017
    Posts:
    6
    Hi Andrew.
    Thanks for information.

    I read about this URL(https://tungsten.aaplimg.com/VOD/bipbop_adv_example_hevc/master.m3u8) before in pdf document.
    Unfortunately, it can’t be played on my computer.

    AVProVideo says “[AVProVideo] Error: Loading failed. Codec not supported or video resolution too high or insufficient system resources.”

    Are you really able to play this HLS on your computer? If so, is this my computer’s issue...?
     
  9. ZealUnity

    ZealUnity

    Joined:
    Apr 13, 2014
    Posts:
    64
    Does this support frame interpolation (30fps to 60fps)? Something like what SVP does...



    If not, any plans to implement it? Extra features like that would really set you apart now that Unity has built in support for video playback.
     
  10. YKG

    YKG

    Joined:
    Mar 4, 2015
    Posts:
    3
    Hello.

    I found a problem while playing a video file using AVProVideo.

    AVProVideo loads the video file well.
    However, the video is not played back.
    I can not see any error callbacks.

    How do I handle exceptions to this problem?

    Below is a detailed description of the problem video file output to GOM Player.

    *** DIRECTSHOW FILTER LIST ***
    1. DirectSound Audio Renderer
    2. Enhanced Video Renderer(CP)
    3. GOM Audio
    4. GOM Video
    5. Gom Source Filter(avi)

    *** VIDEO INFO ***
    Input Type : XVID
    Input Size : 576 x 320
    Output Type : YV12
    Output Size : 576 x 320
    Decoder Type : GVC [mpeg4]
    FrameRate(Frame/sec) : 0.00 (23.98)

    ** Filter[Gom Source Filter]
    * pin [ (Video 1) mpeg4 576x320]
    - majortype : MEDIATYPE_Video
    - subtype : {44495658-0000-0010-8000-00AA00389B71}
    - formattype : FORMAT_VideoInfo2
    - bFixedSizeSamples : FALSE
    - bTemporalCompression : TRUE
    - lSampleSize : 552960
    - cbFormat : 180
    * VIDEOINFOHEADER2
    - dwInterlaceFlags : 0
    - dwCopyProtectFlags : 0
    - dwPictAspectRatioX : 9
    - dwPictAspectRatioY : 5
    - dwControlFlags : 0
    - biSize : 40
    - biWidth : 576
    - biHeight : 320
    - biPlanes : 1
    - biBitCount : 24
    - biCompression : 1145656920
    - biSizeImage : 552960
    - biXPelsPerMeter : 0
    - biYPelsPerMeter : 0
    - biClrUsed : 0
    - biClrImportant : 0

    Thank you.
     
  11. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Maybe someone one your team commented it out? Certainly isn't commented out here...
    To see which version you're using, just check the Console output, it'll print it there when you Play the scene. Otherwise you can also look in the Inspector in the "About" panel.

    Thanks,
     
  12. 785130190

    785130190

    Joined:
    May 11, 2017
    Posts:
    21
    My version is 1.3.9,debug info : "[AVProVideo] Initialising AVPro Video (script v1.3.9 plugin v1.3.9) on NVIDIA GeForce GTX 750/Direct3D 11.0 [level 11.0] (MT True)".
    I checked the code,it is commented out,and I can not open,or can not pass the compile.
     
  13. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Try upgrading to the latest version. 1.3.9 is very old. You can upgrade for free via the Asset Store.
    Thanks,
     
  14. coldstar

    coldstar

    Joined:
    Sep 20, 2014
    Posts:
    13
    Hi, I want to know if AVPro can update decoded frame to Render Texture. Thanks.
     
  15. IikkaDevelopingThings

    IikkaDevelopingThings

    Joined:
    Sep 8, 2017
    Posts:
    7
    Hey!

    I'm having a problem with video distortion with AVPro. Could you help me with what I need to do in order to get the 360 videos showing correctly? Here's a screenshot of the issue. On the left is how the video looks on the default windows video player, on the right is a screenshot of how it looks in AVPro. How do I get AVPro to show the video undistorted like on the left?

    I'm currently using the videosphere prefab and having the player camera inside it.
     

    Attached Files:

    Last edited: Sep 29, 2017
  16. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes, when it decodes the videos, the frames get rendered to a standard RenderTexture which you can access just like normal.

    Thanks,
     
  17. AndrewRH

    AndrewRH

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

    Is it a stereo video? If so, you may need to strip out the stereo metadata as this confuses our decoder. There is an FFMPEG command for this in the FAQ section of our PDF documentation.

    If it is not stereo then perhaps you could send us the video so we can figure out the issue?

    Thanks,
     
  18. AndrewRH

    AndrewRH

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

    I'm not sure what the issue is.
    Could you tell us:
    1) Your Unity version
    2) Your AVPro Video version
    3) Your Windows version
    4) Whether our sample videos play or not

    Also, have you tried changing the Video API setting (in MediaPlayer > Platform Specific > Windows) to DirectShow, or even to toggle the hardware decoding option for Media Foundation?

    Failing that, you could send us a copy of the video and the above information so we can look into it further.

    Thanks,
     
  19. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hmm, yes it's not working for me. Are you using the latest version of Windows 10 (Creators Update)?

    Thanks,
     
  20. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Thanks for the suggestion, but we don't have any plans to add this feature. We have some other feature upcoming that will help to set us apart :) Maybe we can look at this afterwards.
    Thanks,
     
  21. coldstar

    coldstar

    Joined:
    Sep 20, 2014
    Posts:
    13
    Sorry, I didn't see this feature in the Trial version. What I want to do is that I have a created Render Texture and it's a asset, then how can I make MediaPlayer render on it? I can't find related information in AVProVideo-UserManual.pdf. I've tried ApplyToMaterial.cs, but it just grayed the screen.

    Can you give me some more hints?

    Thanks.
     
  22. dooyul_park

    dooyul_park

    Joined:
    Sep 20, 2017
    Posts:
    15
    Is it possible to adjust AVPro's streaming buffer size to make the Adaptive Bitrate Streaming vidoes stay with a higher resolution for longer amount of time?

    I looked up AVPro options but the only thing I've found was the one called 'Use Low Latency' which I believe is for less buffering and even with that thing turned off, the ABS videos changed the resolution pretty quickly to continue playing the video in low bandwidth. I prefer to keep high resolution even if that means the video should stop and start buffering.
     
  23. FriedrichSchadow1

    FriedrichSchadow1

    Joined:
    Oct 2, 2017
    Posts:
    1
    Problem description:

    Hello!
    In the build version of my project the videoplayer disappears. The videoplayer works perfectly fine as long as i start my project in the unity inspector, in the build however, its gonr.

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

    Windows 10, unity 2017.1

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

    im using a testvideo in mp4, about 1 minute long in 1080x720p

    System Information:

    AVPro Video: plugin v1.6.14 scripts v1.6.14
    Target Platform: Standalone
    Unity: v2017.1.1f1 WindowsEditor
    OS: Desktop - P65_67RSRP (XMG) - Windows 10 (10.0.0) 64bit - German
    CPU: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - 8 threads - 16267KB
    GPU: NVIDIA GeForce GTX 1070 - NVIDIA - Direct3D 11.0 [level 11.1] - 8078KB - 16384
     
  24. toripopo

    toripopo

    Joined:
    Sep 15, 2017
    Posts:
    6
    Hi Andrew.
    Yes, I'm using latest version of Windows 10.
     
  25. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    We didn't include a way to copy to a RenderTexture as this is an extra performance overhead and most people just use the RenderTexture provided by the plugin. If you want to do this though, it's easy. Simply create your RenderTexture object, then make a script that takes in that RT and the MediaPlayer as inputs. The Update() method can simply copy the contents of the one texture into the other, using (pseudocode) GraphicsBlit(_myRT, _mediaPlayer.GetTextureProducer().GetTexture();

    I hope that helps.
     
  26. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Currently we don't have any way to adjust the buffer size, or control which of the ABS streams gets rendered - it is handled by the operating system automatically based on network bandwidth. We are planning to add this first to Android soon and then will have to see about support on other platforms.

    Thanks,
     
  27. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Could you check what the player_log.txt file says? It may contain some error messages which will give a clue as to what is going on.

    Thanks,
     
  28. AxisUnity

    AxisUnity

    Joined:
    May 16, 2017
    Posts:
    12
    Hi, I was wondering what could cause the playback rate to not be able to be at or below 0 (as in negative value to play the video backwards or even just as a rewind feature that doesn't go back to the first frame). Even in the demo scenes I can't seem to be able to, it simply reverts back to a positive value. Could it be because of K-Lite Codec Pack or maybe by being on Windows 7(Unity version 5.6.1f1)?

    Also, it seems like the Seek function is having a hard time with 360 videos (the images take quite a while to update).

    After testing on Window 10 with the same Unity version, I was able to have a negative playback rate and it worked fine, except for 360 videos. I'm guessing the problem is similar to the Seek function problem since the slider does go backwards, but the image doesn't update. The problem might still be related to the codec pack and not the OS since I didn't have it on the machine with Windows 10, but my money would still be on OS.
     
    Last edited: Oct 3, 2017
  29. dooyul_park

    dooyul_park

    Joined:
    Sep 20, 2017
    Posts:
    15
    Hello. I'm trying to test AVPro 4k 360 videos with Adaptive Bitrate Streaming (.m3u8 format) capability.

    From the manual, I could see fixed bitrate video streaming of 4k 360 videos is supported. But when I tested .m3u8 4k url with AVPro, the resolution of the video never went up above 1365 x 720.

    The test pc has network bandwidth of 100Mbps. The test link is http://sample.vodobox.net/skate_phantom_flex_4k/skate_phantom_flex_4k.m3u8 This m3u8 file supports up to 3840x2160. I am aware of that this file's server may not be very performant to stream it eventhough my pc's bandwidth is enough.

    Does AVPro support 4k .m3u8 with highest resolution(360 or not)?
    If so then what is the recommended network bandwidth to play it without dropping the resolution?
     
    Last edited: Oct 4, 2017
  30. DarkMio

    DarkMio

    Joined:
    Feb 10, 2016
    Posts:
    7
    @AndrewRH would it be possible to expose the video chunk displayed on an HLS stream? After establishing the initial stream we would like to know which .ts chunk is currently displayed on stream to make some assumptions about the presentation-time of a running livestream.

    Looking through the media controls, it seems that (in our case AppleCoreMedia and NSPlayer) don't expose any of these infos. Looking through the http access logs, it's sometimes inconsistent which chunk is accessed first.

    Thank you very much
     
  31. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes, it does support up to 4K using HLS streaming. We have seen in some older versions of Windows 10 that it limits the stream resolution based on your monitor resolution. If you're running 1920x1080 monitor, then this made by what is happening.. In this case you either need to use a 4K monitor, or upgrade to the latest version of Windows 10.

    If this isn't the case then please let us know:
    1) AVPro Video version
    2) Unity version
    3) Your OS version (the exact version code)

    Thanks,
     
  32. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes, this is something we're currently looking into and hope to add to a new version soon. Are you looking for support on iOS or macOS or another OS? Also what do you mean by "make some assumptions about the presentation-time"?

    Thanks,
     
  33. dooyul_park

    dooyul_park

    Joined:
    Sep 20, 2017
    Posts:
    15
    Thank you for the quick reply!
     
  34. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    So in Windows 7 we use the legacy Microsoft DirectShow codecs for playback, but in Windows 10 we default to using the newer Media Foundation codecs. Both have different functionality. Negative playback is something that neither profess to be able to do very well. Most codecs don't support negative playback.

    If negative playback is supported, then the performance of that playback will depent on how the video is encoded. Most H.264 compression is optimised for forward playback by using B and P frames. You can optimise for negative playback by encoding without B frames, and using as few P frames as possible. This boils down to disabling B frames and having the GOP (gap between keyframes) as small as possible - ideally 1 or 2 frames. This will make the video file size a bit larger.

    The seeking issue the same issue. We have two functions for seeking - Seek() and SeekFast() the SeekFast() just seeks to the nearest keyframe, so it is not that accurate but it is fast. Seek() can seek to any point in time, but it can be slow if the position it is seeking to is very far from a keyframe - in this case internally it must render the video from the previous keyframe until it reaches this time, and this of course is very costly.

    I hope that helps.

    Thanks,
     
  35. SagarPatel

    SagarPatel

    Joined:
    Jan 23, 2014
    Posts:
    3
    Hi! Quick question about the Playback Rate / Resample feature.
    Currently doing playback at a rate slower than 1.0f seems to display individual frames, but I was hoping for a blended result (so that you get a smooth feel).
    I was digging around the MediaPlayer.cs code a little and it looks like there's some support for this via the Resampler.
    Forcing it on (and using LINEAR instead of default POINT) caused errors: it looks like it's missing a mat/shader --> "AVProVideo/BlendFrames" (Resampler.cs, line 107)
    Is this a feature that isn't ready yet or am I just missing some files somehow?
    Thanks!
     
  36. DarkMio

    DarkMio

    Joined:
    Feb 10, 2016
    Posts:
    7
    The base issue stems from calculating the presentation time of a stream. AppleCoreMedia and Windows Media Libraries assume the presentation time by summarising the remaining parts of the playlist - while ffmpeg reads the actual presentation time in the ts chunk.

    We're currently working on iOS and MacOS, but do use occasionally WinRT (Hololens), where a similar problem occurs.

    Assumptions about presentation time boils down that we have a service identifying objects in a stream and stream this data into a client. So we have to resync that data with the running stream which is currently impossible without writing a huge, long M3U8 playlist.
     
  37. nwxp

    nwxp

    Joined:
    Apr 4, 2017
    Posts:
    19
    Hello, I would be happy to have access to this Beta.
    I bought Windows edition, not sure about Android, but I would be happy to pay for Android too if I need to in order to access beta.

    Again, thanks for your wonderful work.
     
  38. AxisUnity

    AxisUnity

    Joined:
    May 16, 2017
    Posts:
    12
    It certainly has helped alot, thank you! I will be able to simulate a negative playback even if the user's codec doesn't allow it if the video is encoded with only 'I' frames and using Seek() or SeekFast(). On a side note, you might want to add a warning when someone tries to set a negative playback rate when it just gets reverted back to the old positive value.
     
  39. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    The resampler feature is in beta and not currently part of the exposed API so you shouldn't try to enable it :)
    It *may* help with what you're trying to do, but it wasn't written for that. Currently to support what you want to do, you would have to implement it yourself. So you would have to cache the texture for the previous frame, and display it using your own blend shader with the current frame...
     
  40. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I'm afraid I still don't understand :) In any case, we don't expose any of the HLS streaming time data currently, so I'm not sure what else I can add to this. Let me know how else we can help.
     
  41. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Thanks :) We don't have any beta system currently so I'm afraid you'll have to wait for the release. Hopefully not too much longer now...
     
  42. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes good idea.. have added to the list. Thanks,
     
  43. AndrewRH

    AndrewRH

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

    AVPro Video version 1.6.15 has just been released!

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

    Changes include:

    Windows
    • Fixed an issue mainly affecting Windows mixed reality and VR headsets using “hybrid-gpu” mode where more than one GPU is available to the system
    • Fixed the WSA 8.1 x86 DLL that didn’t get recompiled since 1.6.12
    Thanks,
     
  44. DarkMio

    DarkMio

    Joined:
    Feb 10, 2016
    Posts:
    7
    I can elaborate further on it.
    We have a combined system that takes video frames and splits them to two services:
    - one recognises objects per frame
    - one recodes the stream to HLS

    The signal is only temporarily used, so both systems start occasionally at presentation-time 0. As I figured out, AppleCoreMedia calculates the presentation time based on the amount of chunks written into the M3U8 file. So, if you have 50 x 10s chunks in your M3U8 and AppleCoreMedia decides to play the 48. as entry point, it will report the presentation time of that 48th chunk as 48 x 10s = 8min. This might be incorrect, since it's possible to have a circular m3u8-list in which the oldest chunks get deleted and more recent appended, leading to a situation where AppleCoreMedia assumes the wrong presentation time, because it doesn't bother to read the presentation-time embedded in the .ts-chunk.

    One of our solutions, besides making long, long HLS lists is to read the currently displayed chunk, download it manually and parse the header ourselves. From there out on we can determine the offset between the reported time of AppleCoreMedia and the actual embedded presentation time.
     
  45. xpansivevr

    xpansivevr

    Joined:
    Jun 22, 2016
    Posts:
    27
    Hi there seems to be an issue with the 180 implementation where its stretching the projection vertically. I've tried my own footage and third party with the same result.

    I've tested 3840x1920 SBS and 1920x1920 mono both show the same issue.

    I've created my mono footage by taking a 180 degree 1920x1920 crop from an existing 360 equirectangular 3840x1920 comp.

    Cheers - Nick
     
    Last edited: Oct 6, 2017
  46. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370
    I have a stupid request or a question.

    can AV Pro play ... images? :D

    I know this sounds retarded but I'm currently prototyping something and I'm using still images to test stuff. I had to convert the still imagest to mp4 files and ... I'm working currently like this.

    2nd Question:

    Is there a way to cross fade between videos?
    I have 1 sphere & multiple Media Players. I know which Media Player will be next & it's already loaded.
     
  47. PhilippeGe

    PhilippeGe

    Joined:
    Sep 17, 2017
    Posts:
    6
    Hi,
    I have used the trial version and find out that my video stereo file (2048x2048 top-down) is not playing really fluid especially when i turn my head. what could i improve that please? is there any buffer to modify? would it help to desable logging or debug GUI options? in order to improve the performance? thanks for your help. I watch the output on cardboard mode stereo 360
    thanks
     
  48. andwoo1

    andwoo1

    Joined:
    Feb 27, 2017
    Posts:
    6
    Hey AndrewRH,

    Do you have an ETA when the new HLS Android settings will be available? Will these new controls also be available for iOS?
     
  49. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Posts:
    102
    Setting VR... InputTracking.disablePositionalTracking = true; makes the stereo hit and miss, left and right eye seem to flip back and forth. (tested only on Oculus Windows Desktop)
     
  50. Folstrym

    Folstrym

    Joined:
    Apr 11, 2016
    Posts:
    5
    Hello everyone

    I'm currently using AVPro and the CaptureFromTexture component and I would like to know if it's possible to use multiple Audio Source when recording. Currently I use the microphone of the device to record the audio, but I would like to record the sounds played in the scene too.

    Thank you !