Coder Social home page Coder Social logo

price-ventures-webflow's Introduction

Proper video encoding is essential. Need to re-arrange the video frames in a way where each frame is a keyframe That will avoid the jumpiness

The FFMPEG CLI code used to achieve that:

MP4 compression

ffmpeg -i price-ventures-web-loop-compressed.mp4 -filter:v "setpts=0.1*PTS" -s 1920x1080 -r 30 -g 1 -movflags faststart -c:v libx264 -b:v 1M -crf 28 -an -pix_fmt yuv420p price-ventures-header-1920w-7s-1mBit-crf28.mp4

WebM compression

ffmpeg -i price-ventures-web-loop-compressed.mp4 -filter:v "setpts=0.25*PTS" -s 1280x720 -r 30 -movflags faststart -c:v libvpx-vp9 -b:v 500K -crf 30 -an -g 1 -pix_fmt yuv420p price-ventures-header-1280-encoded.webm

Note:

  • -filter:v "setpts=0.25*PTS" speeds up the video duration to a quarter (1/4th) of its current duration
  • The -crf 30 is the video quality. The lower the number, better the quality. 20-30 is usually considered good enough balance between quality and compression
  • -b:v 500K is the bitrate (500k stands for 500kb. Higher the bitrate, higher the video quality)
  • price-ventures-web-loop-compressed.mp4 is the source file. Change the name to the video file name in the folder

Edit on StackBlitz ⚡️

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.