loading...

How do you compress mp4 videos?

twitter logo github logo ・1 min read

Do you guys have a good online tool, command line tool or a Node.JS library to compress videos?

I would like to put a video I made today on a customer website, but I filmed it in 4k so for 15 sec. it weights 44MB 😂

The best tool that I am looking for would:

  • Trim useless bytes
  • Create variants by size (like 600x?, 980x?, 1200x?, 1920x?) with the ability to choose the sizes
  • Create a webm counterpart of the video (not necessary, but appreciated)

Anyone?

twitter logo DISCUSS (6)
markdown guide
 

I will suggest ffmpeg as well. But there are some challenges, I think:

  1. It is slow. There is a bottleneck problem, which has not been quite resolved yet. Multithreading definitely helps though.
  2. Webm is not the best friend of ffmpeg. I had personally some problems with ffmpeg and webm. But for one video, it would suffice.
 

I agree on both points, just ran ffmpeg to first resize my videos, it was quite slow, but I ask myself such a good tool might come with a cost.

Also, I struggled with the -crf ffmpeg option to make my webm version keep a good visual quality and reducing the weight (came up with a crf of 40 which divide the original video size by apoximatively 2, and a slight lesser quality but it is fine.

I really would have appreciated a Node.JS library for that 😁

 

I know, what you mean. But there some other approaches, I have seen, that might be getting better and better. Rust, Matlab, Scala etc.
If I am not mistaken, there is a half baked solution for Julia as well. I would still go for ffmpeg for the moment. It is the more complete solution, we have

Good to know there is other languages on the way, thank you for your inputs!

 

ffmpeg is probably the best choice. You can even configure it to output multiple files, trac.ffmpeg.org/wiki/Creating%20mu....

 

I guess it is the best way to achieve image resizing and converting to webm, thank you!

Classic DEV Post from May 1 '19

Build a 💣 Bomb-Diggity Technical Presentation (🎤 Mic Drop Optional)

The steps and process behind building a great technical presentation.

Khalyomede profile image
Web developer @ Port Adhoc