And streaming video CBR doesn't solve the problem of some braindead renderers seeking to the end of the file for no particular reason because you tell it where the end is.
This completely egregious behavior is what we found on some of the android phones (the note 1 was the first we ran into) when we tried to stream video to them over Gizmo.
It must have something to do with the flavor the vendor put on the phone because it doesn't seem to matter what version of android from the vendor is running you get the same behavior but when you switch to cyanogen, viola it works. It seems to me that the vendor is trying to prevent streaming from apps not under it's control.
Hi bob,
Brain dead on one hand... and trying to be too smart on the other... definitely not a good mix
But seriously though. I have seen such renderers too on the audio side. First they do a GET at the start of the stream. Then they do a GET at the end of the stream. And then finally they do the real GET to download the stream. I think that the motivation of the first GET is to 1) establish that the stream is servable, and 2) to establish the mime type, content length, and accept range capabilities from the headers. And I think that the motivation of the second GET is to 3) establish that the stream is more or less as long as it was originally claimed to be in 2), and 4) prove that byte range seeks are indeed possible, and 5) (possibly) pull in any existing ID3 tags (or DRM stuff) attached to the end of the file. Then (obviously) the motivation of the third GET is to -- well -- get the actual stream...
Notwithstanding the above, I don't really understand why so many renderers follow this odd behaviour, but I suppose it is because somebody once published a library that does this, and none of the renderer manufacturers can be bothered, (nor have any know how), to do anything different than what that original somebody wrote in their library...
But in any case, from my experience, if your are a server, (which you are), the
most important thing is for you to ensure that
neither the first GET nor the second GET shall fail. This means these calls must return a 200 OK success code, and valid and appropriate HTTP headers. Then -- so long as you have passed those first two tests -- the third GET will be started to actually do the real business of downloading of the actual media stream content. And if you passed the first two tests, this third GET will normally succeed without too much hassle, and also any subsequent byte range GETs (within the content length) will probably also succeed without much hassle.
This is therefore the reason why Whitebear returns a phony content length slightly less than the actual calculated value -- just to make sure that the second GET can indeed succeed.
{ PS it is also my experience that on the first GET and on the second GET, the renderer usually kills the socket after the first few IP frames have been delivered (after around 10k bytes or so). Which confirms that both these two gets are basically more interested in the headers than in the contents. I won't say that you can get away with delivering garbage, but I think that returning audio / video silence would also be Ok }