2010-12-28, 02:55 PM
I am developing a linux npvr client. For playback I use mplayer using streaming from http://server:8866/stream?f=... , but I have problem with seeking the media. The source of the problem seems to be that the server does not report Accept-Ranges: bytes unless a range is specified in the http request. As a result mplayer does not recognize the stream as seekable.
For example:
wget -S .... would give you:
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Server: N-PVR
Connection: Close
Content-Length: 1410023424
Content-Type: application/octet-stream
while wget -c -S .... on a partially downloaded file would give you.
HTTP/1.1 206 Partial Content
Server: N-PVR
Accept-Ranges: bytes
Content-Range: bytes 14557832-1410023424/1410023424
Content-Length: 1395465593
Content-Type: application/octet-stream
Connection: close
I do not know whether this is the proper behavior and mplayer is buggy or there is a bug in the NPVR server?
At the moment I solved the issue by hacking mplayer, but this does not seem a viable solution if the bug is indeed in the NPVR server.
For example:
wget -S .... would give you:
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Server: N-PVR
Connection: Close
Content-Length: 1410023424
Content-Type: application/octet-stream
while wget -c -S .... on a partially downloaded file would give you.
HTTP/1.1 206 Partial Content
Server: N-PVR
Accept-Ranges: bytes
Content-Range: bytes 14557832-1410023424/1410023424
Content-Length: 1395465593
Content-Type: application/octet-stream
Connection: close
I do not know whether this is the proper behavior and mplayer is buggy or there is a bug in the NPVR server?
At the moment I solved the issue by hacking mplayer, but this does not seem a viable solution if the bug is indeed in the NPVR server.