how to integrate OPENH264 to webrtc sdk

how to integrate OPENH264 to webrtc sdk

description

The webrtc sdk does not support h264 yet. But we can use open source h264 implementation such as openh264 and x264 to make it work. This document talk about integrate openh264 to webrtc sdk on ubuntu 14.04(64bits), the idea and the basic code is based on the blog
http://blog.csdn.net/liuhongxiangm/article/details/48523939 ,thanks to the author.

step 1: compile openh264

  • the code of openh264 is here:https://github.com/cisco/openh264
  • before compile openh264 you need to install nasm:http://www.nasm.us/
  • go into the folder of openh264 run “make ARCH=x86_64” and “make install”, by default the lib is in /usr/local/lib
  • the lib named libopenh264.a is what we need

step 2: implement H264Encoder and H264Decoder of webrtc

the implementation of the two classes is in the code of this blog http://blog.csdn.net/liuhongxiangm/article/details/48523939 , what we need is 4 files:h264.h, main.h, h264_impl.h and h264_impl.cc

  • put the h264.h to src/webrtc/modules/video_coding/codecs/h264/include folder

  • put the other 3 files to src/webrtc/modules/video_coding/codecs/h264/ folder

step 3: write a h264.gypi to compile the h264 codec

the gyp file is used to generate a .ninja file which is similar to a MakeFile.

you will need to install pkg-config if you use my version of h264.gypi

here is the h264.gypi I wrote:

# Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS.  All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.

{
  'includes': [
    '../../../../build/common.gypi',
  ],
  'targets': [
    {
      'target_name': 'webrtc_h264',
      'type': 'static_library',
      'sources': [
        'main.h',
        'include/h264.h',
        'h264_impl.cc',
        '
  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值