Closed zoriya closed 2 months ago
Thank you for your bug report. We will review it and get back to you if we need more information.
There is a newer version of the library available. You are using version 6.4.3, while the latest stable version is 6.4.5. Please update to the latest version and check if the issue still exists.
Note: If the issue still exists, please update the issue report with the latest information.
Hey, Thanks for report - I will try look into it
you should try to reproduce the debug enable, here your decoder cannot play the file (exception is expected), but the package should not allow to select this version of the video
notice that we already set following flags in java code:
.setExceedAudioConstraintsIfNecessary(true)
.setExceedRendererCapabilitiesIfNecessary(true)
.setExceedVideoConstraintsIfNecessary(true)
You may try to disable them, it is maybe the issue
Here are the debug logs:
Exoplayer initially report that it can play the file and then fail.
To be honest I don't know why this file can't be played, VLC can play it just fine. Is it because cpu decoding is not used as a fallback?
I confirm what you are saying. initially the device says the format is supported, but afterward it fails to decode. I suspect something linked to exoplayer ...
08-22 17:33:03.828 23950 29747 E ExoPlayerImplInternal: Playback error 08-22 17:33:03.828 23950 29747 E ExoPlayerImplInternal: androidx.media3.exoplayer.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(0, null, null, video/avc, avc1.6E0033, 8000000, null, [1920, 1080, -1.0, ColorInfo(Unset color space, Unset color range, Unset color transfer, false, 10bit Luma, 10bit Chroma)], [-1, -1]), format_supported=NO_EXCEEDS_CAPABILITIES 08-22 17:33:03.828 23950 29747 E ExoPlayerImplInternal: at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:623) 08-22 17:33:03.828 23950 29747 E ExoPlayerImplInternal: at android.os.Handler.dispatchMessage(Handler.java:103) 08-22 17:33:03.828 23950 29747 E ExoPlayerImplInternal: at android.os.Looper.loopOnce(Looper.java:232) 08-22 17:33:03.828 23950 29747 E ExoPlayerImplInternal: at android.os.Looper.loop(Looper.java:317) 08-22 17:33:03.828 23950 29747 E ExoPlayerImplInternal: at android.os.HandlerThread.run(HandlerThread.java:85) 08-22 17:33:03.828 23950 29747 E ExoPlayerImplInternal: Caused by: androidx.media3.exoplayer.video.MediaCodecVideoDecoderException: Decoder failed: c2.exynos.h264.decoder 08-22 17:33:03.828 23950 29747 E ExoPlayerImplInternal: at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.createDecoderException(MediaCodecVideoRenderer.java:1915) 08-22 17:33:03.828 23950 29747 E ExoPlayerImplInternal: at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:848) 08-22 17:33:03.828 23950 29747 E ExoPlayerImplInternal: at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:940) 08-22 17:33:03.828 23950 29747 E ExoPlayerImplInternal: at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1112) 08-22 17:33:03.828 23950 29747 E ExoPlayerImplInternal: at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:544) 08-22 17:33:03.828 23950 29747 E ExoPlayerImplInternal: ... 4 more 08-22 17:33:03.828 23950 29747 E ExoPlayerImplInternal: Caused by: android.media.MediaCodec$CodecException: Error 0xe
An interesting complementary test to do is to try playing this content directly in exoplayer sample. I will confirm if this is a react native video issue or an exoplayer issue ... As you use a pixel device, I assume this is not a device issue.
Do you want me to send you the video file (if so where)? If you need to I can try with the exoplayer's demo but it might take me a bit of time to setup an android dev environment
Testing with exoplayer demo would allow to identify if the issue is really a react native video issue... The sample can be found in media3 github reporsitory. You just need to clone it, build the demo and patch media3/demos/main/src/main/assets/media.exolist.json to put your sample url. and the repo : https://github.com/androidx/media (you just need android studio to build it)
I do get the same error with the main demo. Sorry for the noise with this issue then.
It seems exoplayer doesn't support software decoding fallback :c
I think the ffmpeg
extension can be used to enable more codecs support (currently only audio but video will become available via https://github.com/androidx/media/pull/1591). I have no idea how to enable those extensions or if making them available in react-native-video is possible tho.
Send me media to test.
@zoriya I think you are right, To build ffmpeg you should start to build from source (see https://thewidlarzgroup.github.io/react-native-video/other/debug#debug-media3-build-from-media3-source) And after that you need to enable ffmpeg, but I never do it yet... (and be careful to ffmpeg license)
And you you want to document ffmpeg integration, the community will great you ! :)
I opened an issue on media3's repo for hls auto switch: https://github.com/androidx/media/issues/1656.
You can find logs of the demo app there that were taken with this media https://drive.google.com/file/d/1boaFwlO5kTnpK6Wzg2kYaTHwvryr-Rl2/view?usp=drive_link
I'm not convident about compiling media3 from scratch but this will be something I need so I'll try when media3 receive video decoding via ffmpeg.
I also want to have native ass subtitles rendering via libass and I think I'd have to write an extension for media3 for that so I'll have to learn how extensions work at one point.
PS: I'll close the issue, I don't think there's much to do in rnv side for now. Thanks for the help!
@zoriya thank you for the update!
I have test it. use ffmpeg can play it.
@FongMi if you can write a doc on how to build with ffmpeg, it would be wonderful ! (Maybe just after build from source section?!)
whaat? how did you do? I tested with the demo app using the withDecoderExtension
variant, I was under the impression it used ffmpeg. Did I miss something?
Thank you so much for checking this!
I suggest you use nextlib because it is simpler. https://github.com/anilbeesetti/nextlib
nextlib looks like a separate implementation of ffmpeg, if my understanding is correct, https://github.com/androidx/media/pull/1591 should bring feature parity to mainstream's exoplayer, right?
if nextlib has other advantages, it might be nice to add an option to use it on rnv (it can't be the default due to license issues). Otherwise, I think I'll wait for the previous PR to get merged and try to enable ffmpeg directly here.
I don't think media3 will merge this pr that quickly, and it may not even be merged at all. I suggest you use mpv because you want to use libass.
using libmpv or libvlc seems way harder, especially with react-native. it would mean adding a new backend, which is a huge maintenance burden, unfortunately.
Version
6.4.3
What platforms are you having the problem on?
Android
System Version
Android 14
On what device are you experiencing the issue?
Real device
Architecture
Old architecture
What happened?
I have a hls file containing multi-variant videos. One variant cannot be played on the device, but the others can. When exoplayers tries to load the incompatible variant, I get this error:
After getting this error, playback is aborted. I would expect exoplayer to fallback to another variant (since it can play the others). I can confirm that the others are playable, since the video play without issue if I remove the incompatible variant from the master.m3u8 file.
This is not the first time this issue was mentioned: #1598. The issue was closed because a workaround was found for this particular use case, but I don't see any obvious workaround there.
Reproduction Link
No response
Reproduction
I can either send a video file or a complete m3u8 zip, but since this is copyrighted media I probably should send it privately.