Hacker News new | past | comments | ask | show | jobs | submit login

-filter_complex specifies a series of filters that accept inputs and return outputs. Any value contained in brackets ([]), is a value that can be input or output by a filter. [0:v],[0:a],[1:v],[1:a] are values supplied by ffmpeg representing the video and audio streams of the 1st and 2nd inputs, in this case input1.mp4 and input2.mp4.

The first filter, concat, takes in a set of synchronized audio and video segments, concatenates them, and returns the resulting audio and video clips. n specifies the number of segments, v specifies the number of output video clips, and a specifies the number of output audio clips. The results are saved to the values of [v] and [a] for video and audio respectively.

The eq filter then takes the [v] video returned by concat, and adjusts the value to a brightness of 0.3. For reference, 0 represent no change to the brightness.

This [v] value is then mapped to the output video using -map.

That being said, this filter isn't correct, as the [a] value is never used or mapped, so the filter would fail. The correct way to write the filter, if the intended use is to discard the audio, would be:

  -filter_complex "[0:v][1:v]concat[v];[v]eq=brightness=0.3[outv]"
I omitted the n,v, and a values in the concat filter, as they are by default 2,1, and 0 respectively.

Another way to visualize this filter in an imperative style would look like this:

  def filter(input0, input1) {
    v = concat(input0.v,input1.v);
    outv = eq(v,brightness=0.3);
    return outv;
  }



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: