How to Remove Client Headers in Nginx before passing request to upstream server?

The proxy_set_header HEADER “” does exactly what you expect. See https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_set_header. If the value of a header field is an empty string then this field will not be passed to a proxied server: proxy_set_header Accept-Encoding “”; I have just confirmed this is working as documented, I used Nginx v1.12.

Is it possible to cache HLS segments with AVPlayer?

Let’s start with really good news – iOS 10 and up – gives this out of the box. No more need for hacks soon. More details can be found in the following WWDC16 session about whats new in HTTP Live Streaming: https://developer.apple.com/videos/play/wwdc2016/504/ Now back to the current state of things – iOS 9 and lower: … Read more

How can I get the actual video URL of a YouTube live stream?

You need to get the HLS m3u8 playlist files from the video’s manifest. There are ways to do this by hand, but for simplicity I’ll be using the youtube-dl tool to get this information. I’ll be using this live stream as an example: https://www.youtube.com/watch?v=_Gtc-GtLlTk First, get the formats of the video: ➜ ~ youtube-dl –list-formats … Read more

Implementation of HTTP Live Streaming in iOS

A short and to the point implementation. The included URL points to a valid stream (as of 12/15/2015), but you can just replace with your own URL to a .m3u8 file. Objective-C: #import <MediaPlayer/MediaPlayer.h> @interface ViewController () @property (strong, nonatomic) MPMoviePlayerController *streamPlayer; @end @implementation ViewController – (void)viewDidLoad { [super viewDidLoad]; NSURL *streamURL = [NSURL URLWithString:@”http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8″]; … Read more

HTTP LIve Streaming

HTTP Live Streaming HTTP Live Streaming is a streaming standard proposed by Apple. See the latest draft standard. Files involved are .m4a for audio (if you want a stream of audio only). .ts for video. This is a MPEG-2 transport, usually with a h.264/AAC payload. It contains 10 seconds of video and it is created … Read more

Transcoding fMP4 to HLS while writing on iOS using FFmpeg

Strictly speaking you don’t need to transcode the fmp4 if it contains h264+aac, you just need to repackage the sample data as TS. (using ffmpeg -codec copy or gpac) Wrt. alignment (1.2) I suppose this all depends on your encoder settings (frame rate, sample rate and GOP size). It is certainly possible to make sure … Read more

How to minimize the delay in a live streaming with ffmpeg

I found three commands that helped me reduce the delay of live streams. The first command its very basic and straight forward, the second one it’s been combined with other options which might work differently on each environment and the last command it is a hacky version that I found in the documentation It was … Read more