视频加载错误时的错误代码
{"error": {"errorException": "com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.640034, -1, null, [2160, 3840, 24.000002], [-1, -1]), format_supported=NO_EXCEEDS_CAPABILITIES", "errorString": "ExoPlaybackException type : 1"}}
目前我正在使用这个版本并在真正的 Android 设备上构建react-native: 0.64
react-native-video: ^5.2.0-alpha1
这是 h.264 视频示例:https://lifebeligum.s3.ap-southeast-1.amazonaws.com/documents/2021-10-04/ef07eb88-1e53-4800-b7cb-64e908a264c3.mp4
有人对此有任何想法吗?
最佳答案
链接的视频使用 H.264 High profile - 这不是 Android 支持的标准格式之一,尽管某些设备可能支持它。
目前 Baseline 和 Main profile 被列为标准支持。您可以在此处查看列表:
您可以使用 ffprobe 之类的工具检查编码配置文件:
ffprobe version N-95216-ge6625ca41f-tessus https://evermeet.cx/ffmpeg/ Copyright (c) 2007-2019 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.8)
configuration: ......
libavutil 56. 35.100 / 56. 35.100
libavcodec 58. 59.101 / 58. 59.101
libavformat 58. 33.100 / 58. 33.100
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 61.100 / 7. 61.100
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Desktop/ef07eb88-1e53-4800-b7cb-64e908a264c3.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41isomavc1
creation_time : 2020-07-07T20:03:53.000000Z
Duration: 00:00:16.50, start: 0.000000, bitrate: 13565 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 2160x3840, 13562 kb/s, 24 fps, 24 tbr, 24 tbn, 48 tbc (default)
Metadata:
creation_time : 2020-07-07T20:03:53.000000Z
handler_name : L-SMASH Video Handler
encoder : AVC Coding
您可以使用 Main 或 Baseline 重新编码您的视频并测试以确认或测试您知道符合推荐的视频
关于android - 无法使用 Android Exoplayer react-native-video 在 Android 上播放视频 H.264,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69543538/