webrtcbuilds icon indicating copy to clipboard operation
webrtcbuilds copied to clipboard

peerconnection_client: Failed to find capturer for id

Open ghost opened this issue 9 years ago • 7 comments

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:

  • bin/peerconnection_client + bin/peerconnection_client: works fine, video is showing
  • bin/peerconnection_client + mine compiled peerconnection_client (Debug x64): error above
  • mine compiled peerconnection_client + mine compiled peerconnection_client (Debug x64): error above
  • mine compiled peerconnection_client + mine compiled peerconnection_client (Release x64): just closes
  • bin/peerconnection_client + mine compiled peerconnection_client (Debug Win32): error above

ghost avatar Oct 04 '15 17:10 ghost

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.

vsimon avatar Oct 04 '15 19:10 vsimon

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

  • C/C++ -> General:
    • Additional Include Directories: C:\workspace\webrtcbuilds-10081-d6d27e7-windows\include;%(AdditionalIncludeDirectories)
    • SDL checks: No (/sdl-)
  • C/C++ -> Preprocessor:
    • Preprocessor definitions: WIN32 _DEBUG _CONSOLE _LIB _CRT_SECURE_NO_WARNINGS UNICODE WEBRTC_WIN NOMINMAX
  • C/C++ -> Code Generation:
    • Runtime Library: Multi-threaded Debug (/MTd)
  • Linker -> General:
    • Enable Incremental Linking: Yes (/INCREMENTAL)
    • Additional Library Directories: C:\workspace\webrtcbuilds-10081-d6d27e7-windows\lib\Debug_x64;%(AdditionalLibraryDirectories)
  • Linker -> Input:
    • Additional Dependencies: webrtc_full.lib;advapi32.lib;dmoguids.lib;msdmo.lib;secur32.lib;winmm.lib;ws2_32.lib;wmcodecdspuuid.lib;%(AdditionalDependencies)
  • Linker -> System:
    • SubSystem:
      • Console (/SUBSYSTEM:CONSOLE) for console window with debug output (main.cc change needed to int main(int argc, char** argv))
      • Windows (/SUBSYSTEM:WINDOWS) for build without console window (no changes needed)

ghost avatar Oct 04 '15 19:10 ghost

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 avatar Feb 01 '16 10:02 mangodan2003

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 :)

mangodan2003 avatar Feb 01 '16 17:02 mangodan2003

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

orenshir avatar Feb 24 '16 01:02 orenshir

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:

  • video_capture_external.cc
  • video_capture_impl.h

When WebRTC is compiled, the static libraries are created:

  • libvideo_capture.a (containing the Create implementation from video_capture_external.cc which is not what we want)
  • libvideo_capture_module_internal_impl.a (containing the Create impementation from video_capture_impl.h)

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?

alexanderb14 avatar Sep 05 '16 01:09 alexanderb14

@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.

vsimon avatar Sep 13 '16 08:09 vsimon