In the ffmpeg-python docs, they used following design pattern for their examples:
(
ffmpeg
.input('dummy.mp4')
.filter('fps', fps=25, round='up')
.output('dummy2.mp4')
.run()
)
How is this design pattern called, where can I find more information about it, and what are the pros and cons of it ?
This design pattern called builder, you can read about it in here
basically, all the command (except run) change the object, and return it self, which allow you to "build" the object as it go on.
in my opinion is very usefull things, in query building is super good, and can be simplify a code.
think about db query you want to build, lets say we use
sql
.