How to efficiently record & compress AVI animation & GIFs?
22 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Saeed Mohammadian
el 17 de Jun. de 2018
Respondida: Saeed Mohammadian
el 19 de Jun. de 2018
Hello everyone,
I'm recording a video out of my simulations in a loop and I want a smaller video size WITHOUT changing frame rate. I mean I don't want to decrease the duration of video, which happens when I change the frame rate. Below is my code:
applying the following code to save the video.
% defining file name as:
v = VideoWriter('filename.avi');
v.VideoCompressionMethod
open(v);
and in the loop for t=1:nTstep I apply the following:
%
if (rem(t,5)==0)
A(t) = getframe(gcf);
writeVideo(v,A(t));
This result in a 700 mb size for a 10-second video. Does anyone know how I can decrease it to less than 200 mb or something, without changing the video duration?.
Another thing, I'm eventually converting my avi to GIF and cannot directly do it in conveniently. I've used some codes to generate GIF but my frame rates and other stuff used to change. Can someone introduce a neat way of directly generating GIFs in Matlab?
Thanks a lot
Saeed
1 comentario
Respuesta aceptada
Walter Roberson
el 17 de Jun. de 2018
For smaller .avi you need to pass a profile as the second argument to VideoWriter; see https://www.mathworks.com/help/matlab/ref/videowriter.html#d119e1242642 . You will probably need to reduce the Quality .
Unfortunately, VideoWriter writes frame by frame, so although it can do backwards references for compression, it never does forward references. A good transcoding program such as vlc can almost always do better.
0 comentarios
Más respuestas (1)
Ver también
Categorías
Más información sobre Audio and Video Data en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!