How can I see if a particular videowriter file is still open

6 ビュー (過去 30 日間)
Michael
Michael 2023 年 4 月 25 日
コメント済み: Michael 2023 年 5 月 11 日
I can't find a way to query the videowriter handle to see if the file is still open. I suppose I could try to write to it and see it it returns an error, but that seems clunky.

採用された回答

Bhanu Prakash
Bhanu Prakash 2023 年 5 月 10 日
Hi Michael,
As per my understanding, you want to know how to check the status of a particular VideoWriter file.
To check the status of any file, you can use the “isopen” function.
Consider the code shown below:
x = VideoWriter(VideoFile.avi);
status = isopen(x);
where, “x” is the handle of the VideoWriter file and “status” is the output of the isopen” function. The VideoWriter file is said to be open if the value of “status” is 1 and closed if the value of “status” is 0.
For more information on “VideoWriter and isopen” functions, you can refer to the following documentation:
For “VideoWriter” function:
For “isopen” function:
  1 件のコメント
Michael
Michael 2023 年 5 月 11 日
That works perfectly. Thanks Bhanu!
Michael

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by