forked from kixelated/moq-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also build the moq-pub image in this repo. (kixelated#116)
- Loading branch information
Showing
9 changed files
with
93 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
target | ||
dev | ||
*.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.DS_Store | ||
target/ | ||
logs/ | ||
*.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
app = "englishm-moq-relay" | ||
kill_signal = "SIGINT" | ||
kill_timeout = 5 | ||
|
||
[env] | ||
PORT = "4443" | ||
|
||
[experimental] | ||
cmd = "./fly-relay.sh" | ||
|
||
[[services]] | ||
internal_port = 4443 | ||
protocol = "udp" | ||
|
||
[services.concurrency] | ||
hard_limit = 25 | ||
soft_limit = 20 | ||
|
||
[[services.ports]] | ||
port = "4443" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
ADDR=${ADDR:-"https://relay.quic.video"} | ||
NAME=${NAME:-"bbb"} | ||
URL=${URL:-"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"} | ||
|
||
# Download the funny bunny | ||
wget -nv "${URL}" -O "${NAME}.mp4" | ||
|
||
# ffmpeg | ||
# -hide_banner: Hide the banner | ||
# -v quiet: and any other output | ||
# -stats: But we still want some stats on stderr | ||
# -stream_loop -1: Loop the broadcast an infinite number of times | ||
# -re: Output in real-time | ||
# -i "${INPUT}": Read from a file on disk | ||
# -vf "drawtext": Render the current time in the corner of the video | ||
# -an: Disable audio for now | ||
# -b:v 3M: Output video at 3Mbps | ||
# -preset ultrafast: Don't use much CPU at the cost of quality | ||
# -tune zerolatency: Optimize for latency at the cost of quality | ||
# -f mp4: Output to mp4 format | ||
# -movflags: Build a fMP4 file with a frame per fragment | ||
# - | moq-pub: Output to stdout and moq-pub to publish | ||
|
||
# Run ffmpeg | ||
ffmpeg \ | ||
-stream_loop -1 \ | ||
-hide_banner \ | ||
-v quiet \ | ||
-re \ | ||
-i "${NAME}.mp4" \ | ||
-vf "drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf:text='%{gmtime\: %H\\\\\:%M\\\\\:%S.%3N}':x=(W-tw)-24:y=24:fontsize=48:fontcolor=white:box=1:[email protected]" \ | ||
-an \ | ||
-b:v 3M \ | ||
-preset ultrafast \ | ||
-tune zerolatency \ | ||
-f mp4 \ | ||
-movflags empty_moov+frag_every_frame+separate_moof+omit_tfhd_offset \ | ||
- | moq-pub "${ADDR}/${NAME}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters