Search Unity

Video VideoPlayer Crash on Android - workarounds?

Discussion in 'Audio & Video' started by talyh, Jun 18, 2019.

  1. talyh

    talyh

    Joined:
    Dec 2, 2016
    Posts:
    20
    Hello.

    I've seen VideoPlaying on Android has encountered many issues in the past, but all seem closed now.

    However, using Unity 2019.1.4f1, building to Android (Pixel 2, Android v9) and attempting to play a VideoPlayer still crashes the application or simply doesn't work (depending on the video being played).

    With a local videoclip asset:
    Crash. Full log can be found at https://gist.github.com/talyh/0eb38b201fcb0847d8b6af6e83a00b8b.

    With a remote videoclip url:
    Doesn't render the video, doesn't crash.

    The sample project, along with built apk, can be found at:
    https://github.com/talyh/UnityVideoPlayerIssue

    Anyone venture a guess if this is an old issue resurfaced, a new issue, or just an improper configuration issue?
     
  2. talyh

    talyh

    Joined:
    Dec 2, 2016
    Posts:
    20
  3. GUIVASCONCELOS

    GUIVASCONCELOS

    Joined:
    Sep 3, 2017
    Posts:
    1
    I'm having exactly the same problem here... Can't find a solution
     
  4. fiachradunn

    fiachradunn

    Joined:
    Jan 12, 2019
    Posts:
    2
    Having a similar issue, and think it may be to do with the size of the files at the URLs.
    (Unity 2019.1.8f1, Android Device : Lenovo Phab 2 Pro)

    I'm streaming videos from Microsoft Azure, which all works perfectly in the editor but not when I build to Android. I've been testing with two distinct videos, one is about 30 seconds and has a low resolution and seems to stream without issue, the second is almost 11 minutes and has a higher resolution. Even after several minutes the larger video won't play.

    I'm assuming since the smaller video works, size may be what's causing the issue?
     
  5. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    808
    We are trying 1MB videos and seeing the same happen

    adb log does not show a reason for the crash
     
  6. Webar1204

    Webar1204

    Joined:
    Jun 4, 2018
    Posts:
    1
    I have the same issue on new Android 9, video not playing via url. But on android 6-7 works fine.
    Log shows me this error

    AndroidVideoMedia: Error opening extractor: -10000
     
  7. linguangya

    linguangya

    Joined:
    Aug 12, 2013
    Posts:
    5
    I got the same problem.
    and the device is honour 6 plus。
    I have the log
    Code (CSharp):
    1. I/System.out( 5044): true
    2.  
    3. I/        ( 5044): uri = /storage/emulated/0/Android/data/com.sevensixgame.pokemon/files/start_video.mp4
    4.  
    5. I/        ( 5044): after judge whether is youtube , isWidevine = 0
    6.  
    7. I/MPEG4Extractor( 5044): kKeyAVCC chunk_data_size(40)
    8.  
    9. I/MPEG4Extractor( 5044): mIsAVC = 0
    10.  
    11. I/MPEG4Extractor( 5044): kKeyAVCC size(40)
    12.  
    13. I/OMXClient( 5044): Using client-side OMX mux.
    14.  
    15. I/img:vdec:omx( 2459): Created VdecTask b8022e98
    16.  
    17. I/img:vdec:omx( 2459): IMG_OMD_ComponentInit Done.
    18.  
    19. I/MediaCodec( 5044): Found 2 pieces of codec specific data.
    20.  
    21. I/img_omd_vdec_task( 2459): >>>>>>>psPortDef->nPortIndex = 0 xFramerate = 0
    22.  
    23. I/img_omd_vdec_task( 2459): xFramerate > 60000, not reasonalbe , mFrameRate = 0
    24.  
    25. I/ACodec  ( 5044): allocateBuffersOnPort,isHevc = 0
    26.  
    27. I/ACodec  ( 5044): allocateBuffersOnPort,isHevc = 0
    28.  
    29. I/OMXClient( 5044): Using client-side OMX mux.
    30.  
    31. I/Unity   ( 5044): musicName start_move_music.mp3
    32.  
    33. I/Unity   ( 5044):
    34.  
    35. I/Unity   ( 5044): (Filename: ./Runtime/Export/Debug.bindings.h Line: 45)
    36.  
    37. I/Unity   ( 5044):
    38.  
    39. E/IMG     ( 5044): Assertion failed: ghDeviceFileHandle >= 0, file vendor/thirdparty/imagination/imgvideo/port_fwrk/libraries/sysbrg/linux/code/sysbrg_api.c, line 70
    40.  
    41. E/IMG     ( 5044): Assertion failed: ui32Result == IMG_SUCCESS, file vendor/thirdparty/imagination/imgvideo/port_fwrk/libraries/sysbrg/linux/code/sysbrg_api.c, line 117
    42.  
    43. E/IMG     ( 5044): Assertion failed: ui32Result == IMG_SUCCESS, file vendor/thirdparty/imagination/encode/omx_components/topaz_hp/libraries/omx_core/code/omxcore.c, line 153
    44.  
    45. I/MediaCodec( 5044): Found 1 pieces of codec specific data.
    46.  
    47. I/ACodec  ( 5044): allocateBuffersOnPort,isHevc = 0
    48.  
    49. I/ACodec  ( 5044): allocateBuffersOnPort,isHevc = 0
    50.  
    51. I/SoftAAC2( 5044): Reconfiguring decoder: 0->44100 Hz, 0->2 channels
    52.  
    53. I/img:vdec:vdecapi( 2459): [SID=0x05000001] VDECDD_EVENT_STREAM_STOPPED
    54.  
    55. I/img:vdec:omx( 2459): VDEC_STOPSTATUS_CLOSED_GOP
    56.  
    57. I/img:vdec:omx( 2459): VDEC_STOPSTATUS_RECONFIGURE
    58.  
    59. I/img:vdec:vdecapi( 2459): [SID=0x05000001] VDECDD_EVENT_STREAM_FLUSHED
    60.  
    61. I/img:vdec:omx( 2459): PSC PortDefinition: Framerate (Q16) :190000, Height :848, Width :480, Stride :480, SliceHeight: 848 BitRate: 0
    62.  
    63. I/img:vdec:omx( 2459): Left :0  Top :0 Width :476 Height :842
    64.  
    65. I/ACodec  ( 5044): allocateBuffersOnPort,isHevc = 0
    66.  
    67. I/ACodec  ( 5044): allocateBuffersOnPort,isHevc = 0
    68.  
    69. E/IMG     ( 5044): Assertion failed: ghDeviceFileHandle >= 0, file vendor/thirdparty/imagination/imgvideo/port_fwrk/libraries/sysbrg/linux/code/sysbrg_api.c, line 70
    70.  
    71. E/IMG     ( 5044): Assertion failed: ui32Result == IMG_SUCCESS, file vendor/thirdparty/imagination/imgvideo/port_fwrk/libraries/sysbrg/linux/code/sysbrg_api.c, line 210
    72.  
    73. E/IMGTOPAZ( 5044): OMX_Deinit done
    74.  
    75. I/img:vdec:vdecapi( 2459): [SID=0x05000001] VDECDD_EVENT_STREAM_STOPPED
    76.  
    77. I/img:vdec:omx( 2459): #Total number of Frames Decoded: 9
    78.  
    79. I/img:vdec:omx( 2459): Exiting VDECTask
    80.  
    81. I/img:vdec:omx( 2459): Destroying VdecTask b8022e98
    82.  
    83. I/img:vdec:omx( 2459): IMG_OMD_ComponentDeInit Done.
    84.  
    85. F/SampleTable( 5044): frameworks/av/media/libstagefright/SampleTable.cpp:721 CHECK(left > 0) failed.
    86.  
    87. E/CRASH   ( 5044): signal 6 (SIGABRT), code -6 (?), fault addr --------
    88.  
    89. E/CRASH   ( 5044): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    90.  
    91. E/CRASH   ( 5044): Build type 'Release', Scripting Backend 'mono', CPU 'armeabi-v7a'
    92.  
    93. E/CRASH   ( 5044): Build fingerprint: 'Huawei/PE-TL10/hwPE:4.4.2/HuaweiPE-TL10/CHNC00B260:user/ota-rel-keys,release-keys'
    94.  
    95. E/CRASH   ( 5044): Revision: '0'
    96.  
    97. E/CRASH   ( 5044): pid: 5044, tid: 5091, name: Background Job.  >>> com.sevensixgame.pokemon <<<
    98.  
    99. E/CRASH   ( 5044):     r0 00000000  r1 000013e3  r2 00000006  r3 00000000
    100.  
    101. E/CRASH   ( 5044):     r4 00000006  r5 00000000  r6 000013e3  r7 0000010c
    102.  
    103. E/CRASH   ( 5044):     r8 00000000  r9 00000000  sl 00000001  fp 00000001
    104.  
    105. E/CRASH   ( 5044):     ip 00000000  sp 7af71128  lr 40090289  pc 4009f1c8  cpsr 000013e3
    106.  
    107. E/CRASH   ( 5044):
    108.  
    109. E/CRASH   ( 5044): backtrace:
    110.  
    111. E/CRASH   ( 5044):     #00  pc 000221c8  /system/lib/libc.so (tgkill+12)
    112.  
    113. E/CRASH   ( 5044):     #01  pc 00013285  /system/lib/libc.so (pthread_kill+48)
    114.  
    115. E/CRASH   ( 5044):     #02  pc 00013499  /system/lib/libc.so (raise+10)
    116.  
    117. E/CRASH   ( 5044):     #03  pc 000121cf  /system/lib/libc.so
    118.  
    119. E/CRASH   ( 5044):     #04  pc 00021a7c  /system/lib/libc.so (abort+4)
    120.  
    121. E/CRASH   ( 5044):     #05  pc 00006d2f  /system/lib/libcutils.so (__android_log_assert+86)
    122.  
    123. E/CRASH   ( 5044):     #06  pc 000893d3  /system/lib/libstagefright.so (android::SampleTable::findSyncSampleNear(unsigned int, unsigned int*, unsigned int)+322)
    124.  
    125. E/CRASH   ( 5044):     #07  pc 0006d4d3  /system/lib/libstagefright.so (android::MPEG4Source::read(android::MediaBuffer**, android::MediaSource::ReadOptions const*)+194)
    126.  
    127. E/CRASH   ( 5044):     #08  pc 0007c84d  /system/lib/libstagefright.so (android::NuMediaExtractor::fetchTrackSamples(long long, android::MediaSource::ReadOptions::SeekMode)+140)
    128.  
    129. E/CRASH   ( 5044):     #09  pc 0007ca61  /system/lib/libstagefright.so (android::NuMediaExtractor::seekTo(long long, android::MediaSource::ReadOptions::SeekMode)+36)
    130.  
    131. E/CRASH   ( 5044):     #10  pc 00018737  /system/lib/libmedia_jni.so
    132.  
    133. E/CRASH   ( 5044):     #11  pc 0001eb8c  /system/lib/libdvm.so (dvmPlatformInvoke+112)
    134.  
    135. E/CRASH   ( 5044):     #12  pc 0004f273  /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398)
    136.  
    137. E/CRASH   ( 5044):     #13  pc 000616df  /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+266)
    138.  
    139. E/CRASH   ( 5044):     #14  pc 0004d851  /system/lib/libdvm.so
    140.  
    141. E/CRASH   ( 5044):     #15  pc 00e6117c  /data/app-lib/com.sevensixgame.pokemon-1/libunity.so
    142.  
    143. E/CRASH   ( 5044):
    144.  
     
  8. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    808
    It seems removing Vulkan prevents the crash. However the video does not play on Android
     
    bab202 and danieldourado_2 like this.
  9. atul109

    atul109

    Joined:
    May 11, 2018
    Posts:
    2
    I have same problem of video not playing in Unity VideoPlayer in Android 9.0
    The video from a url plays first time, so it looks like a caching problem, so adding this to url solved it for me
    Code (CSharp):
    1. newVideoUrl = videoUrl + "?" + (int)UnityEngine.Random.Range(0f, 1000f);           //to avoid caching in Android 9.0
     
    Last edited: Aug 1, 2019
  10. talyh

    talyh

    Joined:
    Dec 2, 2016
    Posts:
    20
    SteveHinan likes this.
  11. pirri1721

    pirri1721

    Joined:
    Jan 26, 2016
    Posts:
    1
    This seems work for me, playing the video on android
    In Unity 2019.2.0f1
     
    kevD likes this.
  12. danieldourado_2

    danieldourado_2

    Joined:
    May 23, 2015
    Posts:
    2
    This worked for me. Unity 2019.2.0b5
     
  13. bab202

    bab202

    Joined:
    Oct 18, 2018
    Posts:
    2
    This worked for me too. After remove Vulkan, app not crash anymore when play video. Video show well as normal.