This example is part of this article.
This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:
- Domain filtering
- Referrer filtering
- Embed buster
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet"> | |
<script src="http://code.jquery.com/jquery.js"></script> | |
<script src="https://rawgithub.com/caolan/async/master/lib/async.js"></script> | |
<script src="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script> | |
<script> | |
window.URL = window.URL || window.webkitURL; | |
#!/bin/bash | |
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04 | |
# Inspired from https://gist.github.com/faleev/3435377 | |
# Remove any existing packages: | |
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev | |
# Get the dependencies (Ubuntu Server or headless users): | |
sudo apt-get update |
<?php | |
error_reporting(E_ALL & ~E_NOTICE); | |
ini_set('display_errors', 1); | |
$_HTTP = !empty($_SERVER['HTTPS']) ? 'https://' : 'http://'; | |
// change this by country (gls-hungary.com, gls-slovakia.sk, gls-czech.com, gls-romania.ro, gls-slovenia.com, gls-croatia.com) | |
$wsdl_path = $_HTTP.'online.gls-slovakia.sk'.'/webservices/soap_server.php?wsdl&ver=14.11.03.01'; | |
$client = new SoapClient($wsdl_path); |
sudo apt-get update -y | |
sudo apt-get install -y nginx | |
sudo apt-get install -y python-software-properties | |
sudo add-apt-repository -y ppa:ondrej/php | |
sudo apt-get update -y | |
sudo apt-get install -y php7.1 php7.1-fpm php7.1-cli php7.1-common php7.1-mbstring php7.1-gd php7.1-intl php7.1-xml php7.1-mysql php7.1-mcrypt php7.1-zip | |
sudo apt-get install php-curl |
sudo apt-get update -y | |
sudo apt-get install -y nginx | |
sudo apt-get install -y python-software-properties | |
sudo add-apt-repository -y ppa:ondrej/php | |
sudo apt-get update -y | |
sudo apt-get install -y php7.1 php7.1-fpm php7.1-cli php7.1-common php7.1-mbstring php7.1-gd php7.1-intl php7.1-xml php7.1-mysql php7.1-mcrypt php7.1-zip | |
sudo apt-get install php-curl |
server { | |
listen 80; | |
server_name localhost; | |
root /Users/YOUR_USERNAME/Sites; | |
access_log /Library/Logs/default.access.log main; | |
location / { | |
include /usr/local/etc/nginx/conf.d/php-fpm; | |
} |
ssh -i your_key.pem ec2-user@YOUR_EC2_IP | |
sudo yum-config-manager --add-repo https://openresty.org/package/amazon/openresty.repo | |
sudo yum install openresty | |
sudo yum install openresty-resty | |
# if https://openresty.org/package/amazon/2/x86_64/repodata/repomd.xml: \[Errno 14\] HTTPS Error 404 - Not Found | |
# sudo vim /etc/yum.repos.d/openresty.repo | |
# exchange the $releasever placeholder of the baseurl to “latest” baseurl=https://openresty.org/package/amazon/latest/$basearch. |
... | |
Beautifier.prototype.beautify = function() { | |
... | |
var source_text = this._source_text; | |
// BEGIN | |
source_text = source_text.replace(/\{\{(--)?((?:(?!(--)?\}\}).)+)(--)?\}\}/g, function(m, ds, c, dh, de) { |
This example is part of this article.
This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:
Streaming your Linux desktop to Youtube and Twitch via Nvidia's NVENC and VAAPI:
Considerations to take when live streaming:
The following best practice observations apply when using a hardware-based encoder for live streaming to any platform:
Set the buffer size (-bufsize:v
) equal to the target bitrate (-b:v
). You want to ensure that you're encoding in CBR mode.
Set up the encoders as shown: