Respuesta aceptada

KSSV
KSSV el 24 de Abr. de 2019
vidObj = VideoReader('C:\Users\Public\Videos\Sample Videos\Wildlife.wmv'); % video file
%% Read the video frame by frame
numFrames = 0;
iwant = cell([],1) ;
while hasFrame(vidObj)
F = readFrame(vidObj);
numFrames = numFrames + 1;
imagesc(F)
drawnow
iwant{numFrames} = F ;
end
%% Write to video
v = VideoWriter('myFile','Archival');
v.VideoCompressionMethod
open(v)
for i = 1:numFrames
writeVideo(v,rgb2gray(iwant{i}))
end
close(v)

3 comentarios

Awais Khan
Awais Khan el 24 de Abr. de 2019
thanks for your answering, but tell me one thing if you know that the resulted video as a execution of above code is in mj2 extension, if we want to get in avi extension, at which place we makes changes for it. again thanks for sharing above code it is working well.
KSSV
KSSV el 24 de Abr. de 2019
Read about videowriter. You may use some thing like below:
v = VideoWriter('newfile.avi','Motion JPEG AVI');
Awais Khan
Awais Khan el 24 de Abr. de 2019
done its working

Iniciar sesión para comentar.

Más respuestas (0)

Preguntada:

el 24 de Abr. de 2019

Comentada:

el 24 de Abr. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by