Reading Video with sound.
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi, I'm having a problem. I want to read a avi video file with the sound. But I can only read the video and there is no sound.
xyloObj = VideoReader('xylophone.mpg');
nFrames = xyloObj.NumberOfFrames;
vidHeight = xyloObj.Height;
vidWidth = xyloObj.Width;
% Preallocate movie structure.
mov(1:nFrames) = ...
struct('cdata', zeros(vidHeight, vidWidth, 3, 'uint8'),...
'colormap', []);
% Read one frame at a time.
for k = 1 : nFrames
mov(k).cdata = read(xyloObj, k);
end
% Size a figure based on the video's width and height.
hf = figure;
set(hf, 'position', [150 150 vidWidth vidHeight])
% Play back the movie once at the video's frame rate.
movie(hf, mov, 1, xyloObj.FrameRate);
This is the code that I used and taken from the help.
0 commentaires
Réponses (1)
Walter Roberson
le 23 Jan 2013
The only toolbox that supports reading sound with video is the ComputerVision toolbox's multimedia file reader.
You might be able to find something in the File Exchange.
0 commentaires
Voir également
Catégories
En savoir plus sur Audio and Video Data dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!