Skip to content

Commit

Permalink
updated the options format
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen G Pope authored and Stephen G Pope committed Sep 19, 2024
1 parent 6f4ef73 commit 3de6ee9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions services/caption_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ def process_captioning(file_url, caption_srt, options, job_id):

output_path = os.path.join(STORAGE_PATH, f"{job_id}_captioned.mp4")

options = convert_array_to_collection(options)

# Default FFmpeg options
ffmpeg_options = {
'font_name': None,
Expand Down Expand Up @@ -154,3 +156,6 @@ def process_captioning(file_url, caption_srt, options, job_id):
except Exception as e:
logger.error(f"Job {job_id}: Error in process_captioning: {str(e)}")
raise

def convert_array_to_collection(options):
return {item["option"]: item["value"] for item in options}

0 comments on commit 3de6ee9

Please sign in to comment.