VideoReader with small mp4 files uses all memory
1 回表示 (過去 30 日間)
古いコメントを表示
I have an AVCHD video file, which I convert with handbrake into .mp4 file. Then I am trying to store the whole file into a structure array (it's an operation which I always do with other videos, and the code works just perfectly fine). But this time, with a (only) 125MB video, the memory of my laptop (I have 16GB!) increases very quicly and gets full, until I get the out of memory error. I also tried to convert the video to a lower (super low) quality and I got a 5MB file, but when reading it I have the same memory usage increase until it gets full. The curious thing is that I get the out of memory error when there is just 1 frame to read to finish.
There is clearly something wrong happening here, do you have any hint? I'm running MATLAB 2016b.
3 件のコメント
Walter Roberson
2017 年 2 月 27 日
You are reallocating cama each time through the loop. You should determine how many frames you have, allocate cama as a struct with that many elements, and then go back and read the frames.
You will need to use the same basic framework of hasFrame to count the frames; the number-of-frames field is an estimate.
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!