Giter Club home page Giter Club logo

awesome-ffmpeg's Introduction

Awesome FFMPEG

Useful commands for FFMPEG used to convert video and audio files. Feel free to contribute with a PR!

Summary

⚠️ In this document, user vars will be marked with a $. $FILE for your input or output file, $INPUT for your input file, $OUTPUT for your output file, etc

Links

⬆️ Go to top

Installation

Integration

Packages

Video commands

⬆️ Go to top

Convert video for the web

Where $WITH is the desired video width.

VP9 (.webm)

ffmpeg -i $INPUT -vcodec libvpx -acodec libvorbis -ac 2 -b:a 96k -ar 44100 -vf scale=$WIDTH:-1 -map 0 $OUTPUT.webm

H264 (.mp4)

ffmpeg -i $INPUT -vcodec libx264 -acodec libfdk_aac -ac 2 -ar 48000 -b:a 96k -vf scale=$WIDTH:-1 -map 0 $OUTPUT.mp4

Vorbis (.ogv)

ffmpeg -i $INPUT -vcodec libtheora -acodec libvorbis -b:a 96k -vf scale=$WIDTH:-1 -map 0 $OUTPUT.ogv

Video to GIF

ffmpeg -i $INPUT $OUTPUT.gif

Cut a video without re-encoding (fast)

Where $START and $END are the timecodes in format HH:MM:SS.

ffmpeg -i $INPUT -ss $START -to $END -c copy $OUTPUT
# Ex: ffmpeg -i video.mp4 -ss 00:00:00 -to 00:01:30 -c copy cut.mp4

Extract images from a video every X seconds

Where $RATE is desired images per second: 0.5 for 1 image every 2 seconds, 0.1 for 1 image every 10 seconds, etc).

ffmepg -i $INPUT -r $RATE -f image2 $OUTPUT_%05d.jpg
# Ex: ffmepg -i awesome_goal.mp4 -r 0.1 -f image2 goal_%05d.jpg

Loop a video into a longest one

Where $ITERATION is the desired video loops.

ffmpeg -stream_loop $ITERATION -i $INPUT -c copy $OUTPUT

Rip a DVD to a MP4

Where $PATH is your DVD path containing .VOB files. $QUALITY is the desired video quality (0 is lossless, 51 is highly compressed, 23-28 is nice).

cat $PATH/VTS_0_*.VOB | ffmpeg -i - -c:v libx264 -crf $QUALITY $OUTPUT.mp4

Audio commands

⬆️ Go to top

Extract audio from a video in MP3

Where $BITRATE is the desired audio bitrate (96, 128, 192, 256, 320).

ffmpeg -i $INPUT -vn -ar 44100 -ac 2 -ab $BITRATE -f mp3 $OUTPUT.mp3
# Ex: ffmpeg -i i_love_rock_n_roll.mp4 -vn -ar 44100 -ac 2 -ab 192 -f mp3 i_love_rock_n_roll.mp3

Miscellaneous

⬆️ Go to top

Get file infos

ffmpeg -i $FILE

Get file infos in JSON format

ffprobe -loglevel quiet -show_format -show_streams -print_format json $FILE

Codec guides

⬆️ Go to top

Video

Audio

Miscellaneous

Blog posts

⬆️ Go to top

awesome-ffmpeg's People

Contributors

marceauka avatar

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.