FFmpeg, ≈ 2188.65
Input is a \$1\times5003\$ PBM image consisting of alternating white and black pixels, which is 10,015 bytes. This image is encoded as an H.264 video using excessive quality settings, yielding a 21,919,295 byte mp4. The following Ruby wrapper was used to generate both files:
#!/usr/bin/env ruby
s = 5003
pbm=['P1',1,s]
s.times { |i| pbm << i%2 }
File.write('raw.pbm', pbm.join(' '))
`ffmpeg -i raw.pbm -crf 0 -filter:v fps=10000000 -preset ultrafast -tune film compressed.mp4`
puts r = File.size('raw.pbm')
puts c = File.size('compressed.mp4')
puts c.fdiv(r)
The options passed to FFmpeg are:
-crf 0
(constant rate factor 0). From the docs: 'The range of the CRF scale is 0–51, where 0 is lossless . . . a subjectively sane range is 17–28 . . . The range is exponential'.-filter:v fps=10000000
I kept adding zeros to the frame rate until there was no change in output size.-preset ultrafast
'A slower preset will provide better compression', so I chose the fastest one. (The next fastest option,superfast
, reduces the file size more than fivefold.)-tune film
'use for high quality movie content; lowers deblocking'. Adding this option increased the file size by 2 bytes.