From 87be6b8740b099e715f040470a3f21313923abcd Mon Sep 17 00:00:00 2001 From: Tony Miller Date: Wed, 27 Dec 2023 20:29:55 -0800 Subject: [PATCH 1/3] add sync to s3 script for recordings --- nginx.conf | 6 ++++++ sync_to_s3.sh | 4 ++++ 2 files changed, 10 insertions(+) create mode 100755 sync_to_s3.sh diff --git a/nginx.conf b/nginx.conf index aed3ba5..f2dde81 100644 --- a/nginx.conf +++ b/nginx.conf @@ -133,6 +133,12 @@ rtmp { record all; record_path /home/www/video_recordings; record_suffix -%d-%b-%y-%T.flv; + + # on_record_done http://example.com/recorded; + + # convert recorded file to mp4 format + # exec_record_done ffmpeg -y -i $path -acodec libmp3lame -ar 44100 -ac 1 -vcodec libx264 $dirname/$basename.mp4; + exec_record_done ./sync_to_s3.sh $path } application vj { diff --git a/sync_to_s3.sh b/sync_to_s3.sh new file mode 100755 index 0000000..42d93f0 --- /dev/null +++ b/sync_to_s3.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +PATH=ARGV[1] +aws s3 cp $PATH s3://datafruitsvizdumps From 89c74a970f2f4bbe4413cc855cb3a0dcaf78afc8 Mon Sep 17 00:00:00 2001 From: Tony Miller Date: Mon, 10 Jun 2024 20:54:16 -0700 Subject: [PATCH 2/3] delete recording after upload --- sync_to_s3.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/sync_to_s3.sh b/sync_to_s3.sh index 42d93f0..2c7237f 100755 --- a/sync_to_s3.sh +++ b/sync_to_s3.sh @@ -2,3 +2,4 @@ PATH=ARGV[1] aws s3 cp $PATH s3://datafruitsvizdumps +rm $PATH From c935fe2cf6cf0ad5bc9c3be1bba1dc391635f18f Mon Sep 17 00:00:00 2001 From: Tony Miller Date: Mon, 10 Jun 2024 20:56:25 -0700 Subject: [PATCH 3/3] add aws cli to dockerfile --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e4a2978..d68b9ea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM ubuntu:18.04 RUN apt-get update RUN apt-get upgrade -y -RUN apt-get install -y build-essential libpcre3 libpcre3-dev libssl-dev unzip ffmpeg wget zlib1g zlib1g-dev libssl-dev sudo +RUN apt-get install -y build-essential libpcre3 libpcre3-dev libssl-dev unzip ffmpeg wget zlib1g zlib1g-dev libssl-dev sudo curl RUN useradd --create-home -s /bin/bash www ;\ adduser www sudo @@ -29,6 +29,11 @@ ADD crossdomain.xml /usr/local/nginx/html/crossdomain.xml ADD nginx.conf /home/www RUN sudo chown -R www:www /usr/local/nginx +# aws cli +RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" +RUN unzip -u awscliv2.zip +RUN sudo ./aws/install + EXPOSE 80 443 1935 CMD ["/usr/local/nginx/sbin/nginx", "-c", "/home/www/nginx.conf"]