<p>I occasionally make a video from slide images. I find I get the best quality and compression by putting the images in the timeline in your preferred video editor (I use Vegas Pro 13), saving as a motion jpeg*, then use ffmpeg to convert that to H264. I use <code>-crf 28</code>, which is probably called "constant quality" in Handbrake. At 1024x768 resolution I easily get bitrates under 100 kbps and they look great. You can increase the crf value to get more compression or decrease it to get better quality, so you can fine tune to your tastes. </p>

<p>With this method above, I would bet H264 and VP8 are comparable. VP9 will probably be better, but it doesn't work on everything and takes a lot longer to encode. </p>

<p>My theory why this works: </p>

<p>Motion jpeg is intra-frame compression only. Each individual frame is compressed as an image, then added to the stream; there is no inter-frame compression (compression between frames). It doesn't have I-frames or any of that complicated stuff. So for a full second in your video all the frames are identical, not just "look the same". They are technically identical. </p>

<p>H264 then has a lot of power to compress the motion jpeg. It sees a string of identical frames then does the equivalent of saving the first frame completely then uses nearly dataless "reference frames" for the rest. </p>

<hr>

<p>*Motion jpeg will be a relatively big file. Coincidentally, when I record a slides presentation, I initially encode as motion jpeg because most of the presentation will be static slides. </p>

CC BY-SA 3.0
2017-07-24T17:47:44.263Z
2017-07-24T17:55:10.080Z
2017-07-24T17:55:10.080Z
user3643
<p>VP9 will give you the best quality-to-size ratio, but you can also get pretty good results out of H.264 as well.</p>

<p>In order to maximize the efficiency of compression, if each image is up for <em>exactly</em> one second (or <em>exactly</em> two seconds, or <em>exactly</em> three seconds, or <em>exactly</em> etc.) then you make the frame rate 1.00 FPS and tell the encoder not to use P-frames or B-frames (AKA "reference frames") and set your GoP to 1. After that run with Constant Quality encoding and use a rate factor that gets you an acceptable level of quality with an acceptable file size.</p>

CC BY-SA 3.0
2017-04-25T06:26:46.073Z
*tell the encoder not to use P-frames or B-frames (AKA "reference frames")* --> I-frames are the canonical reference frames. P and B frames are predicted frames and in modern codecs, also can serve as reference for other P and B frames. With a GOP of 1, there's no motion estimation/compensation and compression will be worse. Also, some players can't handle a video with 1 FPS. `5` tends to be the safe minimum. With x264, at least, identical predicted frames take very little space, So upping the framerate isn't a big issue.
Gyan
CC BY-SA 3.0
2017-07-24T01:10:24.357Z
An FPS of 1 is likely to not play, as already said, then would also not provide much benefit over something like 15. If 15 frames are identical, the right setting can compress very well.
user3643
CC BY-SA 3.0
2017-04-24T18:50:48.187Z
2017-04-24T18:50:48.187Z
ivkowalenko
<p>I am trying to make a video out of an image sequence -  Where each frame lasts for a second. </p>

<p>The image sequence contains the same object shot from different distances. 
I'm guessing most default video converters optimize for motion, but in this scenario, I need to get the least file size without changing the frame rate.</p>

<p>Which codec (H.264, VP8, VP9) can give me the best size to quality ratio?</p>

<p>Also are there any flags for H.264 which I can enable to optimize for this case?</p>

CC BY-SA 3.0
2017-04-22T19:11:04.710Z
What software are you using and what format are your files?
LetTheWritersWrite
CC BY-SA 3.0
2017-04-23T02:24:36.313Z
@LetTheWritersWrite I'm using VirtualDub to make a `.avi` out of the video, and then handbrake to encode `.avi` to `.mp4` currently. As for format, I'll need either `mp4` or `webm`
Shubham Kanodia
<video-quality><encoding><codec><h.264><webvideos>
What are the best codecs and encoding options for a image sequence video?
Shubham Kanodia
# What are the best codecs and encoding options for a image sequence video?

(Asked by: username_0 on 2017-04-22)

I am trying to make a video out of an image sequence - Where each frame lasts for a second.

The image sequence contains the same object shot from different distances.
I'm guessing most default video converters optimize for motion, but in this scenario, I need to get the least file size without changing the frame rate.

Which codec (H.264, VP8, VP9) can give me the best size to quality ratio?

Also are there any flags for H.264 which I can enable to optimize for this case?

**Tags:** video-quality, encoding, codec, h.264, webvideos

> **Comments:**
> **username_1**: What software are you using and what format are your files?  
> **username_0**: @username_1 I'm using VirtualDub to make a `.avi` out of the video, and then handbrake to encode `.avi` to `.mp4` currently. As for format, I'll need either `mp4` or `webm`  

---

## 2 answers

### Answer by username_2 on 2017-07-24. Score: 1

I occasionally make a video from slide images. I find I get the best quality and compression by putting the images in the timeline in your preferred video editor (I use Vegas Pro 13), saving as a motion jpeg\*, then use ffmpeg to convert that to H264. I use `-crf 28`, which is probably called "constant quality" in Handbrake. At 1024x768 resolution I easily get bitrates under 100 kbps and they look great. You can increase the crf value to get more compression or decrease it to get better quality, so you can fine tune to your tastes.

With this method above, I would bet H264 and VP8 are comparable. VP9 will probably be better, but it doesn't work on everything and takes a lot longer to encode.

My theory why this works:

Motion jpeg is intra-frame compression only. Each individual frame is compressed as an image, then added to the stream; there is no inter-frame compression (compression between frames). It doesn't have I-frames or any of that complicated stuff. So for a full second in your video all the frames are identical, not just "look the same". They are technically identical.

H264 then has a lot of power to compress the motion jpeg. It sees a string of identical frames then does the equivalent of saving the first frame completely then uses nearly dataless "reference frames" for the rest.

---

\*Motion jpeg will be a relatively big file. Coincidentally, when I record a slides presentation, I initially encode as motion jpeg because most of the presentation will be static slides.


---

### Answer by username_3 on 2017-04-24. Score: 0

VP9 will give you the best quality-to-size ratio, but you can also get pretty good results out of H.264 as well.

In order to maximize the efficiency of compression, if each image is up for *exactly* one second (or *exactly* two seconds, or *exactly* three seconds, or *exactly* etc.) then you make the frame rate 1.00 FPS and tell the encoder not to use P-frames or B-frames (AKA "reference frames") and set your GoP to 1. After that run with Constant Quality encoding and use a rate factor that gets you an acceptable level of quality with an acceptable file size.

> **Comments:**
> **username_4**: *tell the encoder not to use P-frames or B-frames (AKA "reference frames")* --> I-frames are the canonical reference frames. P and B frames are predicted frames and in modern codecs, also can serve as reference for other P and B frames. With a GOP of 1, there's no motion estimation/compensation and compression will be worse. Also, some players can't handle a video with 1 FPS. `5` tends to be the safe minimum. With x264, at least, identical predicted frames take very little space, So upping the framerate isn't a big issue.  
> **username_2**: An FPS of 1 is likely to not play, as already said, then would also not provide much benefit over something like 15. If 15 frames are identical, the right setting can compress very well.  

---

