How to convert video into different resolutions with ffmpeg and nodejs in one command

In previous article i explained how we can install ffmpeg and run with nodejs. Today i am going to tell you how we can convert high resolution mp4 video into different resolutions according to screen resolution. Many times we need to embed video in website. But while play of high resolution video consume lot of internet and bandwidth that’s why it takes time to load. so better user experience we need to compress video for decrease its size for minimum loading time. This is code for convert high resolution video into different resolution in one command. Follow these steps.

  1. Install ffmpeg on system or server
  2. Set up node js follow this tutorial how we can install ffmpeg and run with nodejs
  3. include fluent-ffmpeg in node environment
  4. Now use this function for copy or convert mp4 into different sizes:

This code take less time if you use like that. If you use this command in different different commands then it will render one video many times so it will take time.


Add a Comment

Your email address will not be published. Required fields are marked *