MJPEG(?),浏览器有多智能?
我正在尝试与这种类型的基于 IP 的摄像机进行交互:
这有两种检索视频源的方法:
第二个仅返回单个 JPG 文件。
然而,第一个是我想知道的。
如果我只是将浏览器指向该网址,它就会显示一个图像,该图像不断更新,实际上速度相当快,但该页面似乎永远不会像预期的那样停止下载。
我的问题是:浏览器会像考虑具有无限帧数的动画 gif 一样考虑这一点吗?意思是,它会缓存该图像并继续下载它,希望在某个时候它可以从头开始“播放”它吗?
简而言之,这会缓慢(或快速)填满我的浏览器内存和/或缓存吗?
我这样问是因为我想将此程序放在移动设备上,如果流被缓存,我根本无法做到这一点。使用快照图像,我可以简单地检索它并显示它,但我知道除了使用网络控件之外没有其他方法来显示流,因此我的问题。
我开始下载流源并暂停,然后查看它,这是 Google Chrome 临时文件的摘录:
--ipcamera^M Content-Type: image/jpeg^M Content-Length: 27958^M ^M
因此,在我看来它是 JPG 文件,但它不断更新,所以我认为这是 MJPEG?
I am trying to interface with a IP based camera, of this type:
This has two ways of retrieving the video feed:
- through http://ipaddress:188/videostream.cgi
- and through http://ipaddress:188/snapshot.cgi
The second simply returns a single JPG file.
The first, however, is the one I'm wondering about.
If I simply point my browser to that url, it shows an image, that keeps updating, quite fast actually, but the page never seems to stop downloading, as expected.
My question is this: Will the browser consider this in the same way it would consider an animated gif with an infinite number of frames? Meaning, will it cache this image and simply keep on downloading it, hoping at some point it can start "playing" it back from the beginning?
Simply put, will this slowly (or fast) fill up my browser memory and/or cache?
I'm asking because I'd like to put this program on a mobile device, and if the stream is cached, I simply can't do that. With the snapshot image I can simply retrieve it and display it, but I know of no other way to display the stream than to use a web control, and thus my question.
I started downloading the stream feed and paused it, and looked at it, and here's an excerpt from the Google Chrome temporary file:
--ipcamera^M Content-Type: image/jpeg^M Content-Length: 27958^M ^M
So, it looks to me as a JPG file, but it keeps updating, so I assume this is MJPEG?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论