ffmpeg video preset (vpre) benchmark

Date: 2011-06-03

I recently had to encode a bunch of videos for my photo/video archive. I decided to use the H.264 (x264) codec and the matroska (mkv) container format. ffmpeg seemed like the best tool for encoding. When using libx264 with ffmpeg, a video preset (-vpre) is required.

In order to find the best suitable video preset for my use case, I decided to do some testing. ffmpeg comes with a few pre-defined video presets. In these tests, I have encoded the same video with each of the pre-defined video presets. The results are available below.

I hope this can help others choose a video preset and thus save some time. The results are also available in PDF (ffmpeg-video-preset-benchmark.pdf) as well as ODF (ffmpeg-video-preset-benchmark.ods)

About the tests

Source video

Test system configuration

Data

About the data

All sizes are given in bytes.

INPUT

 

OUTPUT

filename

format

acodec

vcodec

resolution

duration

bitrate

size

format

acodec

ac

vcodec

crf

vpre

size

ratio

time

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

default

10,992,835

0.628

22.322

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

fast

11,082,766

0.633

17.988

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

fast_firstpass

9,381,789

0.536

4.458

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

faster

10,299,783

0.588

13.961

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

faster_firstpass

9,372,348

0.535

5.681

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

fastfirstpass

9,387,020

0.536

5.804

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

hq

10,638,802

0.607

43.338

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

lossless_fast

11,391,879

0.650

10.326

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

lossless_max

10,893,240

0.622

259.683

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

lossless_medium

10,321,006

0.589

17.724

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

lossless_slow

11,080,834

0.633

31.632

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

lossless_slower

11,148,524

0.636

55.986

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

lossless_ultrafast

12,724,773

0.726

5.409

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

max

10,497,089

0.599

592.228

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

medium

10,992,992

0.628

38.108

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

medium_firstpass

9,386,127

0.536

8.213

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

normal

10,454,342

0.597

23.808

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

placebo

10,198,622

0.582

651.605

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

placebo_firstpass

10,198,622

0.582

692.313

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

slow

10,698,080

0.611

67.397

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

slow_firstpass

9,024,519

0.515

10.760

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

slower

10,683,483

0.610

224.948

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

slower_firstpass

9,036,067

0.516

12.018

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

slowfirstpass

10,157,608

0.580

24.597

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

superfast

12,996,651

0.742

8.700

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

superfast_firstpass

13,703,325

0.782

8.358

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

ultrafast

15,575,991

0.889

6.161

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

ultrafast_firstpass

15,575,991

0.889

6.085

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

veryfast

10,784,348

0.616

11.846

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

veryfast_firstpass

11,197,726

0.639

8.915

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

veryslow

10,197,403

0.582

309.936

foo.avi

avi

pcm_u8

mjpeg/yuvj422p

640x480

00:00:09.36

14959 kb/s

17,515,434

matroska

flac

2

libx264

16

veryslow_firstpass

8,630,155

0.493

15.062

Graphs

Output size

size.png

Compression ratio

ratio.png

Time elapsed while encoding

First graph shows time taken to encode for each video preset.

duration-1.png

In the second graph I have removed video presets that took more than 100 seconds to encode. This was done in order to better visualize the difference between the fast presets.

duration-2.png

Frames preview of resulting video files

ss/foo.avi.jpeg
ss/foo.avi.jpeg

ss/foo.mkv.default.mkv.jpeg
ss/foo.mkv.default.mkv.jpeg

ss/foo.mkv.faster_firstpass.mkv.jpeg
ss/foo.mkv.faster_firstpass.mkv.jpeg

ss/foo.mkv.faster.mkv.jpeg
ss/foo.mkv.faster.mkv.jpeg

ss/foo.mkv.fast_firstpass.mkv.jpeg
ss/foo.mkv.fast_firstpass.mkv.jpeg

ss/foo.mkv.fastfirstpass.mkv.jpeg
ss/foo.mkv.fastfirstpass.mkv.jpeg

ss/foo.mkv.fast.mkv.jpeg
ss/foo.mkv.fast.mkv.jpeg

ss/foo.mkv.hq.mkv.jpeg
ss/foo.mkv.hq.mkv.jpeg

ss/foo.mkv.jpeg
ss/foo.mkv.jpeg

ss/foo.mkv.lossless_fast.mkv.jpeg
ss/foo.mkv.lossless_fast.mkv.jpeg

ss/foo.mkv.lossless_max.mkv.jpeg
ss/foo.mkv.lossless_max.mkv.jpeg

ss/foo.mkv.lossless_medium.mkv.jpeg
ss/foo.mkv.lossless_medium.mkv.jpeg

ss/foo.mkv.lossless_slower.mkv.jpeg
ss/foo.mkv.lossless_slower.mkv.jpeg

ss/foo.mkv.lossless_slow.mkv.jpeg
ss/foo.mkv.lossless_slow.mkv.jpeg

ss/foo.mkv.lossless_ultrafast.mkv.jpeg
ss/foo.mkv.lossless_ultrafast.mkv.jpeg

ss/foo.mkv.max.mkv.jpeg
ss/foo.mkv.max.mkv.jpeg

ss/foo.mkv.medium_firstpass.mkv.jpeg
ss/foo.mkv.medium_firstpass.mkv.jpeg

ss/foo.mkv.medium.mkv.jpeg
ss/foo.mkv.medium.mkv.jpeg

ss/foo.mkv.mkv.jpeg
ss/foo.mkv.mkv.jpeg

ss/foo.mkv.normal.mkv.jpeg
ss/foo.mkv.normal.mkv.jpeg

ss/foo.mkv.placebo_firstpass.mkv.jpeg
ss/foo.mkv.placebo_firstpass.mkv.jpeg

ss/foo.mkv.placebo.mkv.jpeg
ss/foo.mkv.placebo.mkv.jpeg

ss/foo.mkv.slower_firstpass.mkv.jpeg
ss/foo.mkv.slower_firstpass.mkv.jpeg

ss/foo.mkv.slower.mkv.jpeg
ss/foo.mkv.slower.mkv.jpeg

ss/foo.mkv.slow_firstpass.mkv.jpeg
ss/foo.mkv.slow_firstpass.mkv.jpeg

ss/foo.mkv.slowfirstpass.mkv.jpeg
ss/foo.mkv.slowfirstpass.mkv.jpeg

ss/foo.mkv.slow.mkv.jpeg
ss/foo.mkv.slow.mkv.jpeg

ss/foo.mkv.superfast_firstpass.mkv.jpeg
ss/foo.mkv.superfast_firstpass.mkv.jpeg

ss/foo.mkv.superfast.mkv.jpeg
ss/foo.mkv.superfast.mkv.jpeg

ss/foo.mkv.ultrafast_firstpass.mkv.jpeg
ss/foo.mkv.ultrafast_firstpass.mkv.jpeg

ss/foo.mkv.ultrafast.mkv.jpeg
ss/foo.mkv.ultrafast.mkv.jpeg

ss/foo.mkv.veryfast_firstpass.mkv.jpeg
ss/foo.mkv.veryfast_firstpass.mkv.jpeg

ss/foo.mkv.veryfast.mkv.jpeg
ss/foo.mkv.veryfast.mkv.jpeg

ss/foo.mkv.veryslow_firstpass.mkv.jpeg
ss/foo.mkv.veryslow_firstpass.mkv.jpeg

ss/foo.mkv.veryslow.mkv.jpeg
ss/foo.mkv.veryslow.mkv.jpeg

ss/merged.mkv.jpeg
ss/merged.mkv.jpeg

Last modified: 2011-06-03