Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sync to s3 script for recordings #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"]
6 changes: 6 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 5 additions & 0 deletions sync_to_s3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

PATH=ARGV[1]
aws s3 cp $PATH s3://datafruitsvizdumps
rm $PATH