我想在MATLAB中将音频和视频合并为视频文件。我写了以下代码:
但这给了我错误!?!谁能指导我?

[filename pathname]=uigetfile({'*.*'},'Video Selector');
fulpathname=strcat(pathname,filename);
videoFReader = vision.VideoFileReader(fulpathname);
[AUDIO,Fs] = audioread(fulpathname);
videoFWriter = vision.VideoFileWriter('myFile.avi','FrameRate',videoFReader.info.VideoFrameRate);

for i=1:50
videoFrame = step(videoFReader);
step(videoFWriter, videoFrame,AUDIO);
end

release(videoFReader);
release(videoFWriter);

最佳答案

使用“videoFReader.SampleRate”代替“videoFReader.info.VideoFrameRate”,该错误将被消除

07-28 12:58