Webrtc compilation of H 264 under Windows

Time:2020-3-31

1. System environment

  • Win10 operating system
  • Network support over the wall
  • Memory greater than 8g

2. Deployment development environment

2.1 download the chromium deployment tool depot tools

git clone https://github.com/coreos/dep…
And set the depot? Tools path to the path of the system environment variable path

2.2 installation vs2019

2.3 installation of Python

Open Python official website, download and install windows 2.7 python.

2.4 install Ninja

git clone git://github.com/ninja-build/ninja.git && cd ninja
git checkout release
"C:\Program  Files (x86)\Microsoft  Visual  Studio 14.0\VC\vcvarsall.bat" x64
python  configure.py  \--bootstrap

Test for successful installation:

ninja --help  

3. Download webrtc source code

3.1 fetch –nohooks webrtc

After a long wait, finally download the webrtc source code

3.2 gclient sync

Synchronize the source code. If the 3.1 download is interrupted, continue to download the code with gclient sync.

3.3 generate vs Project

gn gen out/h264 –ide=vs2019 –args=”proprietary_codecs=true rtc_use_h264=true ffmpeg_branding=”Chrome” is_debug=true target_cpu=”x86″ rtc_include_tests=false”

3.4 compiling source code

ninja -C ./out/h264
After compiling, open the vs solution in. / out / h264, and you can use VS for compiling and debugging.

4 adjust the priority of H264 encoding

Open the solution of webrtc in. / out / H264 and find the internal encoder factory.cc file of RTC? Internal video? Codecs project in Src / media at line 26:
std::vector<SdpVideoFormat> InternalEncoderFactory::GetSupportedFormats()

const {

std::vector<SdpVideoFormat> supported_codecs;
supported_codecs.push_back(SdpVideoFormat(cricket::kVp8CodecName));
for (const webrtc::SdpVideoFormat& format : webrtc::SupportedVP9Codecs())

supported_codecs.push_back(format);

for (const webrtc::SdpVideoFormat& format : webrtc::SupportedH264Codecs())

supported_codecs.push_back(format);

return supported_codecs;
}
Changed to:
std::vector<SdpVideoFormat> InternalEncoderFactory::GetSupportedFormats()

const {

std::vector<SdpVideoFormat> supported_codecs;
for (const webrtc::SdpVideoFormat& format : webrtc::SupportedH264Codecs()) supported_codecs.push_back(SdpVideoFormat(cricket::kVp8CodecName));
for (const webrtc::SdpVideoFormat& format : webrtc::SupportedVP9Codecs())

supported_codecs.push_back(format);
supported_codecs.push_back(format);

return supported_codecs;
}
At this point, H264 priority adjustment is completed. Run peerconnection_server.exe and peerconnection_client.exe to start a video call.

Recommended Today

PHP Basics – String Array Operations

In our daily work, we often need to deal with some strings or arrays. Today, we have time to sort them out String operation <?php //String truncation $str = ‘Hello World!’ Substr ($STR, 0,5); // return ‘hello’ //Chinese string truncation $STR = ‘Hello, Shenzhen’; $result = mb_ Substr ($STR, 0,2); // Hello //First occurrence of […]