Search Unity

Video Android Videoplayer errors playing from URL

Discussion in 'Audio & Video' started by dustin_red, Oct 19, 2018.

  1. dustin_red

    dustin_red

    Joined:
    Feb 7, 2018
    Posts:
    46
    I'm playing a video from a URL with the VideoPlayer on Android 4.4 and the video will not play and returns an error. It works fine on iOS.

    Code (CSharp):
    1. AndroidMediaJNI got error: java.io.IOException: Failed to instantiate extractor.
    2. AndroidVideoMedia: Error opening extractor: -10000
    This error appears to have been fixed in 2018.2.0a2:
    https://issuetracker.unity3d.com/is...tiate-extractor-when-trying-to-play-url-video

    But I'm building using Unity 2018.2.13f1, Android 4.1 min API

    The device I'm testing on is a Samsung Galaxy S5 (SAMSUNG-SM-G900A) with Android 4.4.2. So maybe because its an older device, it needs an older encoder? I used baseline profile during the compression after reading the Android supported video format list:
    https://developer.android.com/guide/topics/media/media-formats#video-formats

    Video:
    1280 x 720
    AAC, 48000 Hz, Stereo
    23.98 FPS, 2.6 Mbit/s
    Baseline profile 4.2
    H.264 mp4

    Do I need an AVI video for Android? I was hoping to have one MP4 video for both platforms.

    UPDATE: So its playing on newer Android devices from a URL. AND I have a 60 fps video playing from local on the Galaxy S5, but when playing from URL, it has errors.

    https://forum.unity.com/threads/5-6...king-on-galaxy-s3-api-18.464508/#post-3023883

    This post mentions that "...there are many bugs present in Android's implementation of the movie decoding in 4.1-4.3 (16-18)" But the device not working is 4.4.2.

    https://docs.unity3d.com/ScriptReference/Video.VideoPlayer.html

    The VideoPlayer docs mention, in the Android section:
    But again, the device not working is 4.4.2 (Kit Kat).

    Also from 5.6 changelog:
     
    Last edited: Oct 22, 2018
  2. LarsWegmeister

    LarsWegmeister

    Joined:
    Feb 9, 2018
    Posts:
    4
    I had the same problem with special characters. I was using (ß,ä,ö,ü) inside the URL. After I changed that it worked for me. Sadly not reliable. Sometimes it just doesn't play the video. Without any error in the console.
     
  3. matheus_inmotionvr

    matheus_inmotionvr

    Joined:
    Oct 3, 2018
    Posts:
    63
    Hey @dustin_red , any updates from this? I've been experiencing the same problem as you, running on an old Samsung Galaxt Tab 3, Android 4.4.2 (kit Kat).

    The curious part is that I can actually play the videos. As part of the app, I can switch between videos. On a fresh start, the selected video plays normally, but if I switch to another one, it doesn't play. I changes the settings to other videos would be the first to play and they play fine. I wonder what's causing this.

    Edit: Apparently this was fixed on 2018.3:
    https://issuetracker.unity3d.com/is...on-android-4-dot-4-when-executing-play-method
     
    Last edited: Feb 1, 2019
  4. fiachradunn

    fiachradunn

    Joined:
    Jan 12, 2019
    Posts:
    3
    I was getting the exact same error on a Lenovo Phab 2 Pro running Android 8.0.
    @LarsWegmeister 's comment got me thinking about the URL itself (It was an Azure progressive download URL for reference). I found that if you visited the URL in a browser, it replaced the white-space characters with the string '%20'.
    I tried using the new URL as the video source instead and it solved the issue.