Matlab:我的内存有限,有其他解决方案可以从视频中读取数据吗?
我目前在使用 matlab 时遇到问题,当我尝试从视频中读取一些数据时,出现错误:
???内存不足,无法容纳 990 帧。
我有足够的内存来读取大约 100 帧左右。
我在标题中提到替代解决方案,因为我认为显而易见的答案是购买更多内存。还有其他方法可以读取这些帧并处理它们吗?例如,我认为也许我可以通过循环一次读入一帧并调整视频帧的大小以使用更少的内存(或者通过备用程序执行此操作)?该视频在 1024x1024 下非常占用内存。然而,通过缩小尺寸,我担心我会丢失视频中有价值的数据。
任何帮助将不胜感激!
预先感谢:)
ps。当前代码:
vid = VideoReader('video.avi');
frames = read(vid);
I am currently having a problem with matlab in that when I try and read in some data from a video I am presented with an error:
??? Not enough memory available for 990 frames.
I have enough memory available for reading about 100 frames or so.
I say alternate solutions in the title as I would assume the obvious answer would be to buy more memory. Are there any other ways of reading these frames and processing them? For example I thought that perhaps I may be able to read in a frame at a time via a loop and resize the video frame in order to use less memory (or do this via an alternate program)? The video is pretty memory intensive at 1024x1024. However by downscaling I am worried that I will be losing valuable data from the video.
Any help would be greatly appreciated!
Thanks in advance :)
ps. Current code:
vid = VideoReader('video.avi');
frames = read(vid);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过给出索引来读取特定的帧,而不是将所有帧读入内存,如 文档。
例子
You can read spesific frame(s) by giving the indices instead of reading all of the frames into the memory as given in the documentation.
Example