Search Unity

  1. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  2. 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,711
    Hmm, which version of AVPro Video are you using? I would recommend the latest version (1.5.12) for Hololens development. Perhaps there are some error messages in the log / console?

    Thanks,
     
  2. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,711
    Hmm...I have no idea.. it should work in Vista.... I guess we will have to get an ISO and do some testing. We'll add it to the TODO list.

    Thanks,
     
    teunververs likes this.
  3. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,711
    I'm not sure whether the issues are related. It doesn't look like it. Can you not download the new version and create a new Unity project to test it? Which old version of AVPro Video are you currently using?
     
  4. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,711
    Which version of AVPro Video is this with? Which Android device+OS? Which version of Unity?
    Thanks,
     
  5. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,711
    Hmm strange. Have you tried some of the HLS streams we mention in the PDF documentation?
    It looks like the stream doesn't have enough key-frames, or that the key-frames aren't aligned with the chunks... Is it possible you can change the way that the stream is created?
     
  6. infinite360VR

    infinite360VR

    Joined:
    Apr 19, 2016
    Posts:
    23
    This was seen in AvPro version 1.5.10 with Unity 5.4.2f2 on Samsung S6 phone with androi 6.0.1

    This was in AvPro's whatever version was before 1.5.10 with Unity 5.4.2f2 on Samsung S6 phone with androi 6.0.1.
    While running on sphere360, occasionally it goes black and logcat shows the stated exception. I have updated to 1.5.10 and error seems to be gone. I just needed to confirm that it won't happen in a released app.

    Thanks
     
  7. prosense

    prosense

    Joined:
    Nov 9, 2016
    Posts:
    1
    on android and ios streams looks ok. only windows version of plugin give to us this results. when we check the same stream in VLC on windows, it look good too. so i think its plugin problem, not stream.
     
  8. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,711
    Could you share the stream URL with us? Email unitysupport@renderheads.com
    Thanks,
     
  9. mkneib

    mkneib

    Joined:
    Aug 3, 2016
    Posts:
    6
    Hi Andrew,

    i am already using 1.5.12 with Unity 5.5.0f3. No error messages.
    I compiled the project this morning and suddenly the video (BigBuckBunny_720p30) shows up.
    With the next build, it was gone again. I don't see any pattern.
    I assume it has something to do with the settings for debug or release in Visual Studio.

    Perhaps somebody can provide an Hololense example, wich is working in the emulator?

    Cheers
    Micha
     
    Last edited: Dec 13, 2016
  10. teunververs

    teunververs

    Joined:
    May 22, 2015
    Posts:
    25
    Thanks for the reply!

    Do you have any ETA on when you'll test it?
     
  11. teunververs

    teunververs

    Joined:
    May 22, 2015
    Posts:
    25
    PS: we started getting reports that it's also not working on computers running Windows XP SP3.
    It's giving the same error there as well.
     
  12. Sulla__2014

    Sulla__2014

    Joined:
    Dec 14, 2013
    Posts:
    21
    Hello,
    I bought your asset yesterday and am adapting the video controls demo for my game. In the VCR script Start function I get a message from the "AddListener" saying that "AVProVideo.MediaPlayerEvent does not contain a definition for 'AddListener'". I assume this means that the event system won't work: how do I fix this? (This also happens in the demo.)
    I want the videos in the list to autoplay one after the other, so I was using the FinishedPlaying event to increment the list index and start the next video. Is that the best way?
    Help appreciated.
     
  13. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    Hmm that sounds quite strange. Are you importing the namespace "RenderHeads.Media.AVProVideo"?, just as a sanity check :)

    With regards to playing videos one after another, your method sounds good. However, there will most likely be a small delay between the videos since the player requires time to load the video (which occurs asynchronously). Should you wish to have seamless transitions, it may be better to rather have 2 players, one with the current playing video and the other with the next video already pre-loaded, and then switch between the players when you need to play the next video.
     
    teunververs likes this.
  14. Sulla__2014

    Sulla__2014

    Joined:
    Dec 14, 2013
    Posts:
    21
    Yes, the namespace is there...
    The event messages do come up in the Console when the demo scene is played, so the AddListener must be working??
    This scene does have a worrying habit of crashing Unity, but I don't know if this is the problem.

    Is it better to keep all the clips as a single video file, then have an "isLooping" bool, and if this is true, and the video time is within the limits of a particular clip to jump the playhead back to the beginning of that clip? Would that keep the transition seamless?

    Thank you.
     
  15. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    If possible, can you send a code snippet or a demo scene to unitysupport@renderheads.com? Just so we can get a better idea of what's going on.

    With regards to your single video seeking idea, it will work, but the speed of a seek operation depends on how your video is encoded. You ideally want many key-frames (low GOP size). The low GOP size also helps with seek accuracy on some encoders as not all of them seek to the exact location.
     
  16. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,711
    Hi,
    You could use the event system, or you could also just poll the MediaPlayer each frame:

    Code (CSharp):
    1. public MediaPlayer _mp;
    2.  
    3. void Update()
    4. {
    5.      if (_mp != null && _mp.Control != null)
    6.     {
    7.          if (_mp.Control.IsFinished())
    8.          {
    9.                // Add code here to change video
    10.          }
    11.     }
    12. }
    Or you can have a look at the "Demo_imGui.unity" demo scene, which uses "SimpleController.cs" and that code shows you how to use the AddEvent system. The demos should work without any problem - if they don't, please let me know which version of Unity you're using. We've tested in everything up until Unity 5.5.

    Thanks,
     
  17. Sulla__2014

    Sulla__2014

    Joined:
    Dec 14, 2013
    Posts:
    21
    Thank you. I'm using Unity 5.0.0. I've tried the demo on two machines, one is W7 and the other is W8.1, and the same red box appears over "AddListener".
    I'll avoid using events for now, and see how it goes.
     
  18. Sulla__2014

    Sulla__2014

    Joined:
    Dec 14, 2013
    Posts:
    21
    Hello, I've got the cutscenes canvas to play a test mp4 when it should - but how do I force the video to fit the screen?
    I'm using a ugui panel with the ugui script. If I check Set Native Size the video is too large and is anchored so that its top right corner is at the centre of the screen. My video is 1068x600, same as the game resolution.
    Thanks!
     
  19. Sulla__2014

    Sulla__2014

    Joined:
    Dec 14, 2013
    Posts:
    21
    Please forget this question! I had the wrong anchor set!
     
  20. Sulla__2014

    Sulla__2014

    Joined:
    Dec 14, 2013
    Posts:
    21
    Hello,
    With the split file method I get a white flash as each clip is loaded, so I'll try the single file method instead.
    I used After Effects to encode my frames to an avi, then ffmpeg to encode this to an mjpeg at a quality setting of 5. This leaves an avi of 129Mb. What GOP size would be best for seeking / looping this file? Would you recommend a different video format?

    Also, I see that the MediaPlayer script also has the red box over the Invoke event method... Is it safe to merely comment out any reference to the event system?

    Thank you.
     
  21. UmairEm

    UmairEm

    Joined:
    Nov 7, 2015
    Posts:
    31
    @AndrewRH

    I am using latest version of AVPro Video complete on android for a gear VR app. In recent build, I have faced the following problem on
    Android 5.1.1 (S6 and Note 5)
    Unity 5.4.2f2
    Video encoding: H.264. size: 150MB. bitrate : 8Mbps (loadind from streaming assets)

    Video texture on sphere isn't visible, can only see black texture. But can hear audio. I tried to debug it using logcat to find out that whenever I play the video, logcat is flooded by following error message:

    note: this only appears in Lollipop and works fine on Android 6 and above.
    Can be fixed by disabling option: use Fast OES Path from media player inspector. but that only results in device overheating in 3-5 minutes of app usage on Gear VR.

    I believe this is related to Android OES Texture Support Issue. Can you please fix this asap or provide alternative which can be used for now. I have tried different combinations of shaders and Fast OES option but nothing worked.

    Thanks
     
  22. AndrewRH

    AndrewRH

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

    I think the only solution here is to use Unity 5.3.6. Unity seem to have changed / broken OES texture support from Unity 5.4.0 upwards - I'm trying to get them to fix it...
     
  23. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,711
    1) The smaller the GOP size, the faster the seeking/looping will be. GOP = 1 is the minimum.
    2) I'm not sure what the problem could be...does it say anything if you hover your mouse over the red boxes? The event system could be commented out if it's causing a problem, but I've never heard of this before.
     
  24. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,711
    5.0.0 is old and buggy. My personal recommendation is 5.3.6
     
  25. Sulla__2014

    Sulla__2014

    Joined:
    Dec 14, 2013
    Posts:
    21
    I'd like to upgrade, but I'm near to finishing the game... Has anyone upgraded mid-project? Does that not cause problems?
     
  26. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    I just tested the plugin on 5.0.0 and it works with events. Not entirely sure why yours isn't, very confusing. Would it be possible for you to email an example piece of code that isn't working over? Maybe something is missing, but difficult to tell without seeing the code.
     
  27. SunriseRH

    SunriseRH

    Joined:
    Aug 5, 2016
    Posts:
    107
    email address: unitysupport@renderheads.com
     
  28. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,711
    Okay, we've done some testing on XP and Vista. So I think the issue is that you're using the H.264 codec, and Microsoft only introduced a decoder for H.264 in Windows 7. So if you're targeting older platforms you have two options:

    1) Re-encode your videos into a compatible format (something like H.263 or DivX or WMV)
    2) Install LAV Filters (I'm not sure if it's XP compatible) as this includes an H.264 decoder:
    https://github.com/Nevcairiel/LAVFilters/releases

    Thanks,
     
  29. Sulla__2014

    Sulla__2014

    Joined:
    Dec 14, 2013
    Posts:
    21
    I've just imported your asset into a backup game version with no errors. I'll test this again and see what happens.

    I get the red boxes in MonoDev even in a bare project with only AVPro Video imported, with the hover message:
    "error CS0117: 'RenderHeads.Media.AVProVideo.MediaPlayerEvent' does not contain a definition for - "
    in VCR.cs AddListener
    in MediaPlayer.cs Invoke
    in AudioOutput.cs Add/RemoveListener
    and I get the same when I import the asset into my project.
    Yet - I get the Event messages in the Console...
    So is this some glitch in MonoDev?
     
  30. UmairEm

    UmairEm

    Joined:
    Nov 7, 2015
    Posts:
    31

    Unfortunately, I can't downgrade to older version of Unity in this project.
    How soon shall I expect this to be fixed?
    Do you recommend any codecs for video which can reduce overheating (H265, VP8 etc)?
    Or would other shaders (Unlit Transparent, Stereo UV) be better in this scenario?
    As this only affects the app in Lollipop, do you recommend any workaround for this specific version of Android?

    Thanks
     
  31. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,711
    As I said, it's an issue with Unity, so I don't know if they will ever fix it. We found H.265 worked best...and we of course profiled our apps to make them run as light as possible for long VR video playback sessions. I wouldn't use a transparent shader unless you need it - it's more expensive than an opaque shader. You can probably tweak the ApplyToMesh script to only apply once, instead of every frame.... The OES rendering was essential though....I really hope that Unity fix it soon, but yeah we had built our project in 5.3.6, but I see 5.3.7 is out so I would probably try that..
     
  32. UmairEm

    UmairEm

    Joined:
    Nov 7, 2015
    Posts:
    31
    Thanks Andrew!
    I will try your recommendations
     
  33. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,711
    Yes it just sounds like a glitch in Mono Develop - nothing to worry about
     
  34. lucasTOG

    lucasTOG

    Joined:
    Oct 12, 2016
    Posts:
    7
    Hi!

    I upgraded Unity to 5.5.0 and AVPro VIdeo to the last version, and I'm seeing that in Android platform, the AVPro Logo is displaying at the beginning of all videos (sometimes for just one frame).

    Do you know what may be causing that?

    Thanks!
     
  35. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,711
    Could you take a screenshot of it? Is it perhaps just the icon graphic that's appearing? This is possibly just an editor setting for when there is no frame yet. This shouldn't happen in a normal build. You can also set the "default" graphic to display when there is no texture yet in the component (ApplyToMesh, DisplayUGUI etc).

    Thanks,
     
  36. Sulla__2014

    Sulla__2014

    Joined:
    Dec 14, 2013
    Posts:
    21
    Hello,
    I have sets of cutscene videos arranged similarly to your VideoControls demo, except that in my hierarchy the three components, UICanvas, VCR and MediaPlayer are children of separate Game Objects, "Cutscenes 1", "Cutscenes 2", etc. I have renamed the components for each cutscene group (but not the MediaPlayer script). One of these parent objects is enabled at a time at a certain point, the (single) video plays, then that Game Object is disabled.
    However, only the video in the first group plays. The others show the canvas with its controls but no video. The Console shows the error eg, "File Not Found ... [backslash space backslash] 2.avi"
    I have all videos in the StreamingAssets folder, and swapped them, and they work if they are used by the first cutscene group...
    I have Auto Open unchecked, and use each VCR script to supply the video name.
    Could you help with this please? I don't understand why the first video plays but not the others...
    Thank you.
     
  37. Sulla__2014

    Sulla__2014

    Joined:
    Dec 14, 2013
    Posts:
    21
    Problem solved... Night's sleep... Mind working... I stripped out the file-loading from the VCR scripts and set the single file in the MediaPlayer scripts. All working. Excellent asset.
     
  38. smeagols

    smeagols

    Joined:
    Oct 5, 2013
    Posts:
    36
    Hi @AndrewRH,

    There is any way to view a YouTube video on AVPro Windows Standalone version through url?
     
  39. sethm

    sethm

    Joined:
    Dec 19, 2016
    Posts:
    3
    Hey @AndrewRH,

    Been using AVPro for a while now and wanted to say thanks for all the hard work.

    I know AVPro has recently implemented audio-support, and I wanted to know if there were any plans to add support for 1st-Order Ambisonics to allow positional audio for 360 videos.

    Thanks again!
     
  40. Sulla__2014

    Sulla__2014

    Joined:
    Dec 14, 2013
    Posts:
    21
    Hello,
    Is it possible to use AVPro Video transparency to create a splash screen which is smaller than the user's desktop (and shows some of that desktop behind the splash)?
    I have a scene which fades in / out to show a splash image, but it uses the UI so I can only have a Unity background, not transparency.
    Thank you.
     
  41. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    720
    can this support Linux ?
     
    Who-am-I likes this.
  42. Who-am-I

    Who-am-I

    Joined:
    Mar 29, 2014
    Posts:
    73
    I also need Linux support. I downloaded your trial version But before purchase AVPro, I want to confirm that your plugin have Linux support?
     
  43. markachten88

    markachten88

    Joined:
    Apr 24, 2015
    Posts:
    31
    Gentlemen. An update. We seem to have managed getting the plugin to work on Vista and XP by installing the CCCP. But now we're facing an issue with playing the video in WebGl on a mac in Safari. Runs fine in chrome and ff, but safari not.
    Any clues, anyone? Thx!
     
  44. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,711
    Please read the FAQ in the PDF documentation for notes about YouTube support.
    Thanks,
     
  45. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,711
    No this isn't possible - this is a limitation of Unity. Unity doesn't support alpha transparency blending with Windows Desktop....
     
  46. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,711
    Not yet...maybe in 2017...But with Unity's native video support coming we'll have to see if it's really needed?
    Thanks,
     
  47. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,711
    Thanks :)
    We're currently looking into Ambisonics support....Sorry I don't have any more information than that right now.
     
  48. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,711
    Web browsers are very fiddly beasts.... Which version of Safari are you using? We'll have to try to debug this in the new year..
    Thanks,
     
  49. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,711
    Not yet...maybe in 2017...But with Unity's native video support coming we'll have to see if it's really needed?
    Thanks,
     
    Who-am-I likes this.
  50. Who-am-I

    Who-am-I

    Joined:
    Mar 29, 2014
    Posts:
    73
    Thank you @AndrewRH
     
unityunity