Closed adamstyrc closed 4 years ago
From this log there is a problem with parameters passed to MediaCodec. Some mandatory fields are probably missing for Video decoding. Here is the list of all necessary parameters (those that don't have optional next to, are mandatory) https://developer.android.com/reference/android/media/MediaFormat. I've checked in the AOSP code, these params are the only mandatory in a place where your app threw exception. Also, while inspecting the .mp4 you posted, it is encoded in apple specific codecs, which are unlikely to play by default on Android devices. I guess most manufacturers have that support like Samsung, but my guess that since Pixel3 is vanila Android device, it doesn't have that support.
The video was encoded with Flutter FFmpeg on that Pixel 3, to my dismay 😄
@veljkomih So do I understand you right, that adding some decoding mandatory fields would seal the deal? Or no matter what I do, trying to launch it with Pixel 3 Android native codecs will result with a failure?
I think it's likely that this video is too high resolution for the decoder (720 * 1280):
com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/mp4v-es, null, -1, null, [720, 1280, 29.130436], [-1, -1]), format_supported=NO_EXCEEDS_CAPABILITIES
On the device I'm testing on this software MPEG 4 decoder only advertises support up to 352 * 288 pixels. Is it an option to change the video format to something more widely supported like H.264/AVC?
Side note: encoding portrait videos like this as landscape videos with rotation metadata may also help compatibility.
Yes, I think by adding those fields will definitely fix your exception. Will it play though, I'm not sure 100% sure.
Ok, I will play with the resolution :)
Unfortunately using H.264 - which ffmpeg has inside when using another package - requires a GPL license which is not viable for me at the moment or pay for every video which is even worse :(
Thanks! :)
Unfortunately using H.264 - which ffmpeg has inside when using another package - requires a GPL license which is not viable for me at the moment or pay for every video which is even worse :(
Can you use Android platform APIs to encode the video (MediaCodec
), instead of bundling a software encoder?
Alternatively, encoding to a format like VP9 may be an option if you're happy with software video decoding on devices that don't have a hardware decoder for it.
[REQUIRED] Issue description
On Pixel 3 and probably 3a (Android 10) some mp4 videos cannot be played because of failed decoder initialization. On other android os or devices, they work. They also work on iOS and desktop. Link to video: https://cdn.vidcamera.io/videos/78/22/55/88/5f5b902f7fc0061dc0b5e4e6/78225588-e2ca-4fa7-9a39-aa5b0a1bd09c.mp4
[REQUIRED] Reproduction steps
Use demo ExoPlayer version e.g. 2.12.0 or any older and try to play a video https://cdn.vidcamera.io/videos/78/22/55/88/5f5b902f7fc0061dc0b5e4e6/78225588-e2ca-4fa7-9a39-aa5b0a1bd09c.mp4
[REQUIRED] Link to test content
https://cdn.vidcamera.io/videos/78/22/55/88/5f5b902f7fc0061dc0b5e4e6/78225588-e2ca-4fa7-9a39-aa5b0a1bd09c.mp4
[REQUIRED] A full bug report captured from the device
[REQUIRED] Version of ExoPlayer being used
2.12.0
[REQUIRED] Device(s) and version(s) of Android being used
Google Pixel 3 - Android 10 QQ3A.200805.001