Giter Site home page Giter Site logo

sipsorcery / sipsorcery-media Goto Github PK

View Code? Open in Web Editor NEW
19.0 6.0 14.0 6.93 MB

The SIPSorcery library for WebRTC infrastructure and Windows audio and video capture.

C++ 53.81% C# 43.37% GLSL 2.82%
csharp managed-cpp media-foundation voip webrtc cpp dotnet-core dtls srtp

sipsorcery-media's Introduction

Build status

Update: As of Sep 2020 this library has been replaced by a combination of new C# features in the main SIPSorcery library and Windows audio and video device access plus VP8 codec hooks in a new SIPSorceryMedia.Windows library. It is not envisaged that this library will continue to be updated or maintained.

This repository contains a companion .Net Core 3.1 compatible library to the SIPSorcery SIP and WebRTC library. This library provides wrappers and integrations for a number of open source libraries and the functions to facilitate WebRTC communications:

  • OpenSSL - the DTLS handshake to negotiate the SRTP keying material.
  • libsrtp - for the Secure Realtime Transport Protocol.
  • libvpx - for VPX codecs (currently only VP8 is wired up).
  • ffmpeg - for some image conversion functions.

In addition Microsoft's Media Foundation Win32 API is used to provide access to Windows audio and video capture devices.

Building

Use vcpkg to install the dependencies.

  • Clone vcpkg from the github repository and install as per the instructions in the main README.md.
  • Install the required packages:
PS >.\vcpkg install --triplet x64-windows openssl libvpx ffmpeg libsrtp

Open src\SIPSorceryMedia.sln with Visual Studio and build or use the Native Tools Command Prompt for Visual Studio:

msbuild /m src\SIPSorceryMedia.sln /p:Configuration=Release /p:Platform=x64 /t:clean,build

Installing

This library can be used by .Net Core 3.1 applications on Windows. The library can either be built from source as described above or it can be installed via nuget using:

Install-Package SIPSorceryMedia -pre
dotnet add package SIPSorceryMedia --version "4.0.58-pre"

Getting Started

There are a number of sample applications available in the main SIPSorcery library repository.

WebRTCTestPatternServer: The simplest example. This program serves up a test pattern video stream to a WebRTC peer.

WebRTCServer: This example extends the test pattern example and can act as a media source for a peer. It has two source options:

  • An mp4 file.
  • Capture devices (webcam and microphone). The example includes an html file which runs in a Browser and will connect to a sample program running on the same machine.

WebRTCReceiver: A receive only example. It attempts to connect to a WebRTC peer and display the video stream that it receives.

sipsorcery-media's People

Contributors

robschoenaker avatar sipsorcery avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

sipsorcery-media's Issues

G729 Codec

Hello guys,
I am newbie in SipSorcery and VOIP, as well. I successfully used your sample codes to place calls to a VOIP server and record audio, building in .NET core 3.1. I have noticed that SipSorcery is designed to work with G711 ulaw and alaw, or better to say, non-compressed audio quality.
I am just wondering if it is possible to implement G729 codec for SipSorcery Media. Any guidance and tutorial will be appreciated.

Windows 10 - Microphone Tray Icon

Hi,

I'm testing these libraries for a project and have noticed an unusual symptom on Windows 10.

I've used the example code for placing an outgoing call from the main sipsorcery library. I edit the configuration to provide my registration information for the SIP server I'm using. I make a call outbound. The call connects with audio and appears to work fine. While the call is live, the microphone symbol in the Windows 10 tray appears and the disappears in a loop very quickly almost too fast to see.

If I repeat the process changing the audiooptions to select silence as the media source for audio, as you would expect, the call works and the issue does not occur.

I'm building with Visual Studio 2019 and v4.0.43-pre of SIPSorcery and v4.042-pre of SIPSorceryMedia.

Thanks.

Could not load file or assembly 'SIPSorceryMedia'

I'm running the code from the RecordIncomingCall example, building in .NET core 3.1.

On receiving a call, it's failing to load the SipSorceryMedia assembly with:

Exception handling INVITE. Could not load file or assembly 'SIPSorceryMedia, Version=4.0.34.0, Culture=neutral, PublicKeyToken=null'. An attempt was made to load a program with an incorrect format.

It runs fine on my dev machine, but not on the windows server I'm deploying to. The Windows Server has .net core runtime 3.1.3 installed (x86 and x64) and .net core SDK 3.1.201 x64.

csproj as follows:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <AssemblyName>SipServer</AssemblyName>
    <Platforms>AnyCPU;x64;x86</Platforms>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <Prefer32Bit>false</Prefer32Bit>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Serilog" Version="2.9.0" />
    <PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
    <PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
    <PackageReference Include="SIPSorcery" Version="4.0.35-pre" />
    <PackageReference Include="SIPSorcery.WebSocketSharp" Version="0.0.1" />
    <PackageReference Include="SIPSorceryMedia" Version="4.0.34-pre" />
  </ItemGroup>

</Project>

I've tried building as AnyCPU (prefer 32 bit checked and unchecked), x64 and x86 but it fails with the same error each time.

Any thoughts?

Support for audio streams

I would like to take full control of the audio - i.e. rather than using microphone or music files as the audio source, I'd like to call the Send* methods to send audio. Similarly, I'd like to send received audio elsewhere, rather than playing through the system speakers

I'm using the RecordIncomingCall example. If I set the AudioSource on the RtpAVSession options to "None", I get:

[16:25:17 WRN] No local media tracks available for create offer.
[16:25:17 WRN] Exception handling INVITE. Object reference not set to an instance of an object.
[16:25:17 WRN] Transaction already exists, ignoring duplicate request, INVITE sip:******.

If I set it to "Silence", I get:

[16:28:50 WRN] Resending final response for INVITE, sip:*****, cseq=1.

with some interesting noise played down the line to my softphone.

I'm running on a machine without any audio devices attached, as I shouldn't need any for my scenario - i'm wondering if this is the cause of the errors.

Is my scenario supported?

Implement DTLSHandshake with full c# (Org.BouncyCastle)

Hello Buddy, thank you very much for this amazing project.

SIPSorcery Media is a good initial point to WebRTC Support in SipSorcery but this implementations in C++ break the original concept of SIPSorcery (full cross platform C# project)

As some classes in SIPSorcery refer to classes in SipSorcery Media (as DtlsHandShake) i think if it is possible to convert DTLSHandshake to C# using reference to Org.BouncyCastle.

As my low Knowledge of C++ i probably cannot do this kind of conversion by myself.

Here another useful repository (this repository use Org.BouncyCastle to implement DTLS)
https://github.com/CreatorDev/DTLS.Net

Best Regards
Rafael

Not working when not using Chrome

WebRTC with Chrome on localhost works fine. However, when I use Firefox or Edge to connect through WebRTC, for example to the WebRTCReceiver, I get the following error:

07/07/2020 13:35:40|Error|<>c__DisplayClass71_0.<receiveRequest>b__0|Authentication failed, see inner exception.

I do not know how to fix this. Any hints?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.