WebRtc/H264 in WebView

2,482 views
Skip to first unread message

Tim McClure

unread,
Aug 29, 2017, 2:54:06 PM8/29/17
to android-webview-dev
WebView Version: 60.03112.107

Trying to run a webpage that displays webrtc/h264 video  in WebView.  I get the following error:

chromium: [ERROR:internaldecoderfactory.cc(71)] Unable to create an H.264 decoder fallback. Decoding of this stream will be broken.

At this point a NullVideoDecoder is creating and obviously nothing is displayed.

I am able play the video in the chrome browser on the device so I know the hardware is capable of rendering webrtc/h264 video.  

Can someone tell me how I enable webrtc/h264 in webview?

Thanks,
Tim McClure

Gene Ruebsamen

unread,
Oct 9, 2017, 4:48:40 PM10/9/17
to android-webview-dev
Exact same issue here, I can reproduce this problem 100% of the time if connecting via Android WebView to iOS (11.0.2) Safari 11 browser.

Using latest Android Chromium Webview 61.0.3163.98 I get the failure:

However, switching to Android Chrome and connecting WebRTC to iOS 11.0.2 Safari 11, and the video decoding works just fine on the android side.

Any suggestions??

Gene Ruebsamen

unread,
Oct 9, 2017, 5:06:31 PM10/9/17
to android-webview-dev, ruebsam...@gmail.com
I'd add that I know the old Chromium based webview did not support h264 because it was not compiled with ffmpeg support.

My understanding is the new Webview is based off of Chrome, so it should have h264 built in?  Is this not true?  If there is no h264 in Android webview, is there an easy way to enable it?

Torne (Richard Coles)

unread,
Oct 9, 2017, 5:16:35 PM10/9/17
to Gene Ruebsamen, android-webview-dev
There is no "old chromium based webview" - webview still uses the same codebase it has since switching to the chromium codebase in Android 4.4. The WebView implementation that Android 7.0+ devices can load from the Chrome APK is exactly the same code as the standalone version used on other devices with exactly the same features (it's just a smaller total download size, because you don't have to download all the overlapping code twice).

The WebView we update via the Play Store should have h264 support as far as I know; it's always been built with the same proprietary codec settings as Chrome.

--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview...@chromium.org.
To post to this group, send email to android-w...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/android-webview-dev/dc4cc2f0-128a-4ea1-94ff-5c052c22ac53%40chromium.org.

Gene Ruebsamen

unread,
Oct 9, 2017, 5:27:19 PM10/9/17
to android-webview-dev, ruebsam...@gmail.com
Thanks for the clarification regarding the WebView.  By the WebView on the Play Store, I assume you mean the "Android System WebView" by Google LLC?  

I currently have that installed on my device; however, the WebView throws:

chromium: [ERROR:internaldecoderfactory.cc(71)] Unable to create an H.264 decoder fallback. Decoding of this stream will be broken.

While the Android Chrome browser from the play store works fine.  Are you certain that the WebView on the Play Store supports h264?  Is there anything special that needs to be done to enable h264 programatically?

Thanks!

Torne (Richard Coles)

unread,
Oct 9, 2017, 6:18:12 PM10/9/17
to Gene Ruebsamen, android-webview-dev
On Mon, 9 Oct 2017 at 17:27 Gene Ruebsamen <ruebsam...@gmail.com> wrote:
Thanks for the clarification regarding the WebView.  By the WebView on the Play Store, I assume you mean the "Android System WebView" by Google LLC?  

Yes, or Chrome on newer OS versions (which has all the same webview code in it).
 

I currently have that installed on my device; however, the WebView throws:

chromium: [ERROR:internaldecoderfactory.cc(71)] Unable to create an H.264 decoder fallback. Decoding of this stream will be broken.

