Skip to content

Instantly share code, notes, and snippets.

@CharlesHolbrow
CharlesHolbrow / ffmpeg-hls.html
Created September 13, 2018 22:44
Example of ffmpeg for live hls streaming with hls.js
<!DOCTYPE html>
<html lang='`en'>
<head>
<meta charset='utf-8'/>
<title>Audio only stream example</title>
<script src="//cdn.jsdelivr.net/npm/hls.js@latest"></script>
<style>
video {
width: 640px;
height: 360px;
@mrbar42
mrbar42 / README.md
Last active May 22, 2024 19:06
Secured HLS setup with Nginx as media server

Secured HLS setup with Nginx as media server

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
@BackFront
BackFront / HTML5_player.html
Last active May 27, 2023 16:04
Pseudo Streaming MP4’s with PHP
<video controls="" width="400">
<source src="http://66.128.61.175/reel/1cc976948e74aa62f7a7fde16e64fb6b/360p" type="video/mp4">
Your browser does not support HTML5 video.
</video>
@riledhel
riledhel / gist:4e76868c496e11e773094b70fa566e0b
Created May 1, 2016 23:04
Encode HLS with ffmpeg and display using hls.js in a HTML5 page
$ ffmpeg -r 5 -i <INPUT_VIDEO> -map 0 -vcodec libx264 -f segment -segment_list out.m3u8
\ -segment_time 10 -segment_list_flags +live -segment_wrap 32 out%02d.ts
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://cdn.jsdelivr.net/hls.js/latest/hls.min.js"></script>
@seanhsu0102
seanhsu0102 / nginx_secure
Last active January 25, 2020 21:49
nginx secure link
# Nginx config example
```
location /asset {
secure_link $arg_md5,$arg_expires;
secure_link_md5 "secret$uri$arg_expires";
if ($secure_link = "") {
return 403;
}
@bftanase
bftanase / secure_link.php
Last active May 23, 2024 13:47
generate URL for nginx secure_link
@plentz
plentz / nginx.conf
Last active May 17, 2024 09:08
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@xtuaok
xtuaok / ts2mp4.rb
Last active January 7, 2020 00:31
TS encode script
#!/usr/bin/ruby
# -*- encoding: UTF-8 -*-
# AUDIO_CODEC=" -acodec copy -absf aac_adtstoasc"
AUDIO_CODEC=" -acodec libfaac -aq 110"
acodec = AUDIO_CODEC
file = File::expand_path( ARGV[0] )
out = ARGV[1]
exit 1 unless File.exist?(file)
@mikhailov
mikhailov / 0. nginx_setup.sh
Last active December 26, 2022 19:30
Nginx + secure pseudo-streaming
# Nginx can serve FLV/MP4 files by pseudo-streaming way without any specific media-server software.
# To do the custom build we use 2 modules: --with-http_secure_link_module --with-http_flv_module
# This module "secure-link" helps you to protect links from stealing away.
#
# NOTE: see more details at coderwall: http://coderwall.com/p/3hksyg
cd /usr/src
wget http://nginx.org/download/nginx-1.5.13.tar.gz
tar xzvf ./nginx-1.5.13.tar.gz && rm -f ./nginx-1.5.13.tar.gz