Search Unity

In hololens Playback of mp4 audio stutters a lot

Discussion in 'VR' started by LR-Developer, Nov 15, 2017.

  1. LR-Developer

    LR-Developer

    Joined:
    May 5, 2017
    Posts:
    109
    Hello,

    I have Unity 2017.1.2p2 installed.
    If I Play a mp4 Videoclip with a Videoplayer, the Audio stutters a lot.
    I can only use a Audiosource, not Diret Mode, and I tried different Project Settings / Audio but I cannot Play my Video Clips with Audio in a good Quality. If I play them in VLC or in the HoloLens Gallery, the Audio is perfect.

    It is for all mp4 Videos. The Resolution is not too high, I also recorded some with the hololens itsself and have the same Problem there.

    Any help?

    Thanks a lot!
     
  2. marjan

    marjan

    Joined:
    Jun 6, 2009
    Posts:
    563
    Don´t know if it helps... i tested VideoPlayer on HoloLens quite a bit:
    - Full HD mp4s: framerate Drops to 30 FPS or less. If you have more expensive stuff going on at the same time it Drops more. Audio will suffer now.
    - normal HD is better and lower resolutions even more. Unless you try to do 360 Video and just Play on a plane or so the difference is hard to see, so go for the lower res.
    - try to transcode your Video in unity. Sometimes this improves the Situation (although i really dont know why).

    try not to use Spatial Sound and no Doppler!

    And from 2012.1 release notes:
    Audio: On Windows, AudioSource attached to VideoPlayer produces choppy sound when game iterations are overrunning. Will be fixed in future Unity release. (895458)
     
    derdimi and LR-Developer like this.
  3. LR-Developer

    LR-Developer

    Joined:
    May 5, 2017
    Posts:
    109
    With higher Solutions it gets worse.
    But even with lower resolutions the Sound is still bad.
    I hope it will be better in a future release, thanks for the hint :)
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Are you by any chance running the build in debug configuration?
     
  5. Octoplow

    Octoplow

    Joined:
    Jan 24, 2015
    Posts:
    6
    We detached audio from our HoloLens video content, and run it separately to avoid pops/stutter.
     
  6. LR-Developer

    LR-Developer

    Joined:
    May 5, 2017
    Posts:
    109
    No, it is a release build. Happens all the time.
    I removed the Audio from the Video, and made a seperate mp3 from it, then Quality is very good.

    But that is not a good solution, I have some Kind of assitant with a lot of mp4 Videos.
    The Problem is for every single one. Hi resolutions are extremly bad, but for low resolutions it is also not as good as a seperated mp3.
     
  7. derdimi

    derdimi

    Joined:
    Mar 6, 2017
    Posts:
    33
    I have the same problem. Detaching audio from video is not an option for me.

    1. I had to transcode the video to 480p.
    2. Like marjan pointed out, there is a bug in Unity 2017.1. Apperantly the AudioSource Component should not be on the same GameObject as the VideoPlayer. So I separated them and the audio quality is a lot better now.

    Issue 895458:
    https://issuetracker.unity3d.com/is...p4-files-with-videoplayer-created-from-script

    Issue 899620:
    https://issuetracker.unity3d.com/issues/win-stuttering-sound-of-mp4-files-video-lags
     
    Last edited: Dec 5, 2017
  8. LR-Developer

    LR-Developer

    Joined:
    May 5, 2017
    Posts:
    109
    Thanks for the hint!
    I already found out, too. But audio is stil not good then. Only a Little better.
    I have 720p MP4 Videos and the Audio is not good, only when I seperate the Audio stream to an mp3 and Play that parallel it is very good. So it can not be a Performance Problem in my opinion...
     
  9. gpred

    gpred

    Joined:
    Jul 4, 2013
    Posts:
    6
    I am having this issue and I am running the build via debugging-->start debugging in visual studio. Is there another way? This is the only way I have read to launch the app on HoloLens.
     
  10. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
    Could I get a repro project from one of you that way I can test using the same video/audio you guys are trying to implement in your projects? You can post a link here or DM me with a link if you don't want it publicly available.
     
  11. gpred

    gpred

    Joined:
    Jul 4, 2013
    Posts:
    6
    I got this working reasonably well, then out of nowhere the following exception and things don't work anymore,

    UnityPlayer_UAP_x86_master_il2cpp.pdp not loaded
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    That is not the reason for your crash. The debugger just tries to load it automatically if you crash and tells you if it cannot. You can load that PDB from https://symbolserver.unity3d.com if you add it to your symbol loading paths setting in VS.
     
  13. gpred

    gpred

    Joined:
    Jul 4, 2013
    Posts:
    6
    So I went back to old projects on which I have changed nothing. None of them work anymore. The Unity splash loads then the HoloLens crashes. Any ides?
     
  14. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    What's the callstack for the crash? Is there anything in the log?
     
  15. gpred

    gpred

    Joined:
    Jul 4, 2013
    Posts:
    6
    Tried it on a second HoloLens and it worked. Went back to the first and it started working again. Bizarre. I was building all day and testing various settings on the first one. I wonder if I need to do a factory reset on the HoloLens or something?