VideoWriter array exceeds maximum array size preference

7 ビュー (過去 30 日間)
Avishai Halev
Avishai Halev 2017 年 8 月 4 日
回答済み: Walter Roberson 2021 年 7 月 19 日
I am trying to write a movie to an .avi using the VideoWriter and I get this error:
Error using VideoWriter/writeVideo (line 369)
Requested 685x868x3x9525 (15.8GB) array exceeds maximum array size preference. Creation of arrays greater than this limit
may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information.
How can I circumvent this and write my video? I am calling writeVideo on a 1x9525 struct array M with
size(M.cdata)= 685 868 3
and M.cdata is of type uint8.

回答 (2 件)

Amita Amte
Amita Amte 2017 年 8 月 8 日
This issue could be due to RAM limitations. The following might be helpful:
1. Go to MATLAB > Preferences > Workspace and ensure the Maximum array size limit is set to 100%.
2. Also, check that the Java Heap Memory is not set to a very large value because that might restrict the amount of memory available to perform computations.
  4 件のコメント
Shravan Darbhetadka
Shravan Darbhetadka 2020 年 4 月 20 日
My settings are already at 100% but i still get the same error, is there any other way to work around this problem? Also where do i check for the java heap memory and what is the right value to have there?
Thanks
Shravan
Subhash Chandra Ranga
Subhash Chandra Ranga 2021 年 7 月 19 日
編集済み: Subhash Chandra Ranga 2021 年 7 月 19 日
waiting for a reply, I have similar issue. Did You solved it Shravan

サインインしてコメントする。


Walter Roberson
Walter Roberson 2021 年 7 月 19 日
VideoWriter can write incrementally. Loop passing it part of the structure array each time
B = 100; %buffer size
nf = numel(M) ;
for K = 1:B:nf-B+1
writeVideo(obj, M(K:K+B+1));
end
K=K+B;
if K<nf
writeVideo(obj, M(K:end));
end
The larger you can make B the more efficient writing can be, but too large may get out of memory.

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by