Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Windows build missing CreateBuiltinVideo(Decoder/Encoder)Factory symbols

107 views
Skip to first unread message

Aaron Clauson

unread,
Dec 22, 2024, 4:41:07 AM12/22/24
to discuss-webrtc
I've been able to successfully build and link against webrtc.lib to create an audio only peer connection. I'm now looking at adding video but am stuck at missing symbols for webrtc::CreateBuiltinVideoEncoderFactory() and webrtc::CreateBuiltinVideoDecoderFactory().

I've checked the gn options and done some trial and error testing with enabling h264, h265, vp9 to see if that makes a difference but to no avail.

Is there any kind of trick to get the libwebrtc build on Windows to include video encoding or is it always meant to be included? A few years ago I built against m90 and those two symbols were there. I'm now building m132 and they're missing for me.

My gn args are:

gn gen out/Default --args="is_debug=false rtc_include_tests=false treat_warnings_as_errors=false use_custom_libcxx=false"

The relevant app code is:

  SignalingThread = rtc::Thread::Create();
  SignalingThread->Start();

  webrtc::AudioProcessing::Config apmConfig;
  apmConfig.gain_controller1.enabled = false;
  apmConfig.gain_controller2.enabled = false;
  auto apm = webrtc::BuiltinAudioProcessingBuilder(apmConfig).Build(webrtc::CreateEnvironment());

   webrtc::PeerConnectionFactoryDependencies _pcf_deps;
  _pcf_deps.task_queue_factory = webrtc::CreateDefaultTaskQueueFactory();
  _pcf_deps.signaling_thread = SignalingThread.get();
  _pcf_deps.event_log_factory = std::make_unique<webrtc::RtcEventLogFactory>(_pcf_deps.task_queue_factory.get());
  _pcf_deps.audio_encoder_factory = webrtc::CreateBuiltinAudioEncoderFactory();
  _pcf_deps.audio_decoder_factory = webrtc::CreateBuiltinAudioDecoderFactory();
  //_pcf_deps.video_encoder_factory = webrtc::CreateBuiltinVideoEncoderFactory(); // Missing symbol in my m132 build.
  //_pcf_deps.video_decoder_factory = webrtc::CreateBuiltinVideoDecoderFactory(); // Missing symbol in my m132 build.
  _pcf_deps.adm = rtc::scoped_refptr<webrtc::AudioDeviceModule>(FakeAudioCaptureModule::Create());
  _pcf_deps.audio_processing = apm; // Gets moved in EnableMedia.

  webrtc::EnableMedia(_pcf_deps);

  _peerConnectionFactory = webrtc::CreateModularPeerConnectionFactory(std::move(_pcf_deps));

And the linker errors when the two lines are uncommented:

undefined symbol: class std::unique_ptr<class webrtc::VideoEncoderFactory, struct std::default_delete<class webrtc::VideoEncoderFactory>> __cdecl webrtc::CreateBuiltinVideoEncoderFactory(void)
undefined symbol: class std::unique_ptr<class webrtc::VideoDecoderFactory, struct std::default_delete<class webrtc::VideoDecoderFactory>> __cdecl webrtc::CreateBuiltinVideoDecoderFactory(void)

Any hints or tips appreciated.

Aaron


Evgeniy Sorokin

unread,
Dec 23, 2024, 1:39:59 PM12/23/24
to discuss-webrtc
Did you try adding e.g. "rtc_use_h264=true" for h264 support?

воскресенье, 22 декабря 2024 г. в 12:41:07 UTC+3, Aaron Clauson:

Aaron Clauson

unread,
Dec 23, 2024, 4:15:26 PM12/23/24
to discuss-webrtc
Thanks for the reply.

Yes, I did try that option. Build succeeds but the two symbols are still missing.


Philipp Hancke

unread,
Dec 24, 2024, 10:30:33 AM12/24/24
to discuss...@googlegroups.com
I think that is intentional,
  gn desc out/Default/ :webrtc
does not have the api/video_codecs:builtin_video_decoder_factory or encoder factory listed as dependencies. And the webrtc target depends on api:enable_media, not api:enable_media_with_defaults (see api/BUILD.gn)

You generally want the template adapter, see the comments

--
This list falls under the WebRTC Code of Conduct - https://webrtc.org/support/code-of-conduct.
---
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-webrt...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/discuss-webrtc/b77da05b-f5ff-4230-9609-fc387b290dcdn%40googlegroups.com.

Aaron Clauson

unread,
Dec 26, 2024, 5:37:52 PM12/26/24
to discuss-webrtc
> You generally want the template adapter, see the comments

Thanks! That put me on the right path and I've been able to add VP8 encoders & decoders to my peer factory now.
Reply all
Reply to author
Forward
0 new messages