haiyangwu / mediasoup-client-android

mediasoup android client side library https://mediasoup.org
MIT License
179 stars 107 forks source link

Invalid Codec #24

Closed zeeshanrasool91 closed 4 years ago

zeeshanrasool91 commented 4 years ago

While running on emulator it is showing me invalid codec.mimetype error

ahmedmolawale commented 4 years ago

Hey @zeeshanrasool91 Did you figure out a solution for this?

cc. @haiyangwu

zeeshanrasool91 commented 4 years ago

Hey @zeeshanrasool91

Did you figure out a solution for this?

cc. @haiyangwu

Nope i think they don’t have support for x86 cpu architecture i have to run it on a physical device

ahmedmolawale commented 4 years ago

Hey @zeeshanrasool91 Did you figure out a solution for this? cc. @haiyangwu

Nope i think they don’t have support for x86 cpu architecture i have to run it on a physical device

Oh, bad. This actually happens on some physical devices.

zeeshanrasool91 commented 4 years ago

can you check the CPU architecture of those devices

ahmedmolawale commented 4 years ago

You’re correct. Their CPU architecture is x86.

ahmedmolawale commented 4 years ago

@haiyangwu is there any way around this ?

zeeshanrasool91 commented 4 years ago

I am working on that once I found a solution I will share it with you, I have also found some repositories, https://github.com/ethand91/mediasoup-android-sample like this. he added x86 support in his code.

haiyangwu commented 4 years ago
# Enable this to build OpenH264 encoder/FFmpeg decoder. This is supported on
# all platforms except Android and iOS. Because FFmpeg can be built
# with/without H.264 support, |ffmpeg_branding| has to separately be set to a
# value that includes H.264, for example "Chrome". If FFmpeg is built without
# H.264, compilation succeeds but |H264DecoderImpl| fails to initialize. See
# also: |rtc_initialize_ffmpeg|.
# CHECK THE OPENH264, FFMPEG AND H.264 LICENSES/PATENTS BEFORE BUILDING.
# http://www.openh264.org, https://www.ffmpeg.org/
rtc_use_h264 = proprietary_codecs && !is_android && !is_ios

https://chromium.googlesource.com/external/webrtc/+/fb11424551dae924869ae54059cb1612836cb6f7/webrtc/build/webrtc.gni#96

@zeeshanrasool91 @ahmedmolawale Generally, webrtc only support vp8 andvp9 software codec, hardware codec is dependent on the device.

What kind of codec did you choose? If h264, you can invoke HardwareVideoEncoderFactory#isHardwareSupportedInCurrentSdkH264 and HardwareVideoDecoderFactory#isH264HighProfileSupported to check the device's capability.

If you want to support h264 software codec, one solution I know was to modify the BUILD.gn related to ffmpeg in webrtc.

iQuick commented 4 years ago

Has anyone solved the problem of invalid codec.mimetype under v7a version?

haiyangwu commented 4 years ago

Dup https://github.com/haiyangwu/mediasoup-client-android/issues/24 and fix commits already pushed and it works well.

chenjim commented 2 years ago

I solved with "h264 software codec, modify the BUILD.gn related to ffmpeg in webrtc," For detailed modification, please refer to
https://blog.csdn.net/CSqingchen/article/details/120199702