This file contains hidden or 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
# make sure you have docker | |
git clone https://github.com/leandromoreira/nott.git | |
cd nott | |
git checkout 0.0.3 | |
# in a tab | |
make run | |
# wait until the platform is up and running | |
# and in another tab run |
This file contains hidden or 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
-- header_filter_by_lua_block | |
ngx.header['X-Metrics-upstream_response_time'] = ngx.var.upstream_response_time | |
ngx.header['X-Metrics-upstream_connect_time'] = ngx.var.upstream_connect_time | |
ngx.header['X-Metrics-request_time'] = ngx.var.request_time | |
ngx.header['X-Metrics-tcpinfo_rtt'] = ngx.var.tcpinfo_rtt | |
ngx.header['X-Metrics-time_iso8601'] = ngx.var.time_iso8601 |
This file contains hidden or 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
-- header_filter_by_lua_block | |
-- since we're going to change the content | |
-- we need to | |
ngx.header.content_length = nil | |
-- body_filter_by_lua_block | |
ngx.arg[1] = ngx.arg[1] .. "\n#COPYRIGHT: mysite.com" |
This file contains hidden or 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
local headers = ngx.req.get_headers() | |
if not string.find(headers["Referer"],"localhost") then | |
return ngx.exit(ngx.HTTP_FORBIDDEN) | |
end |
This file contains hidden or 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
if ngx.var.remote_addr == "192.168.0.253" then | |
return ngx.exit(ngx.HTTP_FORBIDDEN) | |
end |
This file contains hidden or 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
server { | |
location / { | |
proxy_cache my_cache; | |
proxy_cache_lock on; | |
proxy_pass http://backend; | |
access_by_lua_block { | |
local token = ngx.var.arg_token or ngx.var.cookie_superstition | |
if token ~= "token" then | |
return ngx.exit(ngx.HTTP_FORBIDDEN) |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>NOTT - The New OTT</title> | |
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/clappr@latest/dist/clappr.min.js"></script> | |
</head> | |
<body class="notstealenfromnetflix"> | |
<ul class="flex-container"> |
This file contains hidden or 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
http { | |
upstream backend { | |
server ingest; | |
} | |
server { | |
listen 8080; | |
location / { | |
proxy_cache my_cache; |
This file contains hidden or 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
rtmp { | |
server { | |
listen 1935; | |
application encoder { | |
live on; | |
exec ffmpeg -i rtmp://localhost:1935/encoder/$name | |
-c:v libx264 -b:v 750k -f flv -s 640x360 rtmp://localhost:1935/hls/$name_high | |
-c:v libx264 -b:v 400k -f flv -s 426x240 rtmp://localhost:1935/hls/$name_mid | |
-c:v libx264 -b:v 200k -f flv -s 426x240 rtmp://localhost:1935/hls/$name_low; | |
} |
This file contains hidden or 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
ffmpeg -f lavfi -i 'testsrc2=size=1280x720:rate=60,format=yuv420p' \ | |
-f lavfi -i 'sine=frequency=440:sample_rate=48000:beep_factor=4' \ | |
-c:v libx264 -preset ultrafast -tune zerolatency -profile:v high \ | |
-b:v 1400k -bufsize 2800k -x264opts keyint=120:min-keyint=120:scenecut=-1 \ | |
-c:a aac -b:a 32k -f flv rtmp://transcoder/encoder/colorbar |