Skip to content

Commit

Permalink
Merge pull request #14 from stephengpope/fix/update-options-input
Browse files Browse the repository at this point in the history
updated the options format
  • Loading branch information
stephengpope authored Sep 19, 2024
2 parents 6f4ef73 + 3de6ee9 commit f036ec9
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 f036ec9

Please sign in to comment.