VideoWriter cannot generate a playable video file.

22 ビュー (過去 30 日間)
Xiangyan An
Xiangyan An 2024 年 9 月 27 日
コメント済み: Xiangyan An 2024 年 9 月 30 日
Hello,
I just got some trouble while using the function VideoWriter to generate a video. I'm trying to use the sample code in the function document, as below.
clear
clc
A = rand(300);
v = VideoWriter("newfile.avi");
open(v)
writeVideo(v,A)
close(v)
These lines can run without any error message, and a video file is created. However, the created video file cannot be played by windows media player.
In fact, I had used this function on another computer and it works well. Is the function VideoWriter or any related function environment-dependent? The computer where I got problem is run on windows 11, and I'm using Matlab 2023b.
Thanks for any help.
  2 件のコメント
Xiangyan An
Xiangyan An 2024 年 9 月 27 日
Moreover, I just checked play the file through another player (VLC). It can be played correctly through VLC. However, I want to insert the video file into a .pptx file. The video is still not able to be played in the .pptx file. It seems that there are indeed some issues with this video file。
Xiangyan An
Xiangyan An 2024 年 9 月 27 日
BTW, the error when trying to play it through windows media player is 0xC00D6D60.

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

採用された回答

Karanjot
Karanjot 2024 年 9 月 30 日
Hi,
Although, this seems to be an issue with Windows media player instead of the video file. I can suggest a potential workaround to resolve the issue:
Try modiying the 'profile' attribute of the VideoWriter object. Switching to the MPEG-4 profile often resolves compatibility issues.
To know more about this refer to the Input Arguments section in the below linked documentation:
I hope this helps!
  1 件のコメント
Xiangyan An
Xiangyan An 2024 年 9 月 30 日
It works! Thanks very much!

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by