Reputation: 323
When expo-player is enabled, i am getting this error
[
"on video error",
{
"error": {
"errorException": "com.google.android.exoplayer2.ExoPlaybackException: com.google.android.exoplayer2.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.Exynos.avc.dec, Format(2, null, null, video/avc, null, -1, null, [4096, 2130, 25.000002], [-1, -1])",
"errorString": "Unable to instantiate decoder OMX.Exynos.avc.dec"
}
}
]
Is there is any way to get rid of this error and play the videos in samsung devices. Some of the videos are there which are not getting played in samsung devices. The same videos get played in mi devices. I have tried the same video in many samsung devices. In all of that i am getting the same error. Any help would be appreciated.
I have also tried it on the android media player. In that only the audio is getting played no video is there.
Upvotes: 1
Views: 1823
Reputation: 1
I had similar issue, only when a video is played and I wanted to start another one (or navigated to a new page where a video was autoplayed). The device was unable to reuse the codec.
In the logcat I found that:
2022-03-10 10:05:31.636 9471-19121/* E/ACodec: [OMX.qcom.video.decoder.avc] configureCodec returning error -12
2022-03-10 10:05:31.636 9471-19121/* E/ACodec: signalError(omxError 0x80001001, internalError -12)
2022-03-10 10:05:31.636 9471-19120/* E/MediaCodec: Codec reported err 0xfffffff4, actionCode 0, while in state 3
2022-03-10 10:05:31.642 9471-19120/* E/MediaCodec: Codec reported err 0xffffec77, actionCode 0, while in state 0
2022-03-10 10:05:31.642 9471-12750/* E/cr_MediaCodecBridge: Cannot configure the video codec
android.media.MediaCodec$CodecException: Error 0xfffffff4
at android.media.MediaCodec.native_configure(Native Method)
at android.media.MediaCodec.configure(MediaCodec.java:2127)
at android.media.MediaCodec.configure(MediaCodec.java:2043)
at org.chromium.media.MediaCodecBridge.a(chromium-TrichromeWebViewGoogle.aab-stable-475810133:1)
at org.chromium.media.MediaCodecBridgeBuilder.createVideoDecoder(chromium-TrichromeWebViewGoogle.aab-stable-475810133:6)
Also, the chrome media logs showed that:
FFmpegDemuxer: created video stream, config codec: h264, profile: h264 main, level: not available, alpha_mode: is_opaque, coded size: [1920,1080], visible rect: [0,0,1920,1080], natural size: [1920,1080], has extra data: true, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}
FFmpegDemuxer: created audio stream, config codec: aac, profile: unknown, bytes_per_channel: 4, channel_layout: STEREO, channels: 2, samples_per_second: 48000, sample_format: Float 32-bit planar, bytes_per_frame: 8, seek_preroll: 0us, codec_delay: 0, has extra data: true, encryption scheme: Unencrypted, discard decoder delay: true, target_output_channel_layout: NONE, has aac extra data: true
Selected FFmpegAudioDecoder for audio decoding, config: codec: aac, profile: unknown, bytes_per_channel: 4, channel_layout: STEREO, channels: 2, samples_per_second: 48000, sample_format: Float 32-bit planar, bytes_per_frame: 8, seek_preroll: 0us, codec_delay: 0, has extra data: true, encryption scheme: Unencrypted, discard decoder delay: true, target_output_channel_layout: STEREO, has aac extra data: true
Selected MediaCodecVideoDecoder for video decoding, config: codec: h264, profile: h264 main, level: not available, alpha_mode: is_opaque, coded size: [1920,1080], visible rect: [0,0,1920,1080], natural size: [1920,1080], has extra data: true, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}
Entering Terminal State: Unable to allocate codec
video decoder fallback after initial decode error.
Failed to initialize VpxVideoDecoder
Failed to initialize Dav1dVideoDecoder
video decoder reinitialization failed
The resolution was to unmount the video on cleanup so that the next video playing could reuse (actually use as a new) the codec.
My code there:
useEffect(() => {
return () => {
console.log('unmount video')
videoRef.current?.pause()
videoRef.current?.removeAttribute('src')
videoRef.current?.load()
console.log('video unmounted')
}
}, [videoRef])
Upvotes: 0