expo-av Video error playing video

I am trying to develop a react-native bare application and expo-av Video. I am trying to play multiple videos in FlatList. I tried running the application on different phones. On one phone the videos worked fine as expected. On another phone, it only displayed a blank screen and displayed the error

com.google.android.exoplayer2.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.qcom.video.decoder.avc, Format(2, null, null, video/avc, null, -1, null, [480, 270, -1.0], [-1, -1])

On another phone, it initially worked properly. But when I reloaded the app, the same error popped up. Even though I tried uninstalling the app and installing it again it wouldn’t work.

Note: All the three phones that I had used are android phones. Also, I have looked through the forum and I did not find any solid solution

I’m also working with expo-av, I can suggest you 2 things:

  1. There are more than one video components running at once and Android suffers with it, so to avoid it only render one video component at a time. If there is more than one video on a screen, just render a thumbnail image. And set removeClippedSubviews on your flatlist.
  2. Check the video format. The one that best worked for me was mp4 videos encoded with the following config -Discord video medium preset in handbrake- :
    H.264 (x264), 30 FPS PFR
    AAC (CoreAudio), Stereo
    Comb Detect, Decomb
    1280x720 Storage, 1280x720 Display
1 Like

Thanks for your insights! I’ll try these and see if there is an improvement.