4 ms·
It really works! With few interactions, ChatGPT was able to create a not so obvious -filter_complex pipeline, like: ffmpeg -ss 00:01:00 -t 00:02:00 -i input1
by amadvance 4y ago
It really works! With few interactions, ChatGPT was able to create a not so obvious -filter_complex pipeline, like:
ffmpeg -ss 00:01:00 -t 00:02:00 -i input1.mp4 -ss 00:03:00 -t 00:02:30 -i input2.mp4 -filter_complex "[0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1[v][a];[v]eq=brightness=0.3[outv]" -map "[outv]" output.mp4
- pjc50 4y agoAnd what does all that filter_complex do?
- nolok 4y agoI understand what you mean. But I also understand my sister doesn't need to know how her phone does any of what it does to play candy crush or read her emails. Just like she doesn't need to know how a microwave works to reheat her meal. If you want to know how things are done, of course get yourself involved in the details, but for most things in life you just want to use it without bothering with the details, so you can focus of the parts that are of interests to you. (I know some people like to know the details of everything, and maybe you are one of them, and that's great, but the vast majority of people do not)
- pancrufty 4y agoI think you can ask that to ChatGPT in a follow up question ;)
- suzumer 4y ago-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; }
- m3kw9 4y agoI asked gpt3 and here is what it said: This command uses FFmpeg to create a single output video file from two input video files. It starts by specifying a start and duration for each of the two files (input1.mp4 and input2.mp4). It then applies a filter complex to the two files, which combines the two videos and audio into one stream, and adds a brightness filter with a value of 0.3. Finally, it maps the output video stream to the output file (output.mp4).