Skip to content

Commit

Permalink
feat: video support with full redesign
Browse files Browse the repository at this point in the history
fixes: #38 #40 #41 #42

Redesigned the database.
- Switched to UUID from Auto Incrementing Numbers.
- Moved database types into API
- Switched to CockroachDB

Added RTMP server support:
- Decoding/Encoding RTMP chunks
- Working with RTMP commands, publish, play, ect...

Added MP4:
- Demuxing MP4 Atoms
- Muxing MP4 Atoms

Added FLV:
- FLV Demuxing
- Enhanced FLV Demuxing (AV1/VP9/HEVC)

Added H264 (AVC):
- Demuxing/Muxing Decoder Config
- Parsing SPS

Added H265 (HEVC):
- Demuxing/Muxing Decoder Config
- Parsing SPS

Added AV1:
- Demuxing/Muxing Decoder Config
- Parsing Sequence Header OBU

Added Transmuxer:
- Demux FLV
- Mux MP4

Added AMF0:
- Decoding/Encoding of AMF0 objects

Added exp-globmb:
- Encoding/Decoding of signed and unsigned integers.

Added Ingest:
- Ingest RTMP
- Manage stream state with gRPC API endpoints
- Request transcoders via NATS

Added Transcoder:
- Decode stream from gRPC Ingest
- Redis Backed State transcoding
- Graceful shutdown capabilities
  - When the transcoder is shutting down the transcoder will gracefully
    hand over control to a new transcoder. Without a discontinuity in
    the video.

Added Protobuf:
- Added protobuf services for API, Ingest, Transcoder, Edge.

Added WASM Player:
- Basic player which plays master and media playlists with LL-HLS
  Support.
- Does not have ABR
- Has multi track with graceful track switching
- Supports audio only tracks

The specs can be found here:
https://drive.google.com/drive/folders/100aM43bROBbYrETA0C-5392XTT5K664e?usp=sharing
  • Loading branch information
TroyKomodo committed May 22, 2023
1 parent 925d6a6 commit fbd105d
Show file tree
Hide file tree
Showing 539 changed files with 57,110 additions and 7,776 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[registries.crates-io]
protocol = "sparse"
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
Language: Proto
BasedOnStyle: Google
10 changes: 10 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[profile.default]
test-threads = "num-cpus"
slow-timeout = { period = "5s", terminate-after = 3 }

[test-groups]
serial = { max-threads = 1 }

[[profile.default.overrides]]
filter = 'test(serial)'
test-group = 'serial'
27 changes: 18 additions & 9 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ on:
paths:
- "**/Cargo.toml"
- "**/Cargo.lock"
- "**/yarn.lock"
- "**/pnpm-lock.yaml"
- "**/package.json"
push:
paths:
- "**/Cargo.toml"
- "**/Cargo.lock"
- "**/yarn.lock"
- "**/pnpm-lock.yaml"
- "**/package.json"
workflow_dispatch:
schedule:
Expand All @@ -27,17 +27,26 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions-rs/audit-check@v1
- name: Install Mask
run: |
curl -sL https://github.com/jacobdeichert/mask/releases/download/v0.11.3/mask-v0.11.3-x86_64-unknown-linux-gnu.zip -o mask.zip && \
unzip mask.zip && \
mv mask-v0.11.3-x86_64-unknown-linux-gnu/mask /usr/local/bin/mask && \
chmod +x /usr/local/bin/mask && \
rm -rf mask.zip mask-v0.11.3-x86_64-unknown-linux-gnu
- uses: pnpm/action-setup@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest

- name: Install Node
uses: actions/setup-node@v3
with:
cache: "yarn"
cache: "pnpm"
node-version: 18

- name: Yarn Audit
uses: borales/actions-yarn@v4
with:
cmd: audit
- name: Install dependencies
run: pnpm install

- name: Audit
run: mask audit
7 changes: 6 additions & 1 deletion .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ jobs:
with:
fetch-depth: 0

- uses: pnpm/action-setup@v2
with:
version: latest

- name: Setup Node
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: 18.x

- name: Install dependencies
run: yarn install
run: pnpm install

- name: Validate all commits from PR
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
52 changes: 39 additions & 13 deletions .github/workflows/lint-test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,37 +50,53 @@ jobs:
if: ${{ needs.should_run.outputs.should-run == 'true' }}
environment: ${{ (github.ref != 'refs/heads/main' && github.ref != 'refs/heads/feature/*' && github.event_name != 'workflow_dispatch') && 'lint-test-build' || '' }}
services:
postgres:
image: postgres:15.2
cockroach:
image: ghcr.io/scuffletv/cockroach:latest
ports:
- 26257:26257
rmq:
image: bitnami/rabbitmq:latest
ports:
- 5672:5672
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
RABBITMQ_USERNAME: rabbitmq
RABBITMQ_PASSWORD: rabbitmq
RABBITMQ_VHOSTS: scuffle
redis:
image: redis:latest
ports:
- 5432:5432

- 6379:6379
env:
DATABASE_URL: postgres://postgres:postgres@postgres:5432/scuffle
DATABASE_URL: postgres://root@cockroach:26257/scuffle
RMQ_URL: amqp://rabbitmq:rabbitmq@rmq:5672/scuffle
REDIS_URL: redis://redis:6379

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: pnpm/action-setup@v2
with:
version: latest

- name: Install Node
uses: actions/setup-node@v3
with:
cache: "yarn"
cache: "pnpm"
node-version: 18

- name: Setup Terraform
uses: hashicorp/setup-terraform@v2

- name: Cargo Cache
uses: Swatinem/rust-cache@v2
continue-on-error: false
with:
prefix-key: lint-test

- name: Install dependencies
run: mask bootstrap --no-db --no-docker --no-env --no-stack --no-rust
run: mask bootstrap --no-db --no-docker --no-env --no-rust

- name: Run migrations
run: mask db migrate
Expand All @@ -89,7 +105,7 @@ jobs:
run: mask lint

- name: Run Test Rust
run: mask test --no-js
run: mask test --no-js --ci

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand All @@ -98,6 +114,9 @@ jobs:
files: lcov.info
fail_ci_if_error: true

- name: Install Playwright Dependencies
run: pnpm --filter website exec playwright install-deps

- name: Run Test JavaScript
run: mask test --no-rust

Expand All @@ -112,10 +131,14 @@ jobs:
with:
fetch-depth: 0

- uses: pnpm/action-setup@v2
with:
version: latest

- name: Setup Node
uses: actions/setup-node@v3
with:
cache: "yarn"
cache: "pnpm"
node-version: 18

- name: Cargo Cache
Expand All @@ -125,7 +148,7 @@ jobs:
prefix-key: build

- name: Install dependencies
run: mask bootstrap --no-db --no-docker --no-env --no-js-tests --no-stack --no-rust
run: mask bootstrap --no-db --no-docker --no-env --no-js-tests --no-rust

- name: Run Build
run: mask build
Expand All @@ -141,6 +164,9 @@ jobs:
target/x86_64-unknown-linux-gnu/release/edge
target/x86_64-unknown-linux-gnu/release/transcoder
frontend/website/build
frontend/player/dist
frontend/player/pkg
frontend/player/demo-dist
docker:
name: Build docker images
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ target/
!.vscode/extensions.json
node_modules/
.env*
dev-stack/docker-compose.yml
*.log
.DS_Store
*.lcov
Expand Down
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Loading

0 comments on commit fbd105d

Please sign in to comment.