def setUp(self) -> None: super().setUp() self.video_metadata = video_meta_data(width=1920, height=1080, dar=1.777777778, par=1.0, duration=300.0, frame_rate=10.0, frame_count=3000) self.source_audio_duration = 200.0 self.source_sampling_rate = 48000 self.source_samples_count = (self.source_audio_duration * self.source_sampling_rate) self.source_audio_bitrate = 128000 self.audio_metadata = audio_meta_data( duration=self.source_audio_duration, sampling_rate=self.source_sampling_rate, samples_count=self.source_samples_count, bit_rate=self.source_audio_bitrate, ) self.target_audio_bitrate = 64000 self.source = inputs.Input( input_file='input.mp4', streams=(inputs.Stream(VIDEO, meta=self.video_metadata), inputs.Stream(AUDIO, meta=self.audio_metadata))) self.output = outputs.output_file( 'output.mp4', codecs.VideoCodec('libx264'), FdkAAC(bitrate=self.target_audio_bitrate)) self.input_list = inputs.InputList((self.source, )) self.output_list = outputs.OutputList((self.output, )) self.fc = FilterComplex(self.input_list, self.output_list)
def setUp(self) -> None: super().setUp() self.video_metadata = video_meta_data(width=1920, height=1080, dar=1.777777778, par=1.0, duration=300.0, frame_rate=10.0, frame_count=3000) self.audio_metadata = audio_meta_data(duration=200.0, sampling_rate=48000, samples_count=200 * 48000) self.source = inputs.Input( input_file='input.mp4', streams=(inputs.Stream(VIDEO, meta=self.video_metadata), inputs.Stream(AUDIO, meta=self.audio_metadata))) self.output = outputs.output_file('output.mp4', codecs.VideoCodec('libx264'), codecs.AudioCodec('libfdk_aac')) self.input_list = inputs.InputList((self.source, )) self.output_list = outputs.OutputList((self.output, )) self.fc = FilterComplex(self.input_list, self.output_list)
def fc_factory(): src = inputs.input_file("input.mp4", inputs.Stream(VIDEO)) dst = outputs.output_file('output.mp4') fc = FilterComplex(inputs.InputList((src, )), outputs.OutputList((dst, ))) return fc, src, dst