Search Unity

Video Android App crashes when starting VideoPlayer Component

Discussion in 'Audio & Video' started by Flying_Space_Turtle, May 26, 2019.

  1. Flying_Space_Turtle

    Flying_Space_Turtle

    Joined:
    May 23, 2019
    Posts:
    4
    I have a menu scene that has a button that loads a different scene that contains the video player object. In the editor, I press the button and it loads the scene and plays the video fine. However, when I do the same in the Android app, when it tries to load the video the app crashes. The video is a .mp4 and about 30MB. I even tried transcoding it. I'm using a Samsung Galaxy 8+ with Android version 9. I'm using the latest Unity. Any ideas?
     
  2. jocyf

    jocyf

    Joined:
    Jan 30, 2007
    Posts:
    288
    Try using HandBrake (it's free) to reconvert again your mp4 video to mp4.
    Codec: h264
    Encoder profile: BaseLine 3.
    FPS: 30fps,
    Encoder preset: Medium, fast or very Fast
    Be sure to use an mp4 extension in your new video (not mkv).
     
  3. Flying_Space_Turtle

    Flying_Space_Turtle

    Joined:
    May 23, 2019
    Posts:
    4
    So do you think it's the file type that's causing it to crash when I use it on the Android device? Thanks for the suggestion, I will try it!
     
  4. Flying_Space_Turtle

    Flying_Space_Turtle

    Joined:
    May 23, 2019
    Posts:
    4
    Tried it..still crashes. :(
     
  5. jocyf

    jocyf

    Joined:
    Jan 30, 2007
    Posts:
    288
    Uh! It worked for me in my phone and I''m using an old LG G5.

    Some ideas:
    You could try using a -30 secs- short video clip (converted using handbrake) and see if that works.
    Try the same but without any audio channel in the video (just in case).

    Another thing you could try is to create an empty project and just create scene with a VideoPlayer using only the code needed for that player (if any). Create the player in 2017.4 for example so if it works you can open that same project in more recent Unity versions...

    All this suggestions are things I've done myself when testing the videoplayer in several IOS & Android devices... Creating an empty protject to test it it's the only way to discard that any other code is causing problems.
     
  6. Morwin25

    Morwin25

    Joined:
    Oct 20, 2016
    Posts:
    4
    Hi @Flying_Space_Turtle

    I have used Video Player Component many times in my projects and i didn't have any problem. Buy recently i have started a project with Unity 2019.1.0f2 and the app crash when i try to open the gameobject with the videoplayer component, so maybe is the version of Unity.

    Solutions
    - Try to change the version ( 2018.1.4f1 works fine! (Tested))
    - Wait until someone can help us
     
    jocyf likes this.
  7. BBIT-SOLUTIONS

    BBIT-SOLUTIONS

    Joined:
    Feb 21, 2013
    Posts:
    39
    Hi @Flying_Space_Turtle

    had the same problem in Unity 2019.1.6.
    Removing Vulkan as Graphics API in Player-Settings fixed it for me.
     
    ina and jocyf like this.
  8. BBIT-SOLUTIONS

    BBIT-SOLUTIONS

    Joined:
    Feb 21, 2013
    Posts:
    39
    In Release Notes of Unity 2019.2:

    "Android: The Unity video player can now be used with the Vulkan renderer."

    So maybe a simple update to that version could also fix it now.
     
  9. GamdineProductions

    GamdineProductions

    Joined:
    Aug 18, 2016
    Posts:
    12
    Hey Guys,

    I just had the same issue, I am using 2019.1.12f1

    EDIT: Removing Vulkan as Graphics API in Player-Settings fixed it for me.
    Thanks!
     
    Last edited: Aug 6, 2019
  10. cihad_unity

    cihad_unity

    Joined:
    Dec 27, 2019
    Posts:
    35
    I confirm that removing Vulkan solves the problem.
    FYI, video player with Vulkan causes 50% of the devices crash.
     
  11. juanjuan80

    juanjuan80

    Joined:
    Mar 12, 2020
    Posts:
    1
    Yes, great