{"id":13612157,"url":"https://github.com/NisaarAgharia/AI-Shorts-Creator","last_synced_at":"2025-04-13T11:31:32.371Z","repository":{"id":170066656,"uuid":"646179300","full_name":"NisaarAgharia/AI-Shorts-Creator","owner":"NisaarAgharia","description":"AI-Video-Cropper is a Python-based tool that leverages the power of GPT-4 (OpenAI's language model) to automatically analyze videos, extract the most interesting sections, and crop them for improved viewing experience. This project combines the capabilities of GPT-4, FFmpeg, and OpenCV to automate the process of identifying highlights in videos","archived":false,"fork":false,"pushed_at":"2023-07-22T07:20:32.000Z","size":96,"stargazers_count":308,"open_issues_count":7,"forks_count":78,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-02-14T02:08:05.295Z","etag":null,"topics":["face-detection","ffmpeg","gpt4","openai","opencv","python","youtube"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NisaarAgharia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-05-27T14:40:58.000Z","updated_at":"2024-02-14T02:08:08.484Z","dependencies_parsed_at":null,"dependency_job_id":"7d218747-c4ac-4b21-9f2c-1c084856d33b","html_url":"https://github.com/NisaarAgharia/AI-Shorts-Creator","commit_stats":null,"previous_names":["nisaaragharia/ai-video-cropper"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NisaarAgharia%2FAI-Shorts-Creator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NisaarAgharia%2FAI-Shorts-Creator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NisaarAgharia%2FAI-Shorts-Creator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NisaarAgharia%2FAI-Shorts-Creator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NisaarAgharia","download_url":"https://codeload.github.com/NisaarAgharia/AI-Shorts-Creator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248705667,"owners_count":21148574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["face-detection","ffmpeg","gpt4","openai","opencv","python","youtube"],"created_at":"2024-08-01T20:00:23.599Z","updated_at":"2025-04-13T11:31:32.138Z","avatar_url":"https://github.com/NisaarAgharia.png","language":"Jupyter Notebook","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"#AI-Shorts-Creator! 🎥✂️ (WIP, You Might face some Bugs)\n\nAI-Shorts-Creator is a powerful tool designed for content creators, podcasters, and video enthusiasts to effortlessly extract captivating segments from their videos. Leveraging the advanced language model GPT-4, this innovative solution intelligently analyzes video transcripts to identify the most viral and exciting moments. By harnessing the capabilities of FFmpeg and OpenCV, AI-Shorts-Creator automatically crops videos, allowing you to focus on the key highlights and provide an enhanced viewing experience.\n\n## AI-Shorts-Creator is a powerful tool designed to:\n\n- Automatically extract captivating segments from videos.\n- Identify the most viral and exciting moments using GPT-4.\n- Crop videos to emphasize key highlights with precise face detection.\n- Streamline video editing and save time by eliminating manual searching.\n- Work seamlessly with various video formats for maximum compatibility.\n- Enhance the viewing experience for your audience with perfectly cropped highlights.\n\n\n## Examples: \n\nSource Video : https://www.youtube.com/watch?v=NHaczOsMQ20\n![thumbnail](https://github.com/NisaarAgharia/AI-Video-Cropper/assets/22457544/7dbf9b92-2a08-4948-bb49-e41350ae4a02)\n\n## Output Shorts:\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/NisaarAgharia/AI-Video-Cropper/assets/22457544/81b0759b-7cc9-4622-9440-3ccf9400ede2\" alt=\"Demo GIF 1\" width=\"280\"/\u003e\n  \u003cimg src=\"https://github.com/NisaarAgharia/AI-Video-Cropper/assets/22457544/f3ea6e7d-f999-4597-87fc-0166c1be7840\" alt=\"Demo GIF 2\" width=\"280\"/\u003e\n  \u003cimg src=\"https://github.com/NisaarAgharia/AI-Video-Cropper/assets/22457544/8aeeb666-cff0-493a-8a9a-18780badd79f\" alt=\"Demo GIF 3\" width=\"280\"/\u003e\n\u003c/div\u003e\n\n\nhttps://github.com/NisaarAgharia/AI-Shorts-Creator/assets/22457544/318c8cf1-bcc3-4ed7-a979-7af17e545e6e\n\n\nGet started with AI-Shorts-Creator today and unlock the potential of your videos like never before!\n\nRequirements\n- Python 3.x\n- `pytube` library (install with `pip install pytube`)\n- `opencv-python` library (install with `pip install opencv-python`)\n- `openai` library (install with `pip install openai`)\n- `youtube-transcript-api` library (install with `pip install youtube-transcript-api`)\n- FFmpeg (install according to your operating system)\n\n## Usage\n\n1. Install the required libraries by running the following command:\n\n```shell\npip install -r requirements.txt\n```\n\n2. Install FFmpeg by following the installation instructions for your operating system. Make sure the `ffmpeg` command is accessible from the command line.\n\n3. Set up your OpenAI API key by replacing `openai.api_key = ''` with your actual OpenAI API key.\n\n4. Modify the `video_id` variable in the `main()` function to specify the YouTube video you want to process.\n\n5. Run the script:\n\n```shell\npython auto_cropper.py\n```\n\nThe script will download the YouTube video, analyze its transcript using OpenAI's GPT-4, extract the best sections based on the analysis, crop the video using FFmpeg, and apply face detection using OpenCV to further refine the cropping.\n\n## Additional Information\n\n- The `download_video(url, filename)` function downloads a YouTube video by providing the URL and specifying the filename.\n- The `segment_video(response)` function segments the video into interesting sections based on a transcript analysis using OpenAI's GPT-4 model.\n- The `detect_faces(video_file)` function uses face detection to identify faces in a video file.\n- The `crop_video(faces, input_file, output_file)` function crops the video around the detected faces using FFmpeg.\n- The `is_talking_in_batch(frames)` function analyzes the lip movement or facial muscle activity within a batch of frames to determine if talking behavior is present.\n- The `adjust_focus(frame, talking)` function applies visual effects or adjustments to emphasize the speaker in the frame.\n\nPlease note that the GPT-4 model and transcript analysis functionality in the provided code are simulated and not fully functional. You would need a valid OpenAI API key and a working GPT-4 model to perform transcript analysis.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNisaarAgharia%2FAI-Shorts-Creator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNisaarAgharia%2FAI-Shorts-Creator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNisaarAgharia%2FAI-Shorts-Creator/lists"}