DEV Community

Discussion on: Using ffmpeg to compress, convert, and resize videos

Collapse
 
aquaductape profile image
Caleb Taylor • Edited

I'm a total noob at this but it seems like compressing a silent video to mp4 via libx264 seems better if you want smaller file size. The quality seems just as good compared to Webm. Sometimes compressing small mp4 files with WebM increases the file size, while using libx264 on the same file compresses it correctly.

link to original-file.mp4

original-file.mp4 = 1.6MB
output-file.webm = 966 kB
output-file.mp4 = 538 kB

The ffmpeg args I used are from this post

 ffmpeg -i input.mp4 -vcodec libx264 -crf 28 output.mp4
Enter fullscreen mode Exit fullscreen mode

If I'm right, what's the fuss about WebM? Currently libx264 seems to do a better job. Is WebM on track to become much better at compression in the future?