Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AV1 returned as supported, but it actually not #14

Open
dkrivoruchko opened this issue Apr 20, 2023 · 0 comments
Open

AV1 returned as supported, but it actually not #14

dkrivoruchko opened this issue Apr 20, 2023 · 0 comments

Comments

@dkrivoruchko
Copy link

Devices:

  • Google Pixel 4a (5G) with Android 13
  • HUAWEI INE-LX1 (HUAWEI P smart+) Android version: 9

Version : com.github.webrtc-sdk:android:104.5112.08

Checking list of system supported video encoders:

MediaCodecList(MediaCodecList.ALL_CODECS).codecInfos.filter { it.isEncoder && it.supportedTypes[0].startsWith("video") }
  .forEach { Log.e(">>>", "Name: ${it.name} => mimeType: ${it.supportedTypes.joinToString()}") }

Result:

Name: OMX.hisi.video.encoder.avc => mimeType: video/avc
Name: OMX.google.h264.encoder => mimeType: video/avc
Name: OMX.google.h263.encoder => mimeType: video/3gpp
Name: OMX.hisi.video.encoder.hevc => mimeType: video/hevc
Name: OMX.google.mpeg4.encoder => mimeType: video/mp4v-es
Name: OMX.google.vp8.encoder => mimeType: video/x-vnd.on2.vp8
Name: OMX.google.vp9.encoder => mimeType: video/x-vnd.on2.vp9

Now checking encoders with PeerConnectionFactory:

val initializationOptions = PeerConnectionFactory.InitializationOptions.builder(context).createInitializationOptions()
PeerConnectionFactory.initialize(initializationOptions)

 val peerConnectionFactory = PeerConnectionFactory.builder()
            .setOptions(PeerConnectionFactory.Options())
            .setVideoDecoderFactory(DefaultVideoDecoderFactory(rootEglBase.eglBaseContext))
            .setVideoEncoderFactory(DefaultVideoEncoderFactory(rootEglBase.eglBaseContext, true, true))
            .createPeerConnectionFactory()

peerConnectionFactory.getRtpSenderCapabilities(MediaStreamTrack.MediaType.MEDIA_TYPE_VIDEO).codecs
   .forEach { Log.e(">>>", "Name: ${it.name} => mimeType: ${it.mimeType}") }

Result:

Name: VP8 => mimeType: video/VP8
Name: rtx => mimeType: video/rtx
Name: VP9 => mimeType: video/VP9
Name: AV1 => mimeType: video/AV1
Name: red => mimeType: video/red
Name: ulpfec => mimeType: video/ulpfec

Problem: Why AV1 is returned as supported?

If we try to use AV1 app obviously crash with:

java.lang.UnsatisfiedLinkError: No implementation found for long org.webrtc.LibaomAv1Encoder.nativeCreateEncoder() (tried Java_org_webrtc_LibaomAv1Encoder_nativeCreateEncoder and Java_org_webrtc_LibaomAv1Encoder_nativeCreateEncoder__)
 at org.webrtc.LibaomAv1Encoder.nativeCreateEncoder(Native Method)
 at org.webrtc.LibaomAv1Encoder.createNativeVideoEncoder(LibaomAv1Encoder.java:16)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant