-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Description
Giving the command line options like below defeats the purpose of having a python wrapper for FFmpeg:
>>> ff = FFmpeg(
... inputs={'input.ts': None},
... outputs={'output.mp4': '-c:a mp2 -c:v mpeg2video'}
... )
and
>>> ff = FFmpeg(
... inputs={'input.ts': None},
... outputs={
... 'video.mp4': ['-map', '0:0', '-c:a', 'copy', '-f', 'mp4'],
... 'audio.mp4': ['-map', '0:1', '-c:a', 'copy', '-f', 'mp4']
... }
... )
Instead consider using an object oriented approach to do the same thing:
input = InputBuilder(fileName)
.codec(codec)
.filter(filter)
... etc
.build()
ff = FFmpeg(
inputs = [input],
outputs = [output]
)
ff.run()
With this approach you gain the following:
- Hide away the implementation details of ffmpeg
- Allow the user to work at a higher level of abstraction
- Remove the need to understand both ffmpeg and your wrapper
- Abstract complex behavior behind simple interfaces
Metadata
Metadata
Assignees
Labels
No labels