MCPcopy Create free account
hub / github.com/BabitMF/bmf / get_encoder_command

Method get_encoder_command

bmf/ffmpeg_engine/engine.py:158–189  ·  view source on GitHub ↗
(self, node)

Source from the content-addressed store, hash-verified

156 return map_string
157
158 def get_encoder_command(self, node):
159 # get video map
160 video_map_string = self.get_encoder_map(node.get_input_stream_names(),
161 0)
162 video_command = ""
163 if "video_params" in node.option.keys():
164 video_command = self.get_encoder_video_param(
165 node.option["video_params"])
166 if video_command == "" and not video_map_string == "":
167 video_command = "-vsync vfr -r 120 "
168
169 # get audio map
170 audio_map_string = self.get_encoder_map(node.get_input_stream_names(),
171 1)
172 audio_command = ""
173 if "audio_params" in node.option.keys():
174 audio_command = self.get_encoder_audio_param(
175 node.option["audio_params"])
176
177 mux_command = ""
178 if "mux_params" in node.option.keys():
179 mux_command = self.get_encoder_mux_param(node.option["mux_params"])
180
181 format_command = ""
182 if "format" in node.option.keys():
183 format_command = "-f " + node.option["format"] + " "
184 else:
185 format_command = "-f " + "mp4" + " "
186
187 encoder_command = video_map_string + video_command + audio_map_string + audio_command + mux_command + \
188 format_command + node.option["output_path"] + " "
189 return encoder_command
190
191 def get_ffmpeg_command(self, graph_config):
192 ffmpeg_path = os.getenv('FFMPEG_BIN_PATH')

Callers 1

get_ffmpeg_commandMethod · 0.95

Calls 5

get_encoder_mapMethod · 0.95
get_encoder_mux_paramMethod · 0.95

Tested by

no test coverage detected