HTTP RANGE when a target file is being written

117 Views Asked by At

I want to organize a live video streaming via HTTP RANGE (HLS isn't suitable for my purposes) from files on my streaming server are recorded at the time of the request. On the server side I use the following header:

header('HTTP/1.1 206 Partial Content');
header("Content-Type: video/mpeg");
header('Content-Length: '.($seek_end - $seek_start));
header('Content-Range: bytes '.$seek_start.'-'.$seek_end.'/'.$size);

When I requested a file via ffplay or vlc it's playing good, but stoped at the moment when file has been requested. I tried artificially increase a $size, but situation has not changed, only saw Stream ends prematurely errors in ffplay log:

[http @ 0x7f30a40079e0] Stream ends prematurely at 34156620, should be 35180908
[http @ 0x7f30a40079e0] Stream ends prematurely at 33656620, should be 35443052
[http @ 0x7f30a40079e0] Stream ends prematurely at 32656620, should be 35705196

How can I organized a live video streaming via http from files on my streaming server are recorded at the time of the request? Any suggestion will be helpful.

0

There are 0 best solutions below