From 9c724dc729891ec192f3fd6567666f1de7ebaa49 Mon Sep 17 00:00:00 2001
From: DenizUgur
Date: Sun, 17 Jul 2022 00:57:53 -0700
Subject: [PATCH] small updates
---
demo/encode.sh | 63 ++++++++++++++++++++++++++++++++++++++++++
demo/encodefordemo.sh | 20 --------------
demo/index.html | 1 +
demo/run.sh | 1 -
scripts/server.sh | 8 ++++--
server/app/src/Demo.js | 2 +-
simulator/.env | 2 +-
simulator/client.js | 4 +--
8 files changed, 73 insertions(+), 28 deletions(-)
create mode 100755 demo/encode.sh
delete mode 100755 demo/encodefordemo.sh
delete mode 100755 demo/run.sh
diff --git a/demo/encode.sh b/demo/encode.sh
new file mode 100755
index 0000000..fe4b46d
--- /dev/null
+++ b/demo/encode.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+SOURCE=$(realpath $1)
+
+GOP_SIZE=60
+PRESET_P=ultrafast
+V_SIZE=1280x720
+
+START_OFFSET=180
+DURATION=90
+
+../FFmpeg/bin/ffmpeg -i $SOURCE/match.mp4 \
+ -ss $START_OFFSET \
+ -c:v libx264 -keyint_min $GOP_SIZE -g $GOP_SIZE -pix_fmt yuv420p -r 30 \
+ -t $DURATION \
+ -map v:0 -s:0 $V_SIZE \
+ -init_seg_name init\$RepresentationID\$.\$ext\$ -media_seg_name chunk\$RepresentationID\$-\$Number%05d\$.\$ext\$ \
+ -adaptation_sets "id=0,streams=v" \
+ -use_template 1 -use_timeline 0 \
+ -frag_type every_frame \
+ -seg_duration 10 \
+ -preset ultrafast \
+ -f dash videos/match/video.mpd
+
+../FFmpeg/bin/ffmpeg -i $SOURCE/match.mp4 \
+ -ss $START_OFFSET \
+ -c:v libx264 -keyint_min $GOP_SIZE -g $GOP_SIZE -pix_fmt yuv420p -r 30 \
+ -t $DURATION \
+ -vf "sa=snooker:3" \
+ -map v:0 -s:0 $V_SIZE \
+ -init_seg_name init\$RepresentationID\$.\$ext\$ -media_seg_name chunk\$RepresentationID\$-\$Number%05d\$.\$ext\$ \
+ -adaptation_sets "id=0,streams=v" \
+ -use_template 1 -use_timeline 0 \
+ -frag_type every_frame \
+ -seg_duration 10 \
+ -preset ultrafast \
+ -f dash videos/match-visualized/video.mpd
+
+../FFmpeg/bin/ffmpeg -i $SOURCE/match2.mp4 \
+ -ss $START_OFFSET \
+ -c:v libx264 -keyint_min $GOP_SIZE -g $GOP_SIZE -pix_fmt yuv420p -r 30 \
+ -t $DURATION \
+ -map v:0 -s:0 $V_SIZE \
+ -init_seg_name init\$RepresentationID\$.\$ext\$ -media_seg_name chunk\$RepresentationID\$-\$Number%05d\$.\$ext\$ \
+ -adaptation_sets "id=0,streams=v" \
+ -use_template 1 -use_timeline 0 \
+ -frag_type every_frame \
+ -seg_duration 10 \
+ -preset ultrafast \
+ -f dash videos/match2/video.mpd
+
+../FFmpeg/bin/ffmpeg -i $SOURCE/match2.mp4 \
+ -ss $START_OFFSET \
+ -c:v libx264 -keyint_min $GOP_SIZE -g $GOP_SIZE -pix_fmt yuv420p -r 30 \
+ -t $DURATION \
+ -vf "sa=snooker:3" \
+ -map v:0 -s:0 $V_SIZE \
+ -init_seg_name init\$RepresentationID\$.\$ext\$ -media_seg_name chunk\$RepresentationID\$-\$Number%05d\$.\$ext\$ \
+ -adaptation_sets "id=0,streams=v" \
+ -use_template 1 -use_timeline 0 \
+ -frag_type every_frame \
+ -seg_duration 10 \
+ -preset ultrafast \
+ -f dash videos/match2-visualized/video.mpd
diff --git a/demo/encodefordemo.sh b/demo/encodefordemo.sh
deleted file mode 100755
index 0b11919..0000000
--- a/demo/encodefordemo.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-SOURCE=$(realpath $1)
-GOP_SIZE=60
-PRESET_P=ultrafast
-V_SIZE=1280x720
-
-START_OFFSET=180
-DURATION=90
-
-../FFmpeg/bin/ffmpeg -i $SOURCE \
- -ss $START_OFFSET \
- -c:v libx264 -keyint_min $GOP_SIZE -g $GOP_SIZE -pix_fmt yuv420p -r 30 \
- -t $DURATION \
- -map v:0 -s:0 $V_SIZE \
- -init_seg_name init\$RepresentationID\$.\$ext\$ -media_seg_name chunk\$RepresentationID\$-\$Number%05d\$.\$ext\$ \
- -adaptation_sets "id=0,streams=v" \
- -use_template 1 -use_timeline 0 \
- -frag_type every_frame \
- -seg_duration 10 \
- -preset ultrafast \
- -f dash videos/$2/video.mpd
\ No newline at end of file
diff --git a/demo/index.html b/demo/index.html
index 1818873..ba348d6 100644
--- a/demo/index.html
+++ b/demo/index.html
@@ -30,6 +30,7 @@
Automated Adaptive Playback for Encoder-Adjudicated Live Sports
Read the MIPR'22 paper here
+
Checkout the GitHub repository with Docker image ready to test the system
diff --git a/demo/run.sh b/demo/run.sh
deleted file mode 100755
index ebf4ca7..0000000
--- a/demo/run.sh
+++ /dev/null
@@ -1 +0,0 @@
-python3 -m http.server 8080
\ No newline at end of file
diff --git a/scripts/server.sh b/scripts/server.sh
index 72a0a0a..88eaee3 100755
--- a/scripts/server.sh
+++ b/scripts/server.sh
@@ -1,9 +1,11 @@
#!/bin/bash
-BASE=$(pwd)
+BASE=$(dirname $0)
+
+NGINX_CONF=$(realpath $BASE/../config/nginx.dev.conf)
# Start NGINX
nginx -s stop >/dev/null 2>&1
-nginx -c $BASE/config/nginx.dev.conf
+nginx -c $NGINX_CONF
# Start React
-BROWSER=none npm --prefix $BASE/server/app run start
+BROWSER=none npm --prefix $BASE/../server/app run start
diff --git a/server/app/src/Demo.js b/server/app/src/Demo.js
index 9b828cd..d82fc68 100644
--- a/server/app/src/Demo.js
+++ b/server/app/src/Demo.js
@@ -102,7 +102,7 @@ export default function Demo() {
-
Desnity (0-2)
+
Density (0-2)
{
return status >= 200 && status < 500;
@@ -232,7 +232,7 @@ async function worker() {
// Start the browser
const browser = await puppeteer.launch({
- headless: false,
+ headless: true,
executablePath:
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
args: ["--window-size=840,525", "--window-position=840,0"],