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

Method get_decoder_command

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

Source from the content-addressed store, hash-verified

15 return escaping_param_result
16
17 def get_decoder_command(self, node):
18 decoder_command = ""
19 if "start_time" in node.option.keys():
20 decoder_command = decoder_command + "-ss " + str(
21 node.option["start_time"]) + " "
22 if "dec_params" in node.option.keys():
23 for key, value in node.option["dec_params"].items():
24 decoder_command = decoder_command + "-" + key + " " + str(
25 value) + " "
26
27 if "decryption_key" in node.option.keys():
28 decoder_command = decoder_command + " -decryption_key " + node.option[
29 "decryption_key"] + " "
30 output_video_flag = False
31 output_audio_flag = False
32 for output_stream in node.get_output_stream_names():
33 if output_stream.split(":")[0] == "video":
34 self.decoder_input_streams_[output_stream.split(
35 ":")[1]] = "[{}:v] ".format(self.decoder_index_)
36 output_video_flag = True
37 elif output_stream.split(":")[0] == "audio":
38 output_audio_flag = True
39 self.decoder_input_streams_[output_stream.split(
40 ":")[1]] = "[{}:a] ".format(self.decoder_index_)
41
42 if not output_audio_flag:
43 decoder_command = decoder_command + "-an "
44 if not output_video_flag:
45 decoder_command = decoder_command + "-vn "
46
47 decoder_command = decoder_command + "-i " + node.option[
48 "input_path"] + " "
49 self.decoder_index_ = self.decoder_index_ + 1
50 return decoder_command
51
52 def get_filter_command(self, node):
53 filter_command = ""

Callers 1

get_ffmpeg_commandMethod · 0.95

Calls 2

formatMethod · 0.45

Tested by

no test coverage detected