Comments (3)
Hi @rach21nag,
Here is the file where i modify the source code of webrtc for your reference
- Go to webrtc.github.io (Android development is only supported on Linux.)
- Pull source code
- modify these files below (Enable hardware video ecoder for all chips and software openh264 media codec)
diff --git a/sdk/android/api/org/webrtc/HardwareVideoEncoderFactory.java b/sdk/android/api/org/webrtc/HardwareVideoEncoderFactory.java
index 9cd4aa2d37..9903300a36 100644
--- a/sdk/android/api/org/webrtc/HardwareVideoEncoderFactory.java
+++ b/sdk/android/api/org/webrtc/HardwareVideoEncoderFactory.java
@@ -232,11 +232,15 @@ public class HardwareVideoEncoderFactory implements VideoEncoderFactory {
return false;
}
String name = info.getName();
+
+ return true;
+ /*
// QCOM H264 encoder is supported in KITKAT or later.
return (name.startsWith(QCOM_PREFIX) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
// Exynos H264 encoder is supported in LOLLIPOP or later.
|| (name.startsWith(EXYNOS_PREFIX)
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP);
+ */
}
private boolean isMediaCodecAllowed(MediaCodecInfo info) {
diff --git a/sdk/android/src/java/org/webrtc/MediaCodecUtils.java b/sdk/android/src/java/org/webrtc/MediaCodecUtils.java
index 5d83014dc3..bb7bed4e29 100644
--- a/sdk/android/src/java/org/webrtc/MediaCodecUtils.java
+++ b/sdk/android/src/java/org/webrtc/MediaCodecUtils.java
@@ -30,7 +30,7 @@ class MediaCodecUtils {
static final String NVIDIA_PREFIX = "OMX.Nvidia.";
static final String QCOM_PREFIX = "OMX.qcom.";
static final String[] SOFTWARE_IMPLEMENTATION_PREFIXES = {
- "OMX.google.", "OMX.SEC.", "c2.android"};
+ "OMX.SEC.", "c2.android"};
// NV12 color format supported by QCOM codec, but not declared in MediaCodec -
// see /hardware/qcom/media/mm-core/inc/OMX_QCOMExtns.h
- Build .aar for Android
tools_webrtc/android/build_aar.py --arch "armeabi-v7a" "arm64-v8a" --extra-gn-args='rtc_use_h264=true ffmpeg_branding = "Chrome" proprietary_codecs=true'
- π
from amazon-kinesis-video-streams-webrtc-sdk-android.
Hi @rach21nag,
I have the same problem as you and I finally solved this problem
Master: Linux embeded system with mediatek chip
Viewer: Multiple Android Phones
The problem is that our embeded system only supports H264 video codec format but not VP8/VP9 video codec format
Most Android devices only support VP8/VP9 video codec on WebRTC
Currently WebRTC hardware encoding only supports devices that using QCOM and EXYNOS chips
You can find out in the link below
Why WebRTC only support H264 in Chrome but not in native application with some devices
You can check the SDP packet to find the supported video codec
[For example]
(Embedded System -> Android Phone SDP)
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 127
a=rtpmap:0 H264
...
(Android Phone -> Embedded System SDP)
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 127
a=rtpmap:96 VP8/90000
The supported video codecs on both sides do not match
And I can't change the embedded system chip to support VP8/VP9 codec
So I can only solve this problem from Android's WebRTC SDK
I modified and recompiled the source code of WebRTC so that it can also support H264 on different chips (AMD, Mediatek...)
- Enable the hardware encoder for all chips
- Enable the software encoder for all chips
And now it works perfectly on all my android devices
BTW
I'm not a native english speaker, hope you can understand what i mean
BR,
Nick
from amazon-kinesis-video-streams-webrtc-sdk-android.
Thank you for your reply! I will try this out :)
from amazon-kinesis-video-streams-webrtc-sdk-android.
Related Issues (20)
- Connection Failure with WebRTC Peer HOT 1
- android error
- Failed to set remote video description send parameters HOT 1
- Create client failed with Failed to get credentials from Cognito Identiy HOT 2
- Failed SSL handshake HOT 1
- LTE to WIFI connection not working HOT 3
- App initial page HOT 1
- Kinesis Data Analytics with WebRTC HOT 1
- Get more detailed information of logged in user HOT 1
- Could you please update Google's webrtc library to 1.0.32006? HOT 3
- ι³θ§ι’δΈθ½ε¨ιΈΏθη³»η»ζζΊζεδ½Ώη¨
- the Cognito authentication for this sdk HOT 2
- Getting error in activating master or viewer mode HOT 2
- Audio Sample Rate update HOT 1
- How set the opus encoding for input audio?
- android api or sample code for aws security token service ? HOT 3
- Any tips on how to resolve missing or frozen video stream HOT 2
- SSL connection error in android happening randomly as it unable to resolve Host when trying to get describe channel
- Issue in switching between channels
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amazon-kinesis-video-streams-webrtc-sdk-android.