How do I add generated audio to a silent video?

I have written following code to add generated audio into a silent video. It executes smoothly. But the audio doesn't get added into the "newvideo.avi" file.
videoFReader = vision.VideoFileReader('silent_pgwl1s.avi');
% videoFWriter = vision.VideoFileWriter('newvideo.avi','AudioInputPort',true);
videoFWriter = vision.VideoFileWriter('newvideo.avi','AudioInputPort',true);
for i=1:75
% videoFrame = step(videoFReader);
% step(videoFWriter, videoFrame,predgwo);
videoFrame= step(videoFReader);
videoFWriter(videoFrame,orgvf) ;
end
release(videoFReader);
release(videoFWriter);

 Akzeptierte Antwort

Image Analyst
Image Analyst am 3 Feb. 2025

0 Stimmen

3 Kommentare

Thank you so much
I tried the same code. But it didn't work. please guide me to resolve the problem.
@Shilpa Sonawane, sorry, I haven't tried it and I don't have time. Try calling tech support.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by