<p>The best thing for such a use case is creating diffrent files which get loaded in different scenarios.</p>

<p>Current recommendation is to use webm for web content, this container is not supported with all Browsers tho, so also include a .mp4 to switch too.</p>

<p>GIFs can be compressed quite nicely, but you need to keep in mind that GIFs are quite strict about colors.</p>

<p>You can go quite far by compressing with FFMPEG</p>

CC BY-SA 4.0
2019-09-18T19:10:44.260Z
2019-09-18T19:10:44.260Z
Timothy Lukas H.
<p>GIFS are massive compared to h.264, basically because GIF was developed in the olden days (1987), and h.264 was developed in the… well in the less olden days (2003). Here's a 72<strong>kb</strong> h.264 file
<a href="https://adobe.ly/32QFBSL" rel="nofollow noreferrer">https://adobe.ly/32QFBSL</a></p>

<p>And here's the same thing converted to a GIF. Total file size 1,212kb, or roughly 16 times the size, and the quality leaves a lot to be desired.</p>

<p><a href="https://i.sstatic.net/oH7l6.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/oH7l6.gif" alt="enter image description here"></a></p>

<p>h.264 is a codec that was designed for the purpose of delivering high visual quality with small file sizes. It is almost universally readable by any remotely modern browser, and is free to use for most users. The only thing going for GIFs is that they are classified as an image format, so platforms like stackexchange will allow you to embed them, whereas they don't let you embed video. Go figure.</p>

<p>The only alternatives that I could suggest are webm  which is open source but slightly less ubiquitous, and h.265 which works even better, but again is less universally playable.</p>

CC BY-SA 4.0
2019-09-20T08:54:06.890Z
Thanks for the information! I have a .mp4 file that is around a minute long and  around 10 MB large. I'm have used a free video editing software to cut out a 12 sec. long clip and rendered it in h.264 codec once in .mp4 with a file that is now 22 MB large and a webM file that is now 33 MB large. That can't be right, or? Is that a problem with the software I used? Can you recommend a software for this use case?
Jonas
CC BY-SA 4.0
2019-09-19T14:19:33.210Z
2019-09-19T14:25:56.863Z
2019-09-19T14:25:56.863Z
stib
<p>I need to embed short (~10 sec.) videos on my website. I currently use <code>.mp4</code> files, each one is around 10 MB  large.</p>

<p>Is there a way I can reduce the size of these videos? Whats the best format to use? Might gifs be a better option? What resolutions do you recommend for desktop and mobile devices? Does the video editor I use make a difference in file size after rendering?</p>

<video>
Optimizing short Videos (~10 sec.) in Size for embedding in website & app
Jonas
# Optimizing short Videos (~10 sec.) in Size for embedding in website & app

(Asked by: username_0 on 2019-09-17)

I need to embed short (~10 sec.) videos on my website. I currently use `.mp4` files, each one is around 10 MB large.

Is there a way I can reduce the size of these videos? Whats the best format to use? Might gifs be a better option? What resolutions do you recommend for desktop and mobile devices? Does the video editor I use make a difference in file size after rendering?

**Tags:** video


---

## 2 answers

### Answer by username_1 on 2019-09-18. Score: 1

The best thing for such a use case is creating diffrent files which get loaded in different scenarios.

Current recommendation is to use webm for web content, this container is not supported with all Browsers tho, so also include a .mp4 to switch too.

GIFs can be compressed quite nicely, but you need to keep in mind that GIFs are quite strict about colors.

You can go quite far by compressing with FFMPEG


---

### Answer by username_2 on 2019-09-19. Score: 1

GIFS are massive compared to h.264, basically because GIF was developed in the olden days (1987), and h.264 was developed in the… well in the less olden days (2003). Here's a 72**kb** h.264 file
<https://adobe.ly/32QFBSL>

And here's the same thing converted to a GIF. Total file size 1,212kb, or roughly 16 times the size, and the quality leaves a lot to be desired.

[![enter image description here](https://i.sstatic.net/oH7l6.gif)](https://i.sstatic.net/oH7l6.gif)

h.264 is a codec that was designed for the purpose of delivering high visual quality with small file sizes. It is almost universally readable by any remotely modern browser, and is free to use for most users. The only thing going for GIFs is that they are classified as an image format, so platforms like stackexchange will allow you to embed them, whereas they don't let you embed video. Go figure.

The only alternatives that I could suggest are webm which is open source but slightly less ubiquitous, and h.265 which works even better, but again is less universally playable.

> **Comments:**
> **username_0**: Thanks for the information! I have a .mp4 file that is around a minute long and  around 10 MB large. I'm have used a free video editing software to cut out a 12 sec. long clip and rendered it in h.264 codec once in .mp4 with a file that is now 22 MB large and a webM file that is now 33 MB large. That can't be right, or? Is that a problem with the software I used? Can you recommend a software for this use case?  

---

