apiVersion: v1 kind: ConfigMap metadata: namespace: {{ namespace }} name: nginx-streamer-{{ worker.name }} labels: app: nginx type: streamer worker: {{ worker.name }} data: nginx.conf: | worker_processes 4; pid /srv/nginx.pid; error_log /dev/stderr notice; load_module modules/ngx_rtmp_module.so; events { worker_connections 768; # multi_accept on; } http { sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; server_names_hash_bucket_size 64; include /etc/nginx/mime.types; default_type application/octet-stream; access_log /dev/null; server { listen 8000 default_server; listen [::]:8000 default_server; server_name _; root /srv/www; location / { types { application/vnd.apple.mpegurl m3u8; } expires -1s; add_header Cache-Control "no-store,must-revalidate,max-age=0"; } } } rtmp { access_log /dev/null; server { listen localhost:1935; respawn on; exec_static ffmpeg -i http://flumotion-worker-{{ worker.name }}:8000/av-orig-flash-mini.flv -acodec copy -vcodec copy -vbsf h264_mp4toannexb -f flv rtmp://localhost/hls/av-orig-mini -acodec copy -vcodec copy -vbsf h264_mp4toannexb -f flv rtmp://localhost/dash/av-orig-mini; exec_static ffmpeg -i http://flumotion-worker-{{ worker.name }}:8000/av-orig-flash-low.flv -acodec copy -vcodec copy -vbsf h264_mp4toannexb -f flv rtmp://localhost/hls/av-orig-low -acodec copy -vcodec copy -vbsf h264_mp4toannexb -f flv rtmp://localhost/dash/av-orig-low; exec_static ffmpeg -i http://flumotion-worker-{{ worker.name }}:8000/av-orig-flash-medium.flv -acodec copy -vcodec copy -vbsf h264_mp4toannexb -f flv rtmp://localhost/hls/av-orig-medium -acodec copy -vcodec copy -vbsf h264_mp4toannexb -f flv rtmp://localhost/dash/av-orig-medium; exec_static ffmpeg -i http://flumotion-worker-{{ worker.name }}:8000/av-orig-flash-high.flv -acodec copy -vcodec copy -vbsf h264_mp4toannexb -f flv rtmp://localhost/hls/av-orig-high -acodec copy -vcodec copy -vbsf h264_mp4toannexb -f flv rtmp://localhost/dash/av-orig-high; application hls { live on; hls on; hls_path /srv/www/hls; hls_fragment 3; hls_playlist_length 12; hls_nested on; hls_cleanup on; hls_fragment_naming timestamp; hls_fragment_slicing aligned; hls_type live; hls_base_url http://localhost:8000/hls/; hls_variant -mini BANDWIDTH=350000; hls_variant -low BANDWIDTH=700000; hls_variant -medium BANDWIDTH=1200000; hls_variant -high BANDWIDTH=2000000; } application dash { live on; dash on; dash_path /srv/www/dash; dash_fragment 3; dash_playlist_length 12; dash_nested on; dash_cleanup on; } } }