Henry Soang
Henry Soang

Reputation: 289

Does Google implementation of the WebRTC support H.264 or not

after trying to research online, I'm still not certain as I need a more up to date answer (since WebRTC is changing constantly):

Right now, does the Google implementation of the WebRTC support H.264 or not?

Doing some research online, I see that there are plans to and it's not supported, but but when I see the source code of google WebRTC, I do see some mention of H.264 decoding:

test@lab:~/myWebRTC/src$ find . -name "h"  | xargs grep -i 264
...
./chromium/src/content/common/gpu/media/h264_decoder.h:  void ConstructReferencePicListsB(media::H264SliceHeader slice_hdr);
./chromium/src/content/common/gpu/media/h264_decoder.h:  int PicNumF(const scoped_refptr& pic);
./chromium/src/content/common/gpu/media/h264_decoder.h:  int LongTermPicNumF(const scoped_refptr& pic);
./chromium/src/content/common/gpu/media/h264_decoder.h:  bool ModifyReferencePicList(media::H264SliceHeader* slice_hdr,
./chromium/src/content/common/gpu/media/h264_decoder.h:                              H264Picture::Vector* ref_pic_listx);
./chromium/src/content/common/gpu/media/h264_decoder.h:  bool StartNewFrame(media::H264SliceHeader* slice_hdr);
./chromium/src/content/common/gpu/media/h264_decoder.h:  void OutputPic(scoped_refptr pic);
./chromium/src/content/common/gpu/media/h264_decoder.h:  media::H264Parser parser_;
./chromium/src/content/common/gpu/media/h264_decoder.h:  H264DPB dpb_;
./chromium/src/content/common/gpu/media/h264_decoder.h:  scoped_refptr curr_pic_;
./chromium/src/content/common/gpu/media/h264_decoder.h:  H264Picture::Vector ref_pic_list_p0_;
./chromium/src/content/common/gpu/media/h264_decoder.h:  H264Picture::Vector ref_pic_list_b0_;
./chromium/src/content/common/gpu/media/h264_decoder.h:  H264Picture::Vector ref_pic_list_b1_;
./chromium/src/content/common/gpu/media/h264_decoder.h:  H264Picture::Field prev_ref_field_;
./chromium/src/content/common/gpu/media/h264_decoder.h:  scoped_ptr curr_nalu_;
./chromium/src/content/common/gpu/media/h264_decoder.h:  scoped_ptr curr_slice_hdr_;
./chromium/src/content/common/gpu/media/h264_decoder.h:  H264Accelerator* accelerator_;
./chromium/src/content/common/gpu/media/h264_decoder.h:  DISALLOW_COPY_AND_ASSIGN(H264Decoder);

My goal is I need to have a embedded device that comes with encoded H.264 to use WebRTC to stream out.

So, I want to know if Google WebRTC is an option, or would OpenWebRTC be my only option for H.264 at this point?

Thanks.

Upvotes: 4

Views: 2414

Answers (2)

jonpd
jonpd

Reputation: 356

Since codecs in the browser can in theory come and go, perhaps you should consider converting (transcoding) the video at the other end (it sounds like you need H.264 because that's what the other end is handling). That way, you don't need to be concerned with what codec has been negotiated by the browser at any time.

Upvotes: 0

Aki
Aki

Reputation: 3839

What you are seeing is just code for decoding H264 which is needed for non-webrtc related video recv/decoding.

In general, Chrome does not support H264 encode for webrtc, just because VP8 is their primary royalty free codec and answer to H264 which has way too many patent-related complications. Now fairly recently cisco released openh264 - https://github.com/cisco/openh264 which is what Firefox has implemented to support H264 as well. However, I don't see Google supporting it anytime soon, especially with VP9 coming.

Ideally, if you could get access to the raw video frames on your device, and then encode them in VP8 yourself; it would be much easier to get your video flowing via webrtc.

Upvotes: 2

Related Questions