Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Insertion of Custom Codecs into Firefox WebRTC Implementation

341 views
Skip to first unread message

aam...@gmail.com

unread,
Jul 20, 2014, 8:06:54 PM7/20/14
to mozilla-...@lists.mozilla.org
Hi everyone,

I was interested in modifying the Firefox implementation of WebRTC (for my own purposes), specifically, adding the MPEG-4 FBA codec to the implementation. I noticed that in the /media directory or Firefox source, there is the WebRTC installation as well as several codec libraries.

I was wondering, how would I be able to add and use additional codec libraries to the Firefox implementation of WebRTC?

Eric Rescorla

unread,
Jul 21, 2014, 11:04:44 AM7/21/14
to aam...@gmail.com, mozilla-...@lists.mozilla.org
You can use the Gecko Media Plugin facility recently landed in Firefox 33.

-Ekr


> _______________________________________________
> dev-media mailing list
> dev-...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-media
>

Randell Jesup

unread,
Jul 21, 2014, 11:59:34 AM7/21/14
to dev-...@lists.mozilla.org
On 7/21/2014 11:04 AM, Eric Rescorla wrote:
> On Sun, Jul 20, 2014 at 5:06 PM, <aam...@gmail.com> wrote:
>
>> Hi everyone,
>>
>> I was interested in modifying the Firefox implementation of WebRTC (for my
>> own purposes), specifically, adding the MPEG-4 FBA codec to the
>> implementation. I noticed that in the /media directory or Firefox source,
>> there is the WebRTC installation as well as several codec libraries.
>>
>> I was wondering, how would I be able to add and use additional codec
>> libraries to the Firefox implementation of WebRTC?
>
> You can use the Gecko Media Plugin facility recently landed in Firefox 33.

Note that to experiment with a different codec you could masquerade as
an H.264 GMP plugin (with your data hidden in what look like H.264
NALs). We use mode 1, which effectively lets you produce large binary
blobs of data that get fragmented by the RTP layer and reassembled for
you. Note that the code will make assumptions that the KeyFrame/etc
flags are set correctly.

To implement a full new codec requires a GMP plugin, and mods to the
media/webrtc/trunk/webrtc code (webrtc.org code in our tree) to
implement packetization/depacketization specific to that codec, and
smaller mods to media/webrtc/signaling/src/media to handle SDP
negotiation. Perhaps a few to signaling/src/media-conduit to handle
config parameters from SDP.

--
Randell Jesup, Mozilla

Aamoy Gupta

unread,
Jul 21, 2014, 7:50:11 PM7/21/14
to mozilla-...@lists.mozilla.org
So just to paraphrase, if I had the source of this codec, I would have to build it, and then trick GMP into thinking that it is an NAL. Do you know in the WebRTC trunk which files I would have to modify for packetization besides "media/webrtc/signaling/src/media" or does that depend on the codec?

Sorry for all the clarification questions-- I am very new to this.

Eric Rescorla

unread,
Jul 22, 2014, 11:59:54 AM7/22/14
to Aamoy Gupta, mozilla-...@lists.mozilla.org
On Mon, Jul 21, 2014 at 4:50 PM, Aamoy Gupta <aam...@gmail.com> wrote:

> So just to paraphrase, if I had the source of this codec, I would have to
> build it, and then trick GMP into thinking that it is an NAL.


For now, yes. This isn't that hard, as shown by:
http://dxr.mozilla.org/mozilla-central/source/dom/media/gmp-plugin/gmp-fake.cpp




> Do you know in the WebRTC trunk which files I would have to modify for
> packetization besides "media/webrtc/signaling/src/media" or does that
> depend on the codec?
>
> Sorry for all the clarification questions-- I am very new to this.
>
> On Monday, July 21, 2014 8:59:34 AM UTC-7, Randell Jesup wrote:
0 new messages