Sign inSign up

jojje/ffmpeg-cloud-bench

By jojje

Updated over 6 years ago

Benchmarking ffmpeg AVC encoding speed using an embedded 1080p 1 minute long sample clip.

Image
0

408

jojje/ffmpeg-cloud-bench repository overview

Usage

docker run --rm jojje/ffmpeg-cloud-bench

Note

The last line in the output produces a summary of the run; useful for later parsing during benchmark aggregation analysis. To help keep benchmark runs apart, set the hostname for the container. That value shows up in the HOST summary property as part of the output.

The key metric; Speed is ffmpeg's final realtime speed metric. This number conveys how quickly the encoding runs compared to real-time playout. E.g. if the Speed indicates 1 then the encoding on the machine is happening in realtime. If it's 1.5, then the encoding is 50% faster than realtime, etc. The number during benchmarking is mostly interesting from a comparison perspective against other benchmark runs. A higher score/value means the machine the container is running on is more performant. A lower value indicates a slower underlying machine.

ffmpeg with the x264 codec was chosen as the benchmark program, because it scales very well (almost linearly) to many cores. As such this benchmark can be used to figure out how much "bang for the buck" compute capacity you get from different machine configurations; be they cloud instances or your own bare metal ones.

Especially in the cloud, just because you double the amount of VCPU, does not mean you get double the compute performance. For some configurations, it just means that the cloud vendor is giving you another hardware thread (extra pair of CPU registers) on the same CPU core(s) you were already using. This means contention for the ALU circuits (two threads fighting for the same ALU), which in turn means you may only get about 15% performance improvement, but paying twice the money!

Example output


COMMAND: ffmpeg -i sample.mp4 -c:v libx264 -preset medium -crf 20 -f null -

ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.2.0 (Alpine 9.2.0)
  configuration: --prefix=/usr --enable-avresample --enable-avfilter --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --disable-stripping --disable-static --disable-librtmp --enable-vaapi --enable-vdpau --enable-libopus --disable-debug
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sample.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.28.102
  Duration: 00:01:00.00, start: 0.000000, bitrate: 4813 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 4810 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x7f17cf6fe300] using SAR=1/1
[libx264 @ 0x7f17cf6fe300] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x7f17cf6fe300] profile High, level 4.0, 4:2:0, 8-bit
Output #0, null, to 'pipe:':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.29.100
    Stream #0:0(und): Video: h264 (libx264), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 24 fps, 24 tbn, 24 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc58.54.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame= 1440 fps= 27 q=-1.0 Lsize=N/A time=00:00:59.91 bitrate=N/A speed=1.14x
video:29359kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[libx264 @ 0x7f17cf6fe300] frame I:22    Avg QP:14.15  size:335660
[libx264 @ 0x7f17cf6fe300] frame P:446   Avg QP:18.22  size: 34778
[libx264 @ 0x7f17cf6fe300] frame B:972   Avg QP:22.28  size:  7375
[libx264 @ 0x7f17cf6fe300] consecutive B-frames:  5.1% 14.0%  2.3% 78.6%
[libx264 @ 0x7f17cf6fe300] mb I  I16..4:  6.5% 70.8% 22.7%
[libx264 @ 0x7f17cf6fe300] mb P  I16..4:  2.2%  9.1%  0.8%  P16..4: 30.2% 10.7%  5.7%  0.0%  0.0%    skip:41.4%
[libx264 @ 0x7f17cf6fe300] mb B  I16..4:  0.3%  1.5%  0.1%  B16..8: 24.7%  1.9%  0.4%  direct: 1.1%  skip:70.0%  L0:41.6% L1:52.7% BI: 5.7%
[libx264 @ 0x7f17cf6fe300] 8x8 transform intra:74.6% inter:76.6%
[libx264 @ 0x7f17cf6fe300] coded y,uvDC,uvAC intra: 67.7% 72.4% 35.7% inter: 8.6% 10.0% 0.9%
[libx264 @ 0x7f17cf6fe300] i16 v,h,dc,p:  9% 15%  3% 73%
[libx264 @ 0x7f17cf6fe300] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 15% 11%  6% 10% 10%  9% 10%  8%
[libx264 @ 0x7f17cf6fe300] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 12%  9%  7% 13% 12%  9%  8%  6%
[libx264 @ 0x7f17cf6fe300] i8c dc,h,v,p: 45% 22% 21% 12%
[libx264 @ 0x7f17cf6fe300] Weighted P-Frames: Y:1.1% UV:1.1%
[libx264 @ 0x7f17cf6fe300] ref P L0: 64.7% 13.6% 13.9%  7.8%  0.0%
[libx264 @ 0x7f17cf6fe300] ref B L0: 87.3%  9.7%  3.0%
[libx264 @ 0x7f17cf6fe300] ref B L1: 95.9%  4.1%
[libx264 @ 0x7f17cf6fe300] kb/s:4008.51

JSON: {"host": "test-box", "vcpu": 4, "cpu_model": "Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz", "ram_gb": 7.79, "speed": 1.14}

HOST: test-box | VCPU: 4 | MODEL: Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz | RAM: 7.79 GiB | Speed: 1.14

Tag summary

Content type

Image

Digest

Size

57.7 MB

Last updated

over 6 years ago

docker pull jojje/ffmpeg-cloud-bench