Skip to content

pion/bwe-test

Repository files navigation


Pion Bandwidth Estimation Test Runner

Test runner for congestion control and bandwidth estimation algorithms in Pion

Pion webrtc join us on Discord Follow us on Bluesky
GoDoc Coverage Status Go Report Card License: MIT


This repository implements the test cases for congestion control for interactive real-time media described in RFC8867 for the algorithm(s) implemented in Pion.

Implemented/Planned Test Cases and Applications

The current implementation uses vnet.Net from pion/transport to simulate network constraints. There are three test applications:

  1. Simulcast-like setup - Uses a simple simulcast configuration
  2. Adaptive bitrate streaming - Uses synthetic encoder for adaptive bitrate
  3. Video file reader - Reads numbered JPG image files and sends them as video frames

Video File Reader

The video file reader (VideoFileReader) reads series of numbered JPG image files (e.g., frame_000.jpg, frame_001.jpg, etc.) from a directory and sends them as individual video frames using an RTCSender. This allows testing with real video content while maintaining precise control over frame timing and network conditions.

To use the video file reader test:

  • Create directories with numbered JPG files (e.g., ../sample_videos_0/, ../sample_videos_1/)
  • Files should be named with sequential numbers (frame_000.jpg, frame_001.jpg, etc.)
  • The reader automatically discovers, sorts, and cycles through the frames

To run the simulcast test, you must create three input video files as described in the bandwidth-esimation-from-disk example and place them in the vnet directory.

  • Variable Available Capacity with a Single Flow

  • Variable Available Capacity with Multiple Flows

  • Dual Video Tracks with Variable Available Capacity - Uses video file reader with multiple video tracks

  • Congested Feedback Link with Bi-directional Media Flows

  • Competing Media Flows with the Same Congestion Control Algorithm

  • Round Trip Time Fairness

  • Media Flow Competing with a Long TCP Flow

  • Media Flow Competing with Short TCP Flows

  • Media Pause and Resume

  • Media Flows with Priority

  • Explicit Congestion Notification Usage

  • Multiple Bottlenecks

Evaluation

RFC 8868 describes guidelines to evaluate congestion control algorithms for interactive real-time media. Currently, live statistics can be viewed during the test run via a web interface. In future, we might automate the evaluation.

Running

To run the tests, run go test -v ./vnet/.

To run the main test application with all test cases (including the video file reader test):

cd vnet
go run .

The application will run multiple test scenarios including:

  • ABR (Adaptive Bitrate) tests with single and multiple flows
  • Simulcast tests with single and multiple flows
  • Video file reader test with dual video tracks (requires sample video directories)

Video File Reader Test Requirements

Dependencies:

  • Test depends on libvpx-dev library. The procedure to install the library on linux machine is:
    sudo apt-get update
    sudo apt-get install -y libvpx-dev pkg-config

Video Preparation:

  • User needs to first decode two videos into sequenced jpg files and put the files under sample_videos_0 and sample_videos_1 directories
  • The command to use ffmpeg to decode the video is as follows:
    mkdir -p sample_videos_0
    ffmpeg -i /path/to/input/video0.mp4 -vsync 0 sample_videos_0/frame_%04d.jpg
    
    mkdir -p sample_videos_1
    ffmpeg -i /path/to/input/video1.mp4 -vsync 0 sample_videos_1/frame_%04d.jpg

Roadmap

The library is used as a part of our WebRTC implementation. Please refer to that roadmap to track our major milestones.

Community

Pion has an active community on the Discord.

Follow the Pion Bluesky or Pion Twitter for project updates and important WebRTC news.

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]

Contributing

Check out the contributing wiki to join the group of amazing people making this project possible

License

MIT License - see LICENSE for full text

About

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Contributors 10