Bài đăng

Đang hiển thị bài đăng từ Tháng 11, 2017

Module ngx_http_hls_module

Hình ảnh
The  ngx_http_hls_module  module provides HTTP Live Streaming (HLS) server-side support for MP4 and MOV media files. Such files typically have the  .mp4 ,  .m4v ,  .m4a ,  .mov , or  .qt  filename extensions. The module supports H.264 video codec, AAC and MP3 audio codecs. For each media file, two URIs are supported: A playlist URI with the “ .m3u8 ” filename extension. The URI can accept optional arguments: “ start ” and “ end ” define playlist boundaries in seconds (1.9.0). “ offset ” shifts an initial playback position to the time offset in seconds (1.9.0). A positive value sets a time offset from the beginning of the playlist. A negative value sets a time offset from the end of the last fragment in the playlist. “ len ” defines the fragment length in seconds. A fragment URI with the “ .ts ” filename extension. The URI can accept optional arguments: “ start ” and “ end ” define fragment boundaries in seconds. This mo...

Vấn đề bảo mật link khi LIVE STREAM trong NGINX-RTMP

http { server { listen 8080; server_name localhost; location /on_play { # set connection secure link secure_link $arg_st,$arg_e; secure_link_md5 mysecretkey$arg_app/$arg_name$arg_e; # bad hash if ($secure_link = "") { return 501; } # link expired if ($secure_link = "0") { return 502; } return 200; } } } rtmp { server { listen 1935; # protected application application myapp { live on; on_play http://localhost:8080/on_play; } } } With the above configuration you cannot play any stream from  myapp  application without providing the right secure link. > ffplay 'rtmp://localhost/myapp/mystream' ffplay version 1.0.6 Copyright (c) 2003-2013 the FFmpeg developers ... rtmp://localhost/myapp/mystream:...

Hướng dẫn Config Nginx-RTMP + Adaptive Streams

Hình ảnh
240p Chậm tương đương với  288kbps 480p Chuẩn tương đương với 448kbps 540p Chuẩn tương đương với 1152kbps 720p Cao tương đương với  2048kbps Source resolution, source bitrate Để giải quyết chuyện đó thì dưới đây sẽ cõ một ví dụ về cấu hình Nginx Cấu hình Nginx 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 worker_processes   auto ; events {      # Allows up to 1024 connections, can be adjusted      worker _ connections    1024 ; } # RTMP configuration rtmp {      server {          listen 1935 ; # Listen ...