DEV Community

Discussion on: How do you compress mp4 videos?

Collapse
iameugn profile image
imeugn

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.
Collapse
khalyomede profile image
Khalyomede Author

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 😁

Collapse
iameugn profile image
imeugn

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

Thread Thread
khalyomede profile image
Khalyomede Author

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