# Animated Gif with Opencv

**URL:** <https://forum.opencv.org/t/animated-gif-with-opencv/12436>\
**Category:** C++\
**Created:** [March 19, 2023, 7:04pm UTC](https://forum.opencv.org/t/animated-gif-with-opencv/12436 "2023-03-19T19:04:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christophe\_Jacquelin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/christophe_jacquelin/32/135_2.png) [@Christophe\_Jacquelin](https://forum.opencv.org/u/Christophe_Jacquelin)\
**Post date:** [March 19, 2023, 7:04pm UTC](https://forum.opencv.org/t/animated-gif-with-opencv/12436/1 "2023-03-19T19:04:08Z")

</div>

Hello, How to create an Gif animated image from 2 cv::Mat OpenCV flipping one to another ?  
Thank you,

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [March 20, 2023, 7:01am UTC](https://forum.opencv.org/t/animated-gif-with-opencv/12436/2 "2023-03-20T07:01:33Z")

</div>

sorry, but there is nothing builtin to do that here.  
(it neither reads nor writes gif)

save your animation as an image list, then use some external tool to write a gif from it.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [March 22, 2023, 7:05am UTC](https://forum.opencv.org/t/animated-gif-with-opencv/12436/3 "2023-03-22T07:05:06Z")

</div>

tell `VideoWriter` to make a `.gif` file. it hopefully picks ffmpeg for a backend, and ffmpeg can do `.gif` files. I have no idea what the fourcc argument would need to be.