Well, we build it with the same build flags controlling ffmpeg as Chrome. (it's literally built during the same compilation process, and the ffmpeg/media/etc sources are only compiled once, so there is no way for them to be different). 
 
While the Android Chrome browser from the play store works fine.  Are you certain that the WebView on the Play Store supports h264? 

No, there might be some arcane reason why it doesn't that I don't know about, but it seems fairly unlikely - as I said, it's literally using the same compiled binary files as Chrome for all the common parts like ffmpeg.
 
Is there anything special that needs to be done to enable h264 programatically?

No, we don't offer any control over that kind of thing.
 
Thanks!


On Monday, October 9, 2017 at 2:16:35 PM UTC-7, Richard Coles wrote:
There is no "old chromium based webview" - webview still uses the same codebase it has since switching to the chromium codebase in Android 4.4. The WebView implementation that Android 7.0+ devices can load from the Chrome APK is exactly the same code as the standalone version used on other devices with exactly the same features (it's just a smaller total download size, because you don't have to download all the overlapping code twice).

The WebView we update via the Play Store should have h264 support as far as I know; it's always been built with the same proprietary codec settings as Chrome.

On Mon, 9 Oct 2017 at 17:06 Gene Ruebsamen <ruebsam...@gmail.com> wrote:
I'd add that I know the old Chromium based webview did not support h264 because it was not compiled with ffmpeg support.

My understanding is the new Webview is based off of Chrome, so it should have h264 built in?  Is this not true?  If there is no h264 in Android webview, is there an easy way to enable it?


On Monday, October 9, 2017 at 1:48:40 PM UTC-7, Gene Ruebsamen wrote:
Exact same issue here, I can reproduce this problem 100% of the time if connecting via Android WebView to iOS (11.0.2) Safari 11 browser.

Using latest Android Chromium Webview 61.0.3163.98 I get the failure:

However, switching to Android Chrome and connecting WebRTC to iOS 11.0.2 Safari 11, and the video decoding works just fine on the android side.

Any suggestions??

On Tuesday, August 29, 2017 at 11:54:06 AM UTC-7, Tim McClure wrote:
WebView Version: 60.03112.107

Trying to run a webpage that displays webrtc/h264 video  in WebView.  I get the following error:

chromium: [ERROR:internaldecoderfactory.cc(71)] Unable to create an H.264 decoder fallback. Decoding of this stream will be broken.

At this point a NullVideoDecoder is creating and obviously nothing is displayed.

I am able play the video in the chrome browser on the device so I know the hardware is capable of rendering webrtc/h264 video.  

Can someone tell me how I enable webrtc/h264 in webview?

Thanks,
Tim McClure

--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview...@chromium.org.
To post to this group, send email to android-w...@chromium.org.

Torne (Richard Coles)

unread,
Oct 9, 2017, 6:19:18 PM10/9/17
to Gene Ruebsamen, android-webview-dev
Er, sorry: what I meant to say is, I'm guessing this is something webrtc-specific and not a general issue with codecs. I'm pretty sure WebView plays h264 video just fine.

Torne (Richard Coles)

unread,
Oct 9, 2017, 6:23:53 PM10/9/17
to Gene Ruebsamen, android-webview-dev
Yep, just tested and h264 video playback definitely works.

Gene Ruebsamen

unread,
Oct 10, 2017, 12:42:51 AM10/10/17
to android-webview-dev, ruebsam...@gmail.com
You are right. I too tested an autoplay h264 video on my WebView and it works.  
But using the same WebView to make a WebRTC connection to an iOS 11 Safari (webRTC on iOS 11 uses h264) device results in no audio/video on the Android side (just a big play button), but the iOS side can see the video stream.  On the Android side, I get this error:

E/chromium: [ERROR:internaldecoderfactory.cc(71)] Unable to create an H.264 decoder fallback. Decoding of this stream will be broken.
...
E/chromium: [ERROR:internaldecoderfactory.cc(30)] Can't initialize NullVideoDecoder.
E/chromium: [ERROR:internaldecoderfactory.cc(45)] Can't register decode complete callback on NullVideoDecoder.
E/chromium: [ERROR:internaldecoderfactory.cc(39)] The NullVideoDecoder doesn't support decoding.

Oddly enough, completing the same webRTC call using the Android Chrome Browser to the same iOS 11 Safari device works, as video on the Android and iOS side is displayed.

Torne (Richard Coles)

unread,
Oct 10, 2017, 8:38:13 AM10/10/17
to Gene Ruebsamen, android-webview-dev

Ok, so something might be configured wrong in webrtc? I don't really know much about that unfortunately, but you should probably file a webview bug with this info.


--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview...@chromium.org.
To post to this group, send email to android-w...@chromium.org.

Didier Bedouillat

unread,
Jan 11, 2018, 11:40:09 AM1/11/18
to android-webview-dev
Hello

I'm facing the same problem while trying to communicate from Android Webview (Chrome 65) to IOS 11 : the Android user cannot see the callee while everything is ok for the IOS user

I can see in logs the following error :  [ERROR:webrtcvideoengine.cc(133)] Can't initialize NullVideoDecoder

I'm using Chrome 65, canary version (since bug 793038 is blocking any H264 WebRTC communication in Chrome 62), after having enabled Chrome Canary as the Webview in Android Developper Options. Hardware acceleration is activated  on the webview.

Test done on a Pixel (Android 7.1.2), using AppRTC and also reproduced on a Samsung S8 (Android 7.0)

If trying to do the same test directly on Chrome Canary (in the browser, not in a webview), it's working fine : both users can see each other

=> is there any reason why the Webview behaviour can be different as in Chrome ???

Thanks

Didier Bedouillat

Lander Noterman

unread,
Oct 31, 2018, 3:59:20 AM10/31/18
to android-webview-dev, dbedo...@gmail.com
Did any of you find a solution to this problem in the end?
I am faced with the exact same problem.

Op donderdag 11 januari 2018 17:40:09 UTC+1 schreef Didier Bedouillat:

Changwan Ryu

unread,
Nov 2, 2018, 6:03:39 PM11/2/18
to Lander Noterman, micha...@chromium.org, android-webview-dev, dbedo...@gmail.com
This seems like http://crbug.com/801501. Michael, do you have any update?



--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview-dev+unsub...@chromium.org.
To post to this group, send email to android-webview-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/android-webview-dev/0dc75616-20d3-41af-a7aa-7d0391906331%40chromium.org.

Reply all
Reply to author
Forward
0 new messages