enabling H264 in native linux?

1,059 views
Skip to first unread message

Eric Davies

unread,
Apr 14, 2016, 4:22:28 PM4/14/16
to discuss-webrtc
Executive summary: what do you need to do to get h264 working in native webrtc on an x86 linux?

I'm using this mornings commit for webrtc (1112b2bc68e6c900f56fad79fa7dc1c1796ce9e9) and I've set the following flags 

export GYP_DEFINES=rtc_use_h264="true ffmpeg_branding=chrome use_openh264=1 ffmpeg=chrome" 
export GYP_GENERATOR_FLAGS="rtc_use_h264=true ffmpeg_branding=chrome use_openh264=1 ffmpeg=chrome"
 
 before running the usual gyp/ninja steps
python webrtc/build/gyp_webrtc
ninja -C out/Release

However:
  • There isn't any sign of any the openh264 files being compiled
  • I'm not seeing any mention of H264 in the offers or answers. 
  • The video_loopback test fails spectacularly

$ ./out/Release/video_loopback --codec=H264

#
# Fatal error in ../../webrtc/modules/video_coding/video_sender.cc, line 158
# Check failed: _codecDataBase.DeregisterExternalEncoder(payloadType, &wasSendCodec)
#

==== C stack trace ===============================

./out/Release/video_loopback() [0x4604e2]
./out/Release/video_loopback() [0x4d1307]
./out/Release/video_loopback() [0x4d08ed]
./out/Release/video_loopback() [0x44632e]
./out/Release/video_loopback() [0x442e1b]
./out/Release/video_loopback() [0x43d344]
./out/Release/video_loopback() [0x40d202]
./out/Release/video_loopback() [0x40868a]
./out/Release/video_loopback() [0x408b65]
10: __libc_start_main
./out/Release/video_loopback() [0x4081c1]
Aborted (core dumped)

I don't have any previously installed openH264 or ffmpeg libraries.

andy424

unread,
Dec 14, 2016, 4:02:27 PM12/14/16
to discuss-webrtc


I am going to start trying to enable H264 in webrtc natice linux code. Any updated answer to the Original Post/Question ? i am still using gyp(not yet migrated to gn)  and am on chrome54 currently

andy424

unread,
Dec 15, 2016, 10:47:54 AM12/15/16
to discuss-webrtc
$ export GYP_DEFINES="proprietary_codecs=1 ffmpeg_branding=Chrome"
$ echo $GYP_DEFINES
proprietary_codecs=1 ffmpeg_branding=Chrome
$ python webrtc/build/gyp_webrtc
Updating projects from gyp files...
$ ninja -C out/Release
ninja: Entering directory `out/Release'
[3467/3467] STAMP obj/All.actions_depends.stamp


Voila! I now have H264 showing up in my SDP offer in addition to VP8 and VP9

a=rtpmap:100 VP8/90000
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 transport-cc
a=rtpmap:101 VP9/90000
a=rtcp-fb:101 ccm fir
a=rtcp-fb:101 nack
a=rtcp-fb:101 nack pli
a=rtcp-fb:101 goog-remb
a=rtcp-fb:101 transport-cc
a=rtpmap:107 H264/90000
a=rtcp-fb:107 ccm fir
a=rtcp-fb:107 nack
a=rtcp-fb:107 nack pli
a=rtcp-fb:107 goog-remb
a=rtcp-fb:107 transport-cc
a=fmtp:107 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:116 red/90000
a=rtpmap:117 ulpfec/90000
a=rtpmap:96 rtx/90000
a=fmtp:96 apt=100
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=101
a=rtpmap:99 rtx/90000
a=fmtp:99 apt=107
a=rtpmap:98 rtx/90000
a=fmtp:98 apt=116

Bo Xu

unread,
Dec 15, 2016, 11:52:52 AM12/15/16
to discuss-webrtc

I am using "gn gen out/Default" to generate the ninja project file from the following:

in this case can I still enable H.264 with the way you mentioned as the following?
...
$ export GYP_DEFINES="proprietary_codecs=1 ffmpeg_branding=Chrome"
$ python webrtc/build/gyp_webrtc
$ ninja -C out/Release
...

Thanks!
Bo Xu

Brian Baldino

unread,
Dec 16, 2016, 1:33:15 AM12/16/16
to discuss...@googlegroups.com
argn.gn* file

On Thu, Dec 15, 2016 at 9:07 AM, Brian Baldino <br...@jitsi.org> wrote:
to do it with gn, in your args.g file you can set:

ffmpeg_branding = "Chrome"
proprietary_codecs = true


--

---
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-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/7ef7d191-63a2-476d-8f01-3cf73bc3ca21%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


Brian Baldino

unread,
Dec 16, 2016, 1:33:20 AM12/16/16
to discuss...@googlegroups.com
to do it with gn, in your args.g file you can set:

ffmpeg_branding = "Chrome"
proprietary_codecs = true

On Thu, Dec 15, 2016 at 8:52 AM, Bo Xu <boxus...@gmail.com> wrote:

--

---
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-webrtc+unsubscribe@googlegroups.com.

andy424

unread,
Dec 19, 2016, 5:21:53 PM12/19/16
to discuss-webrtc
$ gn gen out/Release -args='ffmpeg_branding="Chrome" proprietary_codecs=true'
Done. Made 361 targets from 114 files in 98ms
$ find . -name args.gn
./out/Release/args.gn
$ cat ./out/Release/args.gn
Reply all
Reply to author
Forward
0 new messages