@@ -60,7 +60,11 @@ def raise_if_task_not_runnable(task: celery_interface.SessionTask) -> None:
60
60
raise task .retry (** retry_kwargs , exc = RuntimeError ("Updater is running" ))
61
61
62
62
63
- def run_ffmpeg_for_video_to_m4a_and_mp3 (video_path : pt .Path , coverart_path : pt .Path ) -> dict [str , pt .Path ]:
63
+ def run_ffmpeg_for_video_to_m4a_and_mp3 (
64
+ video_path : pt .Path ,
65
+ coverart_path : pt .Path ,
66
+ ffmpeg_cmd : str = "ffmpeg" ,
67
+ ) -> dict [str , pt .Path ]:
64
68
"""ffmpeg를 이용해 영상 파일을 m4a와 mp3 파일로 변환하는 명령어를 생성합니다."""
65
69
target_video_path = video_path
66
70
target_coverart_path = coverart_path
@@ -82,12 +86,12 @@ def run_ffmpeg_for_video_to_m4a_and_mp3(video_path: pt.Path, coverart_path: pt.P
82
86
merged_node : ffmpeg .nodes .Node = ffmpeg .merge_outputs (mp3_output_node , m4a_output_node )
83
87
84
88
if docker_util .is_container ():
85
- compiled_args : list [str ] = ffmpeg .compile (merged_node , overwrite_output = True )
89
+ compiled_args : list [str ] = ffmpeg .compile (merged_node , overwrite_output = True , cmd = ffmpeg_cmd )
86
90
stdout , stderr = docker_util .run_cmd_on_host (compiled_args )
87
91
logger .warning (f"ffmpeg stdout:\n { stdout } " )
88
92
logger .warning (f"ffmpeg stderr:\n { stderr } " )
89
93
else :
90
- ffmpeg_run : tuple [str , str ] = ffmpeg .run (merged_node , overwrite_output = True , quiet = True )
94
+ ffmpeg_run : tuple [str , str ] = ffmpeg .run (merged_node , overwrite_output = True , quiet = True , cmd = ffmpeg_cmd )
91
95
stdout , stderr = ffmpeg_run
92
96
logger .warning (f"ffmpeg stdout:\n { stdout } " )
93
97
logger .warning (f"ffmpeg stderr:\n { stderr } " )
@@ -107,7 +111,8 @@ def ytdl_downloader_task(self: celery_interface.SessionTask[None], *, youtube_vi
107
111
file_paths ["video" ] = download_info .file_path
108
112
file_paths ["thumbnail" ] = youtube_util .download_thumbnail (youtube_vid , save_dir )
109
113
110
- audio_paths = run_ffmpeg_for_video_to_m4a_and_mp3 (file_paths ["video" ], file_paths ["thumbnail" ])
114
+ ffmpeg_cmd = self .config_obj .project .ssco .ffmpeg_cmd
115
+ audio_paths = run_ffmpeg_for_video_to_m4a_and_mp3 (file_paths ["video" ], file_paths ["thumbnail" ], ffmpeg_cmd )
111
116
file_paths |= audio_paths
112
117
file_download_urls : dict [str , str ] = {}
113
118
0 commit comments