error in making video file

5 visualizaciones (últimos 30 días)
Naveen C C
Naveen C C el 18 de Mzo. de 2014
Respondida: Kazem Gheysari el 6 de Sept. de 2021
i have a code which is instructed in matlab itself for video writing. the code is as follows.
videoFReader = vision.VideoFileReader('C:\Users\NAVEEN\Desktop\samp.avi');
videoFWriter = vision.VideoFileWriter('myFile.avi', ...
'FrameRate', videoFReader.info.VideoFrameRate);
% write the first 50 frames of viplanedeparture.avi into myFile.avi
for i=1:50
videoFrame = step(videoFReader);
step(videoFWriter, videoFrame); % write video to myFile.avi
end
release(videoFReader); % close the input file
release(videoFWriter); % close the output file
but when i run this code i am getting error
Error using VideoFileWriter/step
Could not start the filter graph : Access is denied.
Error in Untitled1 (line 7)
step(videoFWriter, videoFrame); % write video to myFile.avi
what is wrong with this code i am using r2013a matlab please help me... thank u in advance

Respuesta aceptada

Walter Roberson
Walter Roberson el 18 de Mzo. de 2014
I suspect you do not have permission to write 'myFile.avi' in whichever directory you happen to be in. Have you considered provided the entire path to be sure that it goes on to your desktop ?
  2 comentarios
Naveen C C
Naveen C C el 18 de Mzo. de 2014
thank u a lot. its working when i give complete path for videofilewriter. i.e vision.VideoFileWriter('C:\Users\NAVEEN\Desktop\myfile.avi','FrameRate', videoFReader.info.VideoFrameRate');
thank u once again
Naveen C C
Naveen C C el 18 de Mzo. de 2014
how to compress the video after saving it. its taking lot of memory (like 600mb for 24sec video).

Iniciar sesión para comentar.

Más respuestas (1)

Kazem Gheysari
Kazem Gheysari el 6 de Sept. de 2021
I solved this error, by changeing the folder that is goning to create the video file.
Output_path = 'C:\out\My folder';
videoFWriter = vision.VideoFileWriter(fullfile(Output_path,'myFile.avi'), ...
'FrameRate', videoFReader.info.VideoFrameRate);

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by