Automate the creation of soccer match highlights with the power of Generative AI and AWS. This solution leverages AWS Bedrock (Anthropic’s Claude 3 Sonnet model), AWS MediaConvert, Lambda, Step Functions and other AWS services to identify and compile exciting game moments without manual editing.
Pedram Jahangiri
For a detailed explanation of what this solution does and the benefits it offers, please refer to my blog
Clone the repository in your local machine:
git clone https://github.com/iut62elec/Soccer-Highlight-Generator-with-GenAI.gitNavigate to the Soccer-Highlight-Generator-with-GenAI directory:
cd Soccer-Highlight-Generator-with-GenAISet up a virtual environment and activate it:
python3.11 -m venv .venv
source .venv/bin/activateInstall the AWS CDK and required Python packages:
npm install -g aws-cdk@latest
npm update -g aws-cdk
nvm install 18
nvm use 18
npm install -g aws-cdk@latest
pip install --upgrade pip
pip install aws-cdk.aws-lambda aws-cdk.aws-stepfunctions aws-cdk.aws-stepfunctions-tasks aws-cdk.aws-cloudfront aws_cdk.aws_cloudfront_origins aws-cdk.aws-s3-deploymentDeploy the solution using CDK:
Email subscription: Open the config.json file and add the email address where you want to receive the highlight video link
Deploy
aws configure --profile xxx
export AWS_PROFILE=XXX
cdk bootstrap
cdk deploy --profile XXXAfter the solution is deployed:
"{"file_name":"Final_2022.mp4"}"
Note: Please increase the AWS Lambda concurrent execution limit for your account to 1000 through AWS Service Quotas. This is necessary to ensure the proper functioning of the highlight generation process.
This example video highlight was generated using this solution. The tool processed an already extended highlighted video from the 2022 FIFA World Cup final between Argentina and France, originally 5 minutes long, provided by Fox. This game was chosen due to its high-scoring nature, including 6 goals and subsequent penalty shots. The generated highlight effectively removes all unnecessary moments, retaining only the goals and penalty kicks, and reduces the video to ~4 minutes. Feel free to test this tool with other games as well.
Each execution of the Soccer Highlight Generator creates certain AWS resources like a dedicated S3 bucket, DynamoDB table, and SQS queue for processing. To delete these resources for a specific video after processing:
"SoccerHighlightsStack-deletes3sqsddbLambda".If you wish to completely remove all assets associated with the Soccer Highlight Generator from your AWS account:
cdk destroyJoin the game by implementing and testing the Soccer Highlight Generator. Your feedback and contributions are welcome. Please follow the instructions in the repository and share your experiences to enhance sports entertainment with AWS and Generative AI.
This project is licensed under the MIT License.
This repository and its contents are not endorsed by or affiliated with Amazon Web Services (AWS) or any other third-party entities. It represents my personal viewpoints and not those of my past or current employers. All third-party libraries, modules, plugins, and SDKs are the property of their respective owners.