How to convert a GIF file to a AVI file?

I want to convert a GIF file to a video file (AVI or mp4). How can I do that using MATLAB?

4 Commenti

Thanks for your response. However, I have some confusions to share. The answer of that question recommends to use im2frame function with loop. Where should I include that loop in the code of the question? I have already tried with the code of the question for my gif file. It gives a video file with complete black screen. Could you please provide me with the complete code. I can't add my gif file here due to its file size.
An example of a loop is given in the documentation for the im2frame function.
Anjan Goswami
Anjan Goswami il 26 Mag 2020
Modificato: Anjan Goswami il 26 Mag 2020
Sorry sir, I have gone through the example loop but it is not convincing for my case. The number of images was already mentioned as Eight in the example. However, how can I know the number of images of my gif animation. Also, are you recommending to use im2frame to convert the images of the gif animation to movie frames and then calling all frames to write a video? Sorry for my ignorance.

Accedi per commentare.

 Risposta accettata

Adam Danz
Adam Danz il 26 Mag 2020
I've written a function that converts GIF --> AVI based on Walter's 2018 answer.
gif2avi(file) will convert the gif file to avi and will save it to your current directory. See the documentation for that function for additional inputs.
Let me know if you have an problems.

5 Commenti

Anjan Goswami
Anjan Goswami il 26 Mag 2020
Modificato: Anjan Goswami il 26 Mag 2020
Thanks a lot Adam. It works perfectly.
Thanks for the feedback!
Please leave a rating and include a comment if you'd like on the file exchange for the files that have been helpful to you.
@Anjan Goswami , please update to the latest version (1.0.2). I just fixed a small error that happens when the destination input includes the file extension.
Thank you, sir.
but usually the size of my converted avi files (from gif ) are much bigger than that of the original gif file, like 400MB compared to 2MB, is this normal ? I use the 2.0.0 version

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Convert Image Type in Centro assistenza e File Exchange

Prodotti

Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by