Code Monkey home page Code Monkey logo

rtsp-bench's Introduction

Pion WebRTC
RTSP Bench

RTSP Server that generates usage reports, Web/CLI Clients included!

Pion webrtc Slack Widget
License: MIT


rtsp-bench is a WebRTC server that pulls from an RTSP feed, and then re-distributes via WebRTC. It generates a report.csv with the CPU Usage and connected PeerConnection count.

This repo contains a CLI WebRTC Client that will connect and perform the load test. This is done via a REST API hosted on :8080/doSignaling. You can also watch the video/load test via the web UI at :8080/, it connects via the same REST API as the CLI.

This project heavily borrows from RTSPtoWebRTC. If you are looking for a full featured application to deploy that is probably a better choice. It is driven by a config file and has proper error handling.

Running

  • export GO111MODULE=on
  • git clone https://github.com/pion/rtsp-bench.git
  • cd rtsp-bench/server
  • go run main.go

You can then access the Web UI at http://localhost:8080. This requires a browser that supports H264, this repo doesn't do any error handling around signaling failures.

You can also use the provided WebRTC CLI

  • cd rtsp-bench/client
  • go run main.go localhost:8080

In the server folder you will have a reports.csv that looks like

timestamp, peerConnectionCount, cpuUsage
2020-12-15T13:59:23-08:00, 1, 17.878028
2020-12-15T13:59:26-08:00, 0, 35.101254
2020-12-15T13:59:29-08:00, 1, 12.565718
2020-12-15T13:59:32-08:00, 1, 20.600500
2020-12-15T13:59:35-08:00, 1, 17.878028
2020-12-15T13:59:38-08:00, 0, 41.795438
2020-12-15T13:59:41-08:00, 0, 37.083333

Results

The following graph was generated from the results.csv that was generated by the server. The client was run from another EC2 instance in the same VPC. The Y Axis is the CPU Usage, and the X Axis is the count of PeerConnections. This was run on a m4.2xlarge (Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz)

Results Graph

FAQ

What codec/bitrate was being distributed

H264 that is approximately 250 Kb/s. You can change that here

What SRTP Cipher was used

SRTP_AEAD_AES_128_GCM

What Congestion Control/Feedback is used

None, on purpose.

Pion by design allows the user to specify what they want. We are distributing a video feed that is already encoded, and has a very small keyframe-interval so these things don't help us.

When setting up the PeerConnection you have full control of the RTP/RTCP pipelines, so users can add TWCC/NACK/FEC in a way that works for them.

I want to talk about cool WebRTC stuff!

Join the Pion Slack

Community

Pion has an active community on the Golang Slack. Sign up and join the #pion channel for discussions and support. You can also use Pion mailing list.

We are always looking to support your projects. Please reach out if you have something to build!

If you need commercial support or don't want to use public methods you can contact us at [email protected]

License

MIT License - see LICENSE for full text

rtsp-bench's People

Contributors

jonathan727 avatar renovate-bot avatar sean-der avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

rtsp-bench's Issues

How to reduce Bitrate or Quality of the stream

Hi, I am converting an rtsp stream to webrtc, I am using the exact code from this repo. I am not sure how to reduce the quality of the video stream. The stream I am using have a higher bitrate I am trying to lower it down for bandwith reasons. Any help might be use ful.

Thank You.

Audio

Is it possible to add audio track using this code?

How do I get a frame and save it as an image

Summary

One paragraph explanation of the feature.

Motivation

Hello, I saw a Snapshot demo that demonstrates saving as a picture, but only supports VP8, through the RTSP is H264, how to achieve the capture of the stream and save as an image file?

Describe alternatives you've considered

Additional context

Please help me, thank you.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

gomod
go.mod
  • go 1.12
  • github.com/deepch/vdk v0.0.0-20211113104208-022deeb641f7@022deeb641f7
  • github.com/pion/webrtc/v3 v3.1.1
  • github.com/shirou/gopsutil v3.22.2+incompatible

  • Check this box to trigger a request for Renovate to run again on this repository

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

RTSP Url dynamic

Summary

Make the RTSP URL dynamic via request.

Motivation

The RTSP URL is fixed in code base, making it annoying to modify in code base

Describe alternatives you've considered

It could be via the command line

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.