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
| proxy_cache_path /tmp/cacheapi levels=1:2 keys_zone=microcacheapi:100m max_size=1g inactive=1d use_temp_path=off; | |
| server { | |
| listen 443 ssl http2 default_server; | |
| listen [::]:443 ssl http2 default_server; | |
| server_name example.com; | |
| location /api/ { | |
| # Rate Limiting | |
| limit_req zone=reqlimit burst=20; # Max burst of request |
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:
FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.
Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:
ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4
Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.
| http { | |
| log_format bodylog '$remote_addr - $remote_user [$time_local] ' | |
| '"$request" $status $body_bytes_sent ' | |
| '"$http_referer" "$http_user_agent" $request_time ' | |
| '<"$request_body" >"$resp_body"'; | |
| lua_need_request_body on; | |
| set $resp_body ""; | |
| body_filter_by_lua ' |
| # Convert the .cer file into a .pem file: | |
| $ openssl x509 -in aps_development.cer -inform der -out PushChatCert.pem | |
| # Convert the private key’s .p12 file into a .pem file: | |
| $ openssl pkcs12 -nocerts -in PushChatKey.p12 -out PushChatKey.pem | |
| # Finally, combine the certificate and key into a single .pem file | |
| $ cat PushChatCert.pem PushChatKey.pem > ck.pem | |
| # At this point it’s a good idea to test whether the certificate works. |
Other people's projects:
My projects (tutorials are on my blog at http://maxoffsky.com):