Git Product home page Git Product logo

ffmpeg-syntax-overview's Introduction

0. Extract metadata of video

ffprobe \
    -v quiet \
    -print_format json \
    -show_format \
    -show_streams \
    ./media/cmd00/input.mp4 \
    > meta.json

or

ffmpeg -i ./media/cmd00/input.mp4 

1. Simple filter

1.1 Crop video with dimension 640x360 into video with dimension 202x360 (cropped part should be centered relatively the main video):

ffmpeg \
    -i ./media/cmd01/input.mp4 \
    -vf "crop=x=219:y=0:w=202:h=360" \
     ./cmd01_out_01.mp4

You may also use the short version of command and skip parameters name, but you need follow the right order of parameters according to doc:

ffmpeg \
    -i ./media/cmd01/input.mp4 \
    -vf "crop=202:360:219:0" \
     ./cmd01_out_01.mp4

1.2 Crop a landscape video into a portrait video with aspect ration 9x16 (cropped part should be centered relatively the main video):

ffmpeg \
    -i ./media/cmd01/input.mp4 \
    -vf "crop=x=(in_w-ow)/2:y=0:w=in_h*9/16:h=in_h" \
    ./cmd01_out_02.mp4

2. Filter chain

At first we need to crop landscape video into partrait with aspect ratio 9x16 and after horizontally flip it

ffmpeg \
    -i ./media/cmd02/input.mp4 \
    -vf "crop=x=(in_w-ow)/2:y=0:w=in_h*9/16:h=in_hhflip" \
    ./cmd02_out.mp4

3. Filter Graphs

ffmpeg \
    -i ./media/cmd03/laptop_stream.mov \
    -i ./media/cmd03/stage_stream.mp4 \
    -i ./media/cmd03/logo.jpg \
    -filter_complex "[0][1:v]overlay=x=W-w:y=H-h:shortest=1[screenWithStage];[screenWithStage][2]overlay" \
    ./cmd03_out.mp4

ffmpeg-syntax-overview's People

Contributors

topolev avatar

Stargazers

Euhan Sarkar avatar

Watchers

Vladimir Topolev 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.