Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Video Unity 5.6.0f3 VideoPlayer does not play video in standalone EXE or APP made on OSX only

Discussion in 'Audio & Video' started by Rob-Davis, May 12, 2017.

  1. Rob-Davis

    Rob-Davis

    Joined:
    Jan 10, 2012
    Posts:
    21
    I have an MP4 video in my game that runs fine in the editor on Windows and OSX.

    If I build the game with Unity 5.6 on Windows (and the same video files) it plays video fine in a standalone Windows EXE.

    If I build the game on OSX 10.11.6 then the video will not start playing in standalone on OSX or Windows, so the game hangs.

    Play() is called, but the video never starts playing and is always at frame 0.
     
  2. Kef-niark

    Kef-niark

    Joined:
    Jun 20, 2016
    Posts:
    6
  3. inakiktp

    inakiktp

    Joined:
    Nov 6, 2014
    Posts:
    35
    I am using OSX 10.10.5 and Unity 5.6.0f3 and I am experiencing the same issue. It works in the Editor, but the moment I deploy a standalone for mac and run it, the video does not work. :(

    I tried manually playing, stopping and checking the videoplayer component status (isPlaying) and no matter what I try, I cannot make it work in standalone builds.

    I also tried the same video in different formats as one of the threads suggests that @Kef-niark linked, however, I had no success at all.
     
  4. GuardFromUA

    GuardFromUA

    Joined:
    Jan 11, 2017
    Posts:
    8
    Facing the same problem on android build.
     
  5. daggasoft

    daggasoft

    Joined:
    Jun 29, 2013
    Posts:
    22
    I have this working for me. I chalk this up to poor documentation and switching the supported codecs between movietexture and videoplayer.

    Movie Texture required OGV and would not work with MP4. Video Player requires MP4 and does not work with OGV.

    So you need to convert all of your video to mp4 and import as video clip.

    Lastly it's annoying that you can use unsupported codecs in the editor and you wont know if it will work stand alone until you build it.
     
  6. Rob-Davis

    Rob-Davis

    Joined:
    Jan 10, 2012
    Posts:
    21
    My videos are MP4 already and I still have this problem.
     
    shelkeanmol likes this.
  7. PhillipKamikaze

    PhillipKamikaze

    Joined:
    Mar 10, 2017
    Posts:
    1
    I have similar problem, using MacOS 10.12 and Building to Android. Run in Editor Mode and same when setted VideoClip it run too, but not when it is configured via script.
     
  8. Rob-Davis

    Rob-Davis

    Joined:
    Jan 10, 2012
    Posts:
    21
    Any responses from Unity on this issue?
     
  9. pro_tools

    pro_tools

    Joined:
    Jan 16, 2017
    Posts:
    1
    I'm having the same issue on Windows 7 x64 with both Unity 5.6.0p4 and 2017.1.0b4 when trying to use video player as a 360 degree video player.

    As a test project I started here: https://forum.unity3d.com/threads/playing-360-videos-with-the-videoplayer.461290/

    I think that video player doesn't support all types of '.mp4'-files. You guys can try this out to see if it runs on your machines:
    Download one of Video LAN's 360 demo videos ( http://streams.videolan.org/streams/360/eagle_360.mp4 ) and try using it with Unity's video player. This should work because you can see that there is compatible meta data with frame height and width. You can check your own videos in Windows with right click->properties and the metadata should show up.
    I didn't find a way how to generate a video file with this type of metadata in Adobe Premiere CC, though.

    Maybe anyone can help me out with this?

    It would be also very interesting if this demo video from VLC works for you as well.

    I tried to contact the poster of the topic I mentioned but I didn't get any response until now.
     
  10. Rob-Davis

    Rob-Davis

    Joined:
    Jan 10, 2012
    Posts:
    21
    Good news! It was necessary to use MP4 and also to set the video to Transcode. There were no errors to indicate this, but switching on Transcode fixed it.

     
    Hollow_Spy, programmero0 and inakiktp like this.
  11. inakiktp

    inakiktp

    Joined:
    Nov 6, 2014
    Posts:
    35
    I confirm that setting the MP4 as Transcode fixed it for me too.

    Thanks @Rob-Davis !
     
  12. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    341
    Just to clarify something, there are at least two slightly different issues here:

    1. We all seem to agree that the new VideoPlayer works correctly in the editor on both Windows and macOS;
    2. For some people (such as me), it does NOT work in a Windows build but is fine in a Mac build;
    3. For others, it does NOT work in a Mac build but is fine in a Windows build.

    My solution was to just go back to the old MovieTexture way of playing back video. For our purposes, that's all we need.
     
  13. Rob-Davis

    Rob-Davis

    Joined:
    Jan 10, 2012
    Posts:
    21
    Hi @daisyDynamics,
    That approach is OK for some users, but we specifically upgraded to Unity 5.6 to use the new video player because the MovieTexture method is not compatible with some export platforms (e.g. Xbox).
    Cheers, Rob
     
  14. Rob-Davis

    Rob-Davis

    Joined:
    Jan 10, 2012
    Posts:
    21
    Unfortunatley the fix we found is only a partial fix:
    We discovered that once we switch on Transcode, we can build on OSX and see video on OSX; we can build on Windows and see video on Windows. BUT we cannot build on OSX and run on Windows. Once again, the video player fails.
    So we would need to switch off Transcode when we want to build for Windows on OSX. This is annoying because it takes a lot of time to change this option as Unity seems to re-render the videos.
     
    sindika likes this.
  15. Rob-Davis

    Rob-Davis

    Joined:
    Jan 10, 2012
    Posts:
    21
    CORRECTION: It is not possible to build a Windows executable on OSX if you have the above issue with the Video Player. Whether Transcode is on or off, the OSX built game will not run on Windows. We now need to have 2 separate compilation machines to build with Unity, one for Windows and one for OSX.

    This is a major blow to our workflow. We were reliant on being able to build our Windows game on OSX.
     
    sindika likes this.
  16. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    341
    Rob, we're using MovieTexture fine on our Xbox One dev kits - no issues at all.

    It won't work for PS4 though - you need to use Sony's classes, but they're very straightforward and rock-solid.
     
  17. Rob-Davis

    Rob-Davis

    Joined:
    Jan 10, 2012
    Posts:
    21
    Hmm - I think we are using Video Player on both PS4 and XB1 - will double check.

    In meantime, we still have no Windows build capability on OSX which is problematic (e.g. need to be able make new PC builds at a live show, using a Macbook, so going to have to install Windows Unity on a Bootcamp partitiion just to make Windows builds).

    When switching Build Settings from OSX to Windows, Unity does a lengthy transcoding on any video files, but the result is still a Windows build that freezes on video playback.
     
  18. MathijsDV

    MathijsDV

    Joined:
    Jan 2, 2017
    Posts:
    1
    I had the same problem while building an EXE from windows and use it on windows. My video's did not play. I'm using .Webm video's with Alpha. For me the fix was to do the opposite and turn off transcoding.
     
  19. TheMightyZQ

    TheMightyZQ

    Joined:
    Aug 15, 2012
    Posts:
    28
    I'm having this issue as well. I'm developing on OSX and videos are not displaying properly on Windows build (black screen if full screen or white material if played on material)...unless I use VP8 as the transcode option. The problem is, the VP8 transcode option has terrible compression issues, so the video looks horrible. I've tried multiple H.264 options in handbrake but nothing is working. Anyone have any updates on this?
     
    Lesha-VH likes this.
  20. IQpierce

    IQpierce

    Joined:
    Jan 24, 2011
    Posts:
    43
    My project is encountering issues like these as well. We're using Unity 5.6.3p4. Are these issues improved in newer versions of Unity?
     
  21. toddalbert

    toddalbert

    Joined:
    Jan 23, 2016
    Posts:
    5
    I am running the latest version of Unity (just updated today, Jan. 3, 2018), and still having this issue.
     
  22. toddalbert

    toddalbert

    Joined:
    Jan 23, 2016
    Posts:
    5
    This dialog is not available when clicking on the videos. I only see the filename with no options.
     
    sindika likes this.
  23. stephensteelman

    stephensteelman

    Joined:
    Jan 7, 2018
    Posts:
    1
    if I import via [assets/import new asset] rather than clicking and dragging into the project or doubling clicking in the project window, I was able to see the dialog in the inspector when I then clicked on the video. weird, I know.

    however, it hasn't fixed it for me. i'm still getting a black screen when I attempt to play back video in a build. building on OSX, deploying to android. (gear VR if we are being specific).

    is there issues with aspect ratios in Unity?

    CORRECTION: got it to work. unity seems to prefer 16x9. Not having luck with 1:1 (but that's for another thread...)
     
    Last edited: Jan 15, 2018
  24. Tryny

    Tryny

    Joined:
    Jan 15, 2016
    Posts:
    1
    I have similar problem but !..... In editor video works, after build exe file (win 7) video is working without problems but then when I take this build and copy it to notebook with Win 10 (all files included) there is video missing. Can it be caused by developing on Win 7 and played on Win 10 ?
     
  25. shura0123

    shura0123

    Joined:
    Jun 26, 2017
    Posts:
    8
    I have same issue for IOS 11, I tried setting transcode but no luck!!! I am using mp4 as well and no luck too!! What to do??? Not to mention this is in Unity 2018.1.6f1
     
    learner_CL likes this.
  26. thmsgysnsby

    thmsgysnsby

    Joined:
    Apr 4, 2017
    Posts:
    1
    Have experienced all of the above. Even persists on Cloud Build. So Unity's own cloud build platform does not output a build that plays .mp4 on Windows when initially built on Mac.
     
  27. shelkeanmol

    shelkeanmol

    Joined:
    Jul 2, 2019
    Posts:
    4
    I just build a game, which has 2 scene one with game and other with my intro video, in intro i created one canvas and attached game object to it ,PROBLEM is when i build and run game the game only shows splash screen i.e. made with unity and crashes.... And when i build only with game scene it works perfectly fine any solution over this ...........my intro scene have mp4 video anyway transcode is on even tested when it was off
     
  28. Celsyum

    Celsyum

    Joined:
    Mar 4, 2019
    Posts:
    5
    I have identical situation and I need help too. Do you fixed the issue ?
     
  29. THESAHEB

    THESAHEB

    Joined:
    Jun 20, 2019
    Posts:
    1
    use unity video player with raw image so its working
     
  30. JustinTheSwift

    JustinTheSwift

    Joined:
    Feb 4, 2017
    Posts:
    5
    Same problem.

    I can't see the dialog for Transcode in the Inspector. I tried reimporting through the Assets drop down to no avail.
     
  31. ten_dlabaja

    ten_dlabaja

    Joined:
    Jul 11, 2021
    Posts:
    2
    Last edited: Jul 17, 2021
  32. Hollow_Spy

    Hollow_Spy

    Joined:
    Dec 11, 2019
    Posts:
    3
    You're amazing