How to efficiently record & compress AVI animation & GIFs?
22 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Saeed Mohammadian
le 17 Juin 2018
Réponse apportée : Saeed Mohammadian
le 19 Juin 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 commentaire
Réponse acceptée
Walter Roberson
le 17 Juin 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 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Audio and Video Data dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!