Skip to content

Commit 3136f8c

Browse files
committed
Add video_file_reader and test
1 parent f696e23 commit 3136f8c

19 files changed

+3059
-138
lines changed

.github/.ci.conf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# SPDX-FileCopyrightText: 2025 The Pion community <https://pion.ly>
2+
# SPDX-License-Identifier: MIT
3+
4+
PRE_TEST_HOOK=_install_dependencies_hook
5+
PRE_LINT_HOOK=_install_dependencies_hook
6+
GO_MOD_VERSION_EXPECTED=1.24
7+
SKIP_i386_TESTS=true
8+
SKIP_WINDOWS_TESTS=true
9+
SKIP_API_DIFF=true
10+
11+
function _install_dependencies_hook(){
12+
set -e
13+
14+
sudo apt-get update
15+
sudo apt-get install -y libvpx-dev pkg-config
16+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@
1414
bin/
1515
vendor/
1616
node_modules/
17+
data/
1718

1819
### Files ###
1920
#############
2021
*.ivf
2122
*.ogg
23+
*.y4m
2224
tags
2325
cover.out
2426
*.sw[poe]
2527
*.wasm
2628
examples/sfu-ws/cert.pem
2729
examples/sfu-ws/key.pem
2830
wasm_exec.js
31+
bwe-test

.reuse/dep5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
22
Upstream-Name: Pion
33
Source: https://github.com/pion/
44

5-
Files: README.md DESIGN.md **/README.md AUTHORS.txt renovate.json go.mod go.sum **/go.mod **/go.sum .eslintrc.json package.json examples.json sfu-ws/flutter/.gitignore sfu-ws/flutter/pubspec.yaml c-data-channels/webrtc.h examples/examples.json yarn.lock
6-
Copyright: 2023 The Pion community <https://pion.ly>
5+
Files: README.md DESIGN.md **/README.md AUTHORS.txt renovate.json go.mod go.sum **/go.mod **/go.sum .eslintrc.json package.json examples.json sfu-ws/flutter/.gitignore sfu-ws/flutter/pubspec.yaml c-data-channels/webrtc.h examples/examples.json yarn.lock vnet/phases/*.json
6+
Copyright: 2025 The Pion community <https://pion.ly>
77
License: MIT
88

99
Files: testdata/seed/* testdata/fuzz/* **/testdata/fuzz/* api/*.txt

README.md

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,22 @@ real-time media described in [RFC8867](https://www.rfc-editor.org/rfc/rfc8867.ht
2222
### Implemented/Planned Test Cases and Applications
2323
The current implementation uses [`vnet.Net` from
2424
pion/transport](https://github.com/pion/transport) to simulate network
25-
constraints. There are two test applications, one using a simple simulcast-like
26-
setup and the other one using adaptive bitrate streaming with a synthetic
27-
encoder.
25+
constraints. There are three test applications:
26+
27+
1. **Simulcast-like setup** - Uses a simple simulcast configuration
28+
2. **Adaptive bitrate streaming** - Uses synthetic encoder for adaptive bitrate
29+
3. **Video file reader** - Reads numbered JPG image files and sends them as video frames
30+
31+
#### Video File Reader
32+
The video file reader (`VideoFileReader`) reads series of numbered JPG image files
33+
(e.g., `frame_000.jpg`, `frame_001.jpg`, etc.) from a directory and sends them as
34+
individual video frames using an `RTCSender`. This allows testing with real video
35+
content while maintaining precise control over frame timing and network conditions.
36+
37+
To use the video file reader test:
38+
- Create directories with numbered JPG files (e.g., `../sample_videos_0/`, `../sample_videos_1/`)
39+
- Files should be named with sequential numbers (frame_000.jpg, frame_001.jpg, etc.)
40+
- The reader automatically discovers, sorts, and cycles through the frames
2841

2942
To run the simulcast test, you must create three input video files as described
3043
in the [bandwidth-esimation-from-disk
@@ -33,6 +46,7 @@ and place them in the `vnet` directory.
3346

3447
- [ ] **Variable Available Capacity with a Single Flow**
3548
- [ ] **Variable Available Capacity with Multiple Flows**
49+
- [x] **Dual Video Tracks with Variable Available Capacity** - Uses video file reader with multiple video tracks
3650
- [ ] **Congested Feedback Link with Bi-directional Media Flows**
3751
- [ ] **Competing Media Flows with the Same Congestion Control Algorithm**
3852
- [ ] **Round Trip Time Fairness**
@@ -53,6 +67,37 @@ interface. In future, we might automate the evaluation.
5367
### Running
5468
To run the tests, run `go test -v ./vnet/`.
5569

70+
To run the main test application with all test cases (including the video file reader test):
71+
```bash
72+
cd vnet
73+
go run .
74+
```
75+
76+
The application will run multiple test scenarios including:
77+
- ABR (Adaptive Bitrate) tests with single and multiple flows
78+
- Simulcast tests with single and multiple flows
79+
- Video file reader test with dual video tracks (requires sample video directories)
80+
81+
#### Video File Reader Test Requirements
82+
83+
**Dependencies:**
84+
- Test depends on libvpx-dev library. The procedure to install the library on linux machine is:
85+
```bash
86+
sudo apt-get update
87+
sudo apt-get install -y libvpx-dev pkg-config
88+
```
89+
90+
**Video Preparation:**
91+
- User needs to first decode two videos into sequenced jpg files and put the files under `sample_videos_0` and `sample_videos_1` directories
92+
- The command to use ffmpeg to decode the video is as follows:
93+
```bash
94+
mkdir -p sample_videos_0
95+
ffmpeg -i /path/to/input/video0.mp4 -vsync 0 sample_videos_0/frame_%04d.jpg
96+
97+
mkdir -p sample_videos_1
98+
ffmpeg -i /path/to/input/video1.mp4 -vsync 0 sample_videos_1/frame_%04d.jpg
99+
```
100+
56101
### Roadmap
57102
The library is used as a part of our WebRTC implementation. Please refer to that [roadmap](https://github.com/pion/webrtc/issues/9) to track our major milestones.
58103

go.mod

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
module github.com/pion/bwe-test
22

3-
go 1.21
3+
go 1.24
44

55
toolchain go1.25.1
66

77
require (
8+
github.com/bamiaux/rez v0.0.0-20170731184118-29f4463c688b
89
github.com/pion/interceptor v0.1.41
910
github.com/pion/logging v0.2.4
1011
github.com/pion/mediadevices v0.7.2
@@ -16,24 +17,21 @@ require (
1617
golang.org/x/sync v0.11.0
1718
)
1819

19-
require (
20-
github.com/pion/dtls/v3 v3.0.7 // indirect
21-
github.com/pion/ice/v4 v4.0.10 // indirect
22-
github.com/pion/mdns/v2 v2.0.7 // indirect
23-
github.com/pion/srtp/v3 v3.0.7 // indirect
24-
github.com/pion/stun/v3 v3.0.0 // indirect
25-
github.com/pion/turn/v4 v4.1.1 // indirect
26-
github.com/wlynxg/anet v0.0.5 // indirect
27-
)
28-
2920
require (
3021
github.com/davecgh/go-spew v1.1.1 // indirect
3122
github.com/google/uuid v1.6.0 // indirect
3223
github.com/pion/datachannel v1.5.10 // indirect
24+
github.com/pion/dtls/v3 v3.0.7 // indirect
25+
github.com/pion/ice/v4 v4.0.10 // indirect
26+
github.com/pion/mdns/v2 v2.0.7 // indirect
3327
github.com/pion/randutil v0.1.0 // indirect
3428
github.com/pion/sctp v1.8.39 // indirect
3529
github.com/pion/sdp/v3 v3.0.15 // indirect
30+
github.com/pion/srtp/v3 v3.0.7 // indirect
31+
github.com/pion/stun/v3 v3.0.0 // indirect
32+
github.com/pion/turn/v4 v4.1.1 // indirect
3633
github.com/pmezard/go-difflib v1.0.0 // indirect
34+
github.com/wlynxg/anet v0.0.5 // indirect
3735
golang.org/x/crypto v0.33.0 // indirect
3836
golang.org/x/image v0.23.0 // indirect
3937
golang.org/x/net v0.35.0 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
github.com/bamiaux/rez v0.0.0-20170731184118-29f4463c688b h1:5Ci5wpOL75rYF6RQGRoqhEAU6xLJ6n/D4SckXX1yB74=
2+
github.com/bamiaux/rez v0.0.0-20170731184118-29f4463c688b/go.mod h1:obBQGGIFbbv9KWg92Qu9UHeD94JXmHD1jovY/z6I3O8=
13
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
24
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
35
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=

0 commit comments

Comments
 (0)