Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Playing large video locally android app

Discussion in 'Audio & Video' started by robertandriessen, Feb 2, 2022.

  1. robertandriessen

    robertandriessen

    Joined:
    Feb 10, 2020
    Posts:
    33
    Hi,
    I have a simple videoplayer app, that needs to play back h265 mp4 videofiles that are very large, up to about 600GB. I can get it working on my desktop platforms but not on Android. It is stored on an external drive on Android which I am pointing the movieplayer to, as a test I have tried the same file but trimmed to about 500mb and that works. But a test file of 9GB was already to much to load.

    What steps can I take to get this working?

    android logcat gives me this warning:
    2022/02/02 11:49:30.532 4465 4500 Warn Unity AndroidVideoMedia: No tracks in /storage/622F5F9C4C71A481/Android/data/com.Designlab.AnotherviewPlayer/files/montesanto_h265_48native.mp4
     
    Last edited: Feb 2, 2022
  2. robertandriessen

    robertandriessen

    Joined:
    Feb 10, 2020
    Posts:
    33
    when I enter in the wrong filename it talks about openextractor trying to make it a local file. Does that mean that in reality the video file is being imported first before it can play back? Why cant it just play back from this local location via external drive?
     
  3. robertandriessen

    robertandriessen

    Joined:
    Feb 10, 2020
    Posts:
    33
    I have tried a large file that would normally fail in mp4 but after converting it to MKV it does work. So the problem seems to be in reading the .mp4 files
     
  4. DominiqueLrx

    DominiqueLrx

    Unity Technologies

    Joined:
    Dec 14, 2016
    Posts:
    256
    Hi Robert!

    This may be a problem in the underlying Android libraries doing the media file reading (https://developer.android.com/reference/android/media/MediaExtractor, if you are curious).

    Each file format has its own implementation, so it's entirely plausible that the Android mp4 reader has different capabilities than the mkv. One thing that could be happening is that on 32-bits builds, something is going wrong with sizes getting beyond 4Gb. But if you're getting to the point where you get the "No tracks in ..." message, it's because from Unity's standpoint, the media file has opened successfully, but the backing Android implementation is unable to properly parse the content. Maybe there are other messages in the logcat prior to the one from Unity that could indicate what the problem is.

    The VideoPlayer is always playing from where the file resides. When the path is detected to not be a network URL, this message is just telling you that the file cannot be found on the device's filesystem.

    Hope this explains a bit more what is happening, and glad to see you have found a workaround!

    Dominique Leroux
    A/V developer at Unity
     
  5. robertandriessen

    robertandriessen

    Joined:
    Feb 10, 2020
    Posts:
    33
    Hi Dominique,
    I was actually just posting on a different thread as I got this but not fatal
    2022/02/03 22:27:50.660 11561 11648 Error ACodec [OMX.amlogic.hevc.decoder.awesome] setPortMode on output to DynamicANWBuffer failed w/ err -2147483648

    and after several
    2022/02/03 22:27:51.005 11561 11582 Warn Unity AudioSampleProvider buffer overflow. 2000 sample frames discarded.

    in the end the video is stopped with a stop() using the tag, audiotrack. But thank you for giving more background those might be some leads I could look into
     
  6. robertandriessen

    robertandriessen

    Joined:
    Feb 10, 2020
    Posts:
    33
    to be honest it is not so much related to big files, I get the exact same list of errors with a small h264 mp4 file. But there is less chance for the video to freeze up as it is much shorter.



    0001/01/01 00:00:00.000 -1 -1 Info --------- beginning of main
    2022/02/04 15:36:49.810 5756 5756 Info Zygote seccomp disabled by setenforce 0
    2022/02/04 15:36:49.818 5756 5756 Warn otherviewPlaye Using default instruction set features for ARM CPU variant (cortex-a9) using conservative defaults
    2022/02/04 15:36:49.959 5756 5756 Info Mono JNI_OnLoad called
    2022/02/04 15:36:49.962 5756 5756 Debug OpenGLRenderer Skia GL Pipeline
    2022/02/04 15:36:50.091 5756 5756 Error gralloc ioctl c0044901 failed with code -1: Invalid argument
    2022/02/04 15:36:50.091 5756 5756 Info gralloc ddebug, pair (share_fd=44, user_hnd=1, ion_client=46)
    2022/02/04 15:36:50.125 5756 5756 Info gralloc ddebug, pair (share_fd=49, user_hnd=2, ion_client=46)
    2022/02/04 15:36:50.126 5756 5772 Info Unity MemoryManager: Using 'Dynamic Heap' Allocator.
    2022/02/04 15:36:50.161 5756 5772 Info Unity SystemInfo CPU = ARM64 FP ASIMD AES, Cores = 4, Memory = 3709mb
    2022/02/04 15:36:50.161 5756 5772 Info Unity SystemInfo ARM big.LITTLE configuration: 4 big (mask: 0xf), 0 little (mask: 0x0)
    2022/02/04 15:36:50.162 5756 5772 Info Unity ApplicationInfo com.Designlab.AnotherviewPlayer version 1.0 build 22fd7763-18d4-4002-bc19-473982bf6c8b
    2022/02/04 15:36:50.162 5756 5772 Info Unity Built from '2020.3/release' branch, Version '2020.3.27f1 (e759542391ea)', Build type 'Release', Scripting Backend 'mono', CPU 'armeabi-v7a', Stripping 'Disabled'
    0001/01/01 00:00:00.000 -1 -1 Info --------- beginning of system
    2022/02/04 15:36:50.258 5756 5772 Error SchedPolicy set_timerslack_ns write failed: Operation not permitted
    2022/02/04 15:36:50.282 5756 5772 Info Unity Company Name: Designlab
    2022/02/04 15:36:50.282 5756 5772 Info Unity Product Name: AnotherviewPlayer
    2022/02/04 15:36:50.306 5756 5772 Info ConfigStore android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
    2022/02/04 15:36:50.306 5756 5772 Info ConfigStore android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
    2022/02/04 15:36:50.307 5756 5756 Info gralloc ddebug, pair (share_fd=60, user_hnd=3, ion_client=46)
    2022/02/04 15:36:50.312 5756 5772 Debug mali_winsys EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
    2022/02/04 15:36:50.324 5756 5772 Debug Unity GL_EXT_debug_marker GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth24 GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_EXT_read_format_bgra GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_image_external_essl3 GL_OES_EGL_sync GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_required_internalformat GL_OES_vertex_array_object GL_OES_mapbuffer GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg GL_EXT_texture_type_2_10_10_10_REV GL_OES_fbo_render_mipmap GL_OES_element_index_uint GL_EXT_shadow_samplers GL_OES_texture_compression_astc GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_hdr GL_KHR_texture_compression_astc_sliced_3d GL_EXT_texture_compression_astc_decode_mode GL_EXT_texture_compression_astc_decode_mode_rgb9e5 GL_KHR_debug GL_EXT_occlusion_query_boolean GL_EXT_disjoint_timer_query GL_EXT_blend_minmax GL_EXT_discard_framebuffer
    2022/02/04 15:36:50.324 5756 5772 Debug Unity GL_OES_get_program_binary GL_OES_texture_3D GL_EXT_texture_storage GL_EXT_multisampled_render_to_texture GL_EXT_multisampled_render_to_texture2 GL_OES_surfaceless_context GL_OES_texture_stencil8 GL_EXT_shader_pixel_local_storage GL_ARM_shader_framebuffer_fetch GL_ARM_shader_framebuffer_fetch_depth_stencil GL_ARM_mali_program_binary GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT_texture_sRGB_decode GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_RG8 GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_OES_texture_storage_multisample_2d_array GL_OES_shader_image_atomic GL_EXT_robustness GL_EXT_draw_buffers_indexed GL_OES_draw_buffers_indexed GL_EXT_texture_border_clamp GL_OES_texture_border_clamp GL_EXT_texture_cube_map_array GL_OES_texture_cube_map_array GL_OES_sample_variables GL_OES_sample_shading GL_OES_shader_multisample_interpolation GL_EXT_shader_io_blocks GL_OES_shader_io_blocks GL_EXT_tessellation_shader GL_OES_tessellation_shader GL_EXT_primitive_bounding_box GL_OES_primitive_bounding_
    2022/02/04 15:36:50.324 5756 5772 Debug Unity box GL_EXT_geometry_shader GL_OES_geometry_shader GL_ANDROID_extension_pack_es31a GL_EXT_gpu_shader5 GL_OES_gpu_shader5 GL_EXT_texture_buffer GL_OES_texture_buffer GL_EXT_copy_image GL_OES_copy_image GL_EXT_shader_non_constant_global_initializers GL_EXT_color_buffer_half_float GL_EXT_color_buffer_float GL_EXT_YUV_target GL_OVR_multiview GL_OVR_multiview2 GL_OVR_multiview_multisampled_render_to_texture GL_KHR_robustness GL_KHR_robust_buffer_access_behavior GL_EXT_draw_elements_base_vertex GL_OES_draw_elements_base_vertex GL_EXT_protected_textures GL_EXT_buffer_storage GL_EXT_external_buffer GL_EXT_EGL_image_array
    2022/02/04 15:36:50.359 5756 5809 Info SwappyDisplayManager Starting looper thread
    2022/02/04 15:36:50.416 5756 5812 Warn AudioTrack Use of stream types is deprecated for operations other than volume control
    2022/02/04 15:36:50.416 5756 5812 Warn AudioTrack See the documentation of AudioTrack() for what to use instead with android.media.AudioAttributes to qualify your playback use case
    2022/02/04 15:36:50.622 5756 5772 Info MONO Getting locale
    2022/02/04 15:36:50.623 5756 5772 Info Mono Locale en-US
    2022/02/04 15:36:50.259 5756 5772 Info chatty uid=10064(com.Designlab.AnotherviewPlayer) UnityMain identical 14 lines
    2022/02/04 15:36:50.259 5756 5772 Error SchedPolicy set_timerslack_ns write failed: Operation not permitted
    2022/02/04 15:36:51.576 5756 5772 Verbose MediaRouter Adding route: RouteInfo{ name=Tablet, description=null, status=null, category=RouteCategory{ name=System types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }
    2022/02/04 15:36:51.584 5756 5772 Verbose MediaRouter Audio routes updated: AudioRoutesInfo{ type=HDMI }, a2dp=false
    2022/02/04 15:36:51.584 5756 5772 Verbose MediaRouter Selecting route: RouteInfo{ name=HDMI, description=null, status=null, category=RouteCategory{ name=System types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }
    2022/02/04 15:36:51.681 5756 5772 Info gralloc ddebug, pair (share_fd=76, user_hnd=4, ion_client=46)
    2022/02/04 15:36:51.690 5756 5772 Info gralloc ddebug, pair (share_fd=78, user_hnd=5, ion_client=46)
    2022/02/04 15:36:51.756 5756 5772 Info gralloc ddebug, pair (share_fd=80, user_hnd=6, ion_client=46)
    2022/02/04 15:36:54.079 5756 5780 Info AmAVUtils set profile 8 level:0
    2022/02/04 15:36:54.080 5756 5780 Info AmAVUtils set profile 2 level:0
    2022/02/04 15:36:54.087 5756 5827 Info OMXClient IOmx service obtained
    2022/02/04 15:36:54.094 5756 5827 Info AmAVUtils AmAVUtils::getComponentRole isEncoder :0 mime:video/avc
    2022/02/04 15:36:54.095 5756 5827 Verbose AVUtils AVUtils::getComponentRole
    2022/02/04 15:36:54.097 5756 5827 Info AmAVUtils AmAVUtils::isAudioExtendFormat input = video/avc
    2022/02/04 15:36:54.132 5756 5832 Info OMXClient IOmx service obtained
    2022/02/04 15:36:54.135 5756 5832 Info AmAVUtils AmAVUtils::getComponentRole isEncoder :0 mime:audio/mp4a-latm
    2022/02/04 15:36:54.135 5756 5832 Verbose AVUtils AVUtils::getComponentRole
    2022/02/04 15:36:54.137 5756 5832 Info AmAVUtils AmAVUtils::isAudioExtendFormat input = audio/mp4a-latm
    2022/02/04 15:36:54.333 5756 5780 Info AmAVUtils set profile 8 level:0
    2022/02/04 15:36:54.333 5756 5780 Info AmAVUtils set profile 2 level:0
    2022/02/04 15:36:54.339 5756 5844 Info OMXClient IOmx service obtained
    2022/02/04 15:36:54.344 5756 5843 Debug SurfaceUtils connecting to surface 0xc9d11008, reason connectToSurface
    2022/02/04 15:36:54.344 5756 5843 Info MediaCodec [OMX.amlogic.avc.decoder.awesome] setting surface generation to 5894145
    2022/02/04 15:36:54.344 5756 5843 Debug SurfaceUtils disconnecting from surface 0xc9d11008, reason connectToSurface(reconnect)
    2022/02/04 15:36:54.344 5756 5843 Debug SurfaceUtils connecting to surface 0xc9d11008, reason connectToSurface(reconnect)
    2022/02/04 15:36:54.344 5756 5844 Info AmAVUtils AmAVUtils::getComponentRole isEncoder :0 mime:video/avc
    2022/02/04 15:36:54.344 5756 5844 Verbose AVUtils AVUtils::getComponentRole
    2022/02/04 15:36:54.346 5756 5844 Error ACodec [OMX.amlogic.avc.decoder.awesome] setPortMode on output to DynamicANWBuffer failed w/ err -2147483648
    2022/02/04 15:36:54.349 5756 5844 Info AmAVUtils AmAVUtils::isAudioExtendFormat input = video/avc
    2022/02/04 15:36:54.362 5756 5844 Debug SurfaceUtils disconnecting from surface 0xc9d11008, reason setNativeWindowSizeFormatAndUsage
    2022/02/04 15:36:54.362 5756 5844 Debug SurfaceUtils connecting to surface 0xc9d11008, reason setNativeWindowSizeFormatAndUsage
    2022/02/04 15:36:54.362 5756 5844 Debug SurfaceUtils set up nativeWindow 0xc9d11008 for 1920x1080, color 0x11, rotation 0, usage 0x402b00
    2022/02/04 15:36:54.362 5756 5844 Warn ACodec [OMX.amlogic.avc.decoder.awesome] setting nBufferCountActual to 9 failed: -1010
    2022/02/04 15:36:54.362 5756 5844 Warn ACodec [OMX.amlogic.avc.decoder.awesome] setting nBufferCountActual to 8 failed: -1010
    2022/02/04 15:36:54.363 5756 5844 Warn ACodec [OMX.amlogic.avc.decoder.awesome] setting nBufferCountActual to 7 failed: -1010
    2022/02/04 15:36:54.365 5756 5844 Warn buffer descriptor with invalid usage bits 0x2000
    2022/02/04 15:36:54.369 5756 5844 Info gralloc ddebug, pair (share_fd=94, user_hnd=7, ion_client=46)
    2022/02/04 15:36:54.371 5756 5844 Warn buffer descriptor with invalid usage bits 0x2000
    2022/02/04 15:36:54.372 5756 5844 Info gralloc ddebug, pair (share_fd=96, user_hnd=8, ion_client=46)
    2022/02/04 15:36:54.374 5756 5844 Warn buffer descriptor with invalid usage bits 0x2000
    2022/02/04 15:36:54.376 5756 5844 Info gralloc ddebug, pair (share_fd=98, user_hnd=9, ion_client=46)
    2022/02/04 15:36:54.378 5756 5844 Warn buffer descriptor with invalid usage bits 0x2000
    2022/02/04 15:36:54.380 5756 5844 Info gralloc ddebug, pair (share_fd=100, user_hnd=a, ion_client=46)
    2022/02/04 15:36:54.381 5756 5844 Warn buffer descriptor with invalid usage bits 0x2000
    2022/02/04 15:36:54.383 5756 5844 Info gralloc ddebug, pair (share_fd=102, user_hnd=b, ion_client=46)
    2022/02/04 15:36:54.385 5756 5844 Warn buffer descriptor with invalid usage bits 0x2000
    2022/02/04 15:36:54.387 5756 5844 Info gralloc ddebug, pair (share_fd=105, user_hnd=c, ion_client=46)
    2022/02/04 15:36:54.396 5756 5847 Info OMXClient IOmx service obtained
    2022/02/04 15:36:54.398 5756 5847 Info AmAVUtils AmAVUtils::getComponentRole isEncoder :0 mime:audio/mp4a-latm
    2022/02/04 15:36:54.398 5756 5847 Verbose AVUtils AVUtils::getComponentRole
    2022/02/04 15:36:54.399 5756 5847 Info AmAVUtils AmAVUtils::isAudioExtendFormat input = audio/mp4a-latm
    2022/02/04 15:36:54.610 5756 5777 Warn Unity AudioSampleProvider buffer overflow. 1837 sample frames discarded.
    2022/02/04 15:36:54.631 5756 5777 Info chatty uid=10064(com.Designlab.AnotherviewPlayer) Thread-9 identical 6 lines
    2022/02/04 15:36:54.631 5756 5777 Warn Unity AudioSampleProvider buffer overflow. 1837 sample frames discarded.
    2022/02/04 15:36:54.632 5756 5777 Warn Unity AudioSampleProvider buffer overflow. 1204 sample frames discarded.
    2022/02/04 15:37:06.393 5756 5777 Warn Unity AudioSampleProvider buffer overflow. 64 sample frames discarded.
     
  7. robertandriessen

    robertandriessen

    Joined:
    Feb 10, 2020
    Posts:
    33
    Also tried other versions of Unity, perhaps there is one that is best that I should be using to build a video playback app?
     
  8. robertandriessen

    robertandriessen

    Joined:
    Feb 10, 2020
    Posts:
    33
    tried with an asset that uses exoplayer, this works (under same conditions) but now I noticed the raw image texture it uses is not 4k but something soft similar to hd. I have also seen this happen in the unity videoplayer component. Is this a bug?