summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2022-10-23 08:32:19 -0400
committerSacha Chua <sacha@sachachua.com>2022-10-23 08:32:19 -0400
commit8637995c0f20672553c192907a36d3c8519b61d4 (patch)
tree7b794998d2b125d719c939c98f1aeeeef0ebdbf9
parent8929a1ce7bd8afb9da6a34443b71c2816c40c680 (diff)
downloademacsconf-ansible-8637995c0f20672553c192907a36d3c8519b61d4.tar.xz
emacsconf-ansible-8637995c0f20672553c192907a36d3c8519b61d4.zip
Stream test
-rw-r--r--README.org6
-rw-r--r--roles/stream/tasks/main.yml11
-rw-r--r--roles/stream/templates/emacsconf.nginx.conf4
3 files changed, 13 insertions, 8 deletions
diff --git a/README.org b/README.org
index ad335d0..fcf411a 100644
--- a/README.org
+++ b/README.org
@@ -150,13 +150,13 @@ ansible-playbook -i inventory.yml prod-playbook.yml --tags stream
Test with a file:
-ansible-playbook -i inventory.yml prod-playbook.yml --tags test-stream-file -e icecast_test=~/code/emacsconf-2021-emacs-news-highlights/full.webm -e icecast_test_track=dev
+ansible-playbook -i inventory.yml prod-playbook.yml --tags test-stream-file -e icecast_test=~/code/emacsconf-2021-emacs-news-highlights/full.webm -e icecast_test_track=dev
Play the stream with MPV:
-ansible-playbook -i inventory.yml prod-playbook.yml --tags test-stream-mpv -e icecast_test_track=dev
+ansible-playbook -i inventory.yml prod-playbook.yml --tags test-stream-mpv -e icecast_test_track=dev -e test=mpv
-ansible-playbook -i inventory.yml prod-playbook.yml --tags test-stream-pattern -e icecast_test_track=dev
+ansible-playbook -i inventory.yml prod-playbook.yml --tags test-stream-pattern -e icecast_test_track=dev -e test=pattern
* Captioning
Set up whisper
diff --git a/roles/stream/tasks/main.yml b/roles/stream/tasks/main.yml
index b5ebcda..7cabb6b 100644
--- a/roles/stream/tasks/main.yml
+++ b/roles/stream/tasks/main.yml
@@ -39,14 +39,19 @@
when: port_check.failed == true
- name: Test by streaming from a file
tags: test-stream-file, never
- local_action: shell ffmpeg -loglevel 32 -i {{ icecast_test }} -cluster_size_limit 2M -cluster_time_limit 5100 -content_type video/webm -c:v libvpx -b:v 1M -crf 30 -g 125 -deadline good -threads 4 -f webm icecast://emacsconf:{{ icecast_emacsconf_password }}@live0.emacsconf.org:{{ icecast_port }}/emacsconf/{{ icecast_test_track|d("gen") }}.webm
+ block:
+ - debug:
+ msg: ffmpeg -loglevel 32 -re -i {{ icecast_test }} -loop 1 -f webm -r 30 -ac 2 -cluster_size_limit 2M -cluster_time_limit 5100 -content_type video/webm -c:v libvpx -b:v 1M -crf 30 -g 125 -threads 4 -deadline realtime icecast://emacsconf:{{ icecast_emacsconf_password }}@live0.emacsconf.org:{{ icecast_port }}/emacsconf/{{ icecast_test_track|d("gen") }}.webm
+ - local_action: shell ffmpeg -re -loglevel 32 -i {{ icecast_test }} -loop 1 -f webm -r 30 -ac 2 -cluster_size_limit 2M -cluster_time_limit 5100 -content_type video/webm -c:v libvpx -b:v 1M -crf 30 -g 125 -threads 4 -deadline realtime icecast://emacsconf:{{ icecast_emacsconf_password }}@live0.emacsconf.org:{{ icecast_port }}/emacsconf/{{ icecast_test_track|d("gen") }}.webm
when: icecast_test is defined
- name: Test by displaying the stream in mpv
tags: test-stream-mpv, never
- local_action: shell mpv http://live0.emacsconf.org:{{ icecast_port }}/emacsconf/{{ icecast_test_track|d(gen) }}.webm
+ local_action: shell mpv http://live0.emacsconf.org:{{ icecast_port }}/emacsconf/{{ icecast_test_track|d("gen") }}.webm
+ when: test is defined and test == 'mpv'
- name: Test by streaming a test pattern
- tags: test-stream-pattern, never
+ tags: test-stream-pattern
local_action: shell ffmpeg -loglevel 32 -f lavfi -i testsrc=duration=10:size=1280x720:rate=30 -f webm icecast://emacsconf:{{ icecast_emacsconf_password }}@live0.emacsconf.org:{{ icecast_port }}/emacsconf/{{ icecast_test_track|d("gen") }}.webm
+ when: test is defined and test == 'pattern'
# - name: Set up restream script
# template:
# src: restream-yt.sh
diff --git a/roles/stream/templates/emacsconf.nginx.conf b/roles/stream/templates/emacsconf.nginx.conf
index 235a661..57570e9 100644
--- a/roles/stream/templates/emacsconf.nginx.conf
+++ b/roles/stream/templates/emacsconf.nginx.conf
@@ -1,8 +1,8 @@
-location /emacsconf {
+location /emacsconf/ {
try_files $uri $uri/ @emacsconf_upstream;
}
location @emacsconf_upstream {
- proxy_pass http://localhost:{{ icecast_port }};
+ proxy_pass http://localhost:{{ icecast_port }}/emacsconf/;
proxy_http_version 1.1;
proxy_buffering off;
proxy_request_buffering off;