How do I use ffmpeg's -filter_complex

69

Too old

Your version is way too old, and in fact I don't think it even supports any filters if I recall correctly. You can check with ffmpeg -filters.

Get a new ffmpeg

To get a recent version you can compile ffmpeg or simply download a static build. Users of Ubuntu 15.04 or newer can just install ffmpeg from the repository.

Example command

This example will:

  1. Place video1.mp4 20 pixels down and 40 pixels over.
  2. Place video2.mp4 in the middle.
  3. Combine audio from video1.mp4 and video2.mp4.

    ffmpeg -i bg.mp4 -i video1.mp4 -i video2.mp4 -filter_complex \
    "[0:v][1:v]setpts=PTS-STARTPTS,overlay=20:40[bg]; \
     [bg][2:v]setpts=PTS-STARTPTS,overlay=(W-w)/2:(H-h)/2[v]; \
     [1:a][2:a]amerge=inputs=2[a]" \
    -map "[v]" -map "[a]" -ac 2 output.mp4
    

Also see

Share:
69

Related videos on Youtube

ZioBudda
Author by

ZioBudda

Updated on September 18, 2022

Comments

  • ZioBudda
    ZioBudda almost 2 years

    I have two promises:

    getToken() //:get a CSFR cookie from the server

    and

    getUseraData() //:get user data, but it need the cookie get from getToknen() otherwise server respond with an error.

    So, I know that I can do this in my controller:

    getToken().then(function (result) {
        getUserData(result);
    });
    

    But I know that it is not so good to run a promise inside a promise.

    So: how can I exec the getUserData() promise only after that getToken is terminard and a value is returned?

    • Phil
      Phil over 9 years
      "But I know that it is not so good to run a promise inside a promise" ~ got a reference to this?
    • rtucker88
      rtucker88 over 9 years
      If you don't want to nest the anonymous function you can do getToken().then(getUserData); I'm not too sure what you're asking about though.
    • dlock
      dlock over 9 years
      why dont you use chained promises like promise.then().then()
  • llogan
    llogan over 8 years
    You must be using a super old ffmpeg. Your solution should be a last resort if you are unable to upgrade.
  • Admin
    Admin about 2 years
    @llogan No I should