H264 VideoEncoder class

205 views
Skip to first unread message

shty...@gmail.com

unread,
Oct 12, 2015, 4:07:26 PM10/12/15
to discuss-webrtc
Question regarding the Webrtc Native C++ API (the one maintained by google).

I see in the source tree that H264 VideoEncoder is not supported on Windows or Linux. If however I wanted to support H264 video encoding on these platforms with the native API, would the only thing to do be writing a class to extend the VideoEncoder correctly? Is there a particular reason there is no implementation out there for H264 VideoEncoder class? Or if there is can someone point me to it.

Peter Boström

unread,
Oct 12, 2015, 4:10:28 PM10/12/15
to discuss-webrtc

On Mon, Oct 12, 2015 at 10:07 PM <shty...@gmail.com> wrote:
Question regarding the Webrtc Native C++ API (the one maintained by google).

I see in the source tree that H264 VideoEncoder is not supported on Windows or Linux. If however I wanted to support H264 video encoding on these platforms with the native API, would the only thing to do be writing a class to extend the VideoEncoder correctly? Is there a particular reason there is no implementation out there for H264 VideoEncoder class? Or if there is can someone point me to it.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/f96e59e7-945e-4fc8-a7a3-8e53e01bbabe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peter Boström

unread,
Oct 12, 2015, 4:10:50 PM10/12/15
to discuss-webrtc
(Which will have to implement VideoEncoder, etc.)

Harald Alvestrand

unread,
Oct 12, 2015, 4:12:28 PM10/12/15
to WebRTC-discuss
H.264 is patent-encumbered technology, and you may be well advised to talk to your legal counsel before trying to use it.

Nevertheless, H.264 functionality (software encoder/deocder), based on Cisco's OpenH264 source, is in the process of being added to Chrome. It'll be behind a configuration flag that defaults to OFF for open source checkouts (to avoid the issues referenced above), but it will be there for those who want to use it. We're not done yet, however.

Peter already sent the bug link :-)

Harald

On Mon, Oct 12, 2015 at 10:07 PM, <shty...@gmail.com> wrote:
Question regarding the Webrtc Native C++ API (the one maintained by google).

I see in the source tree that H264 VideoEncoder is not supported on Windows or Linux. If however I wanted to support H264 video encoding on these platforms with the native API, would the only thing to do be writing a class to extend the VideoEncoder correctly? Is there a particular reason there is no implementation out there for H264 VideoEncoder class? Or if there is can someone point me to it.

--

Roman Shtylman

unread,
Oct 12, 2015, 4:14:29 PM10/12/15
to discuss...@googlegroups.com
Thanks for the link; I will follow that for sure. Is there a patchset with the changes for webrtc given that the last comment says a canary release is planned in a few weeks?

Separately, if the VideoEncoder is implemented (via a patchset, etc) will that play nicely with the H264 support in Firefox?

You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/jjUKXC7RJVI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CAGFX3sEj4yukrvyrmf7c1CQ26uGpeCvODVh%2BMn7tO%2Bw%3DJV4y%2Bw%40mail.gmail.com.

Brian Baldino

unread,
Oct 12, 2015, 4:19:01 PM10/12/15
to discuss...@googlegroups.com
As far as I know, this is the corresponding patchset: https://codereview.webrtc.org/1306813009

Roman Shtylman

unread,
Oct 12, 2015, 5:51:38 PM10/12/15
to discuss...@googlegroups.com
Thanks! I got that patchset built and running.

Follow up question: when my native app prepares the channel session (somewhere in channel.cc) the RtpSendParametersFromMediaDescription is called. This sets the send parameter codec to VP8 which means the H264 encoding is never activated. Is there a way to force H264 to be the codec used for my media communication?

shty...@gmail.com

unread,
Oct 13, 2015, 2:17:20 PM10/13/15
to discuss-webrtc
Replying here for others to stumble upon if they want to try out h264

After getting the patchset (referenced earlier) built, I was able to establish a connection using h264 video with the peerconnection_client to firefox (which currently has h264 support). The trick to making it work right now is to hack up the SDP offer to either remove or de-prioritize the VP8 encoding option (I just removed it). Additionally, you must add the profile level id information to the SDP offer string (the patchset implementation doesn't seem to do that and firefox currently needs it).

a=fmtp:126 profile-level-id=42e00c;packetization-mode=1

Obviously in your offer the codec id (126) maybe be different. Once I made these changes to the SDP offer, firefox played the h264 video encoded from the native client.

These are clearly hacks but got the patchset above talking with firefox with h264 video

hb...@webrtc.org

unread,
Oct 15, 2015, 8:14:26 AM10/15/15
to discuss-webrtc
I created a bug issue for making sure interoperability works with Firefox for H.264 to be resolved when OpenH264 support has landed, https://code.google.com/p/chromium/issues/detail?id=543540.

Roman Shtylman

unread,
Oct 15, 2015, 12:44:37 PM10/15/15
to discuss...@googlegroups.com
Where would this change need to land? Would this be in the h264 patchset for webrtc repo? Seems like that is what sends the SDP (since I am not even using chromium in my sample apps).

--

---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/jjUKXC7RJVI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.

Peter Boström

unread,
Oct 15, 2015, 12:46:40 PM10/15/15
to discuss...@googlegroups.com
Likely a fix on the PeerConnection level.

You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CAEyvjNyYiHi5%3DN3STB%2BZ%3DZOcgv09SrVoWR3-QQ6vFjFf1zYG_g%40mail.gmail.com.

Roman Shtylman

unread,
Oct 17, 2015, 1:20:34 PM10/17/15
to discuss...@googlegroups.com
Any hints as to which class/where in the code that might be? I studied the PR for h264 (linked) but it seems that the SDP stuff is outside the scope of that PR.

Peter Boström

unread,
Oct 19, 2015, 5:09:36 AM10/19/15
to discuss...@googlegroups.com
It's populated from here: https://chromium.googlesource.com/external/webrtc/+/a20de2030f7f3a3c5e252ccc76a467109f5a93dc/talk/media/webrtc/webrtcvideoengine2.cc#348

It might be that kH264CodecName ("H264") should also contain the profile. I'm not sure how this would be added, hopefully this gives a hint.

Reply all
Reply to author
Forward
0 new messages