vsimon / webrtcbuilds

Getting started with WebRTC natively is no easy picnic. The goal of webrtcbuilds is to provide a single standalone WebRTC static library and package.
BSD 3-Clause "New" or "Revised" License
202 stars 164 forks source link

peerconnection_client: Failed to find capturer for id #7

Open ghost opened 8 years ago

ghost commented 8 years ago

Configuration: Windows 10 x64 Visual Studio 2013 Community webrtcbuilds-10081

Trying to get working peerconnection_client example built from source code. It builds without errors but fails to initialize a call with same peerconnection_client.

Console debug log:

(webrtcvideocapturer.cc:183): Failed to find capturer for id:
\\?\\root#image#0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
(common.cc:59): c:\\webrtcbuilds-builder\out\src\talk\app\webrtc\videosource.cc(334):
ASSERT FAILED: capturer != NULL @ webrtc::VideoSource::Create

Test cases:

vsimon commented 8 years ago

Hi, thanks. I think it would be helpful to know the compiler defines/flags you used to build the mine/peerconnection_client program. I know I have a TBD for the windows one in the wiki: https://github.com/vsimon/webrtcbuilds/wiki/Building-the-peerconnection-example so I'd be curious to know how it was built.

ghost commented 8 years ago

My setup of project -> Properties (for Debug x64 target):

mangodan2003 commented 8 years ago

Did anyone get to the bottom of this?

I'm on ubuntu 14.04 and see the same or at least similar problem trying to build the peerconnection example. The one I built as part of webrtrc works fine. However if I try to build it separately (e.g. as per the wiki page on building it), The Release build crashes somewhere down in the sigslot stuff when I hit connect, the Debug build fails creating the video capturer when I try to establish a link to another peer.

(linuxdevicemanager.cc:242): Enumerating V4L2 devices (linuxdevicemanager.cc:262): V4L2 device metadata found at /sys/class/video4linux/ (v4llookup.cc:74): Found V4L2 capture device /dev/video0 (linuxdevicemanager.cc:215): Trying /sys/class/video4linux/video0/name (linuxdevicemanager.cc:236): Name for video0 is Integrated_Webcam_HD (linuxdevicemanager.cc:285): Total V4L2 devices found : 1 (webrtcvideocapturer.cc:183): Failed to find capturer for id: /dev/video0 (common.cc:59): ../../talk/app/webrtc/videosource.cc(334): ASSERT FAILED: capturer != NULL @ Create

mangodan2003 commented 8 years ago

studying the output of ninja with -v I see the build uses llvm/clang rather than gcc and wonder if the crashes are some incompatibility. I have managed to make a Makefile that builds peerconnection_client as a separate project using clang and it works as it should :)

orenshir commented 8 years ago

I got it working. There were several steps:

  1. A few methods are implemented in two places: a. VideoCaptureImpl::Create : video_capture_external.cc and video_capture_factory_windows.cc b. VideoCaptureImpl::CreateDeviceInfo : device_info_external.cc and video_capture_factory_windows.cc I had to comment out the implementation in *_external.cc
  2. winsdk_samples.gyp wasn't modified to add standalone_static_library:1 as a part of the patch process. I had to add it manually and rebuild
  3. I'm not sure if this step is needed: adding d3d9.lib;gdi32.lib;strmiids.lib to additional dependencies (media.gyp uses them)
  4. Another maybe step: add C:/Program Files (x86)/Windows Kits/10/Lib/win8/um/x86; to additional library directories
alexanderb14 commented 8 years ago

I have been running into the same issues a few days ago on MacOS. The problem is that the method VideoCaptureImpl::Create is implemented in both files:

When WebRTC is compiled, the static libraries are created:

The build script from this project links all libraries into one, so both implementations are linked. If you get unlucky like me and the guys posting here, the implementation from video_capture_external.cc is used.

A possible fix would be just excluding the libvideo_capture.a when building the library, don't you think?

vsimon commented 8 years ago

@alexanderb14 thanks for the update, you're right. While migrating to gn-based builds, a blacklisting mechanism was put in place, this commit https://github.com/vsimon/webrtcbuilds/commit/5aff291d037879f10858bcbe545adc4af031fc9d may then help your problem.

For the previous comment about the linux build using llvm/clang, yes that was also the case; it should now build using gcc.

Keeping this issue open for further testing.