{"id":27483342,"url":"https://github.com/hectorpulido/youtubers-toolkit","last_synced_at":"2025-04-16T15:45:56.647Z","repository":{"id":111766936,"uuid":"256681828","full_name":"HectorPulido/Youtubers-toolkit","owner":"HectorPulido","description":"AI Tools for video editing","archived":false,"fork":false,"pushed_at":"2025-04-04T19:23:24.000Z","size":118,"stargazers_count":34,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T20:28:25.686Z","etag":null,"topics":["ai","backend","clips","cut","mp4","silence","statistics","video-editing","youtube","youtubers-toolkit"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HectorPulido.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"publiccode":null,"codemeta":null}},"created_at":"2020-04-18T06:05:23.000Z","updated_at":"2025-04-04T19:23:27.000Z","dependencies_parsed_at":"2023-10-28T23:25:08.559Z","dependency_job_id":"0bf0c149-4296-44e3-b1ec-08db0ee42f04","html_url":"https://github.com/HectorPulido/Youtubers-toolkit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HectorPulido%2FYoutubers-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HectorPulido%2FYoutubers-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HectorPulido%2FYoutubers-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HectorPulido%2FYoutubers-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HectorPulido","download_url":"https://codeload.github.com/HectorPulido/Youtubers-toolkit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249256486,"owners_count":21238985,"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":["ai","backend","clips","cut","mp4","silence","statistics","video-editing","youtube","youtubers-toolkit"],"created_at":"2025-04-16T15:45:55.518Z","updated_at":"2025-04-16T15:45:56.630Z","avatar_url":"https://github.com/HectorPulido.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Youtubers toolkit\n\nThis project is a comprehensive command-line toolkit designed for video editing and processing tasks. It provides a modular framework to perform operations such as trimming by silence, adding subtitles, denoising audio, generating transcripts and translations, and even creating short videos with dynamic titles.\n\n## Features\n\n- **Configuration Loader:** Loads settings from a JSON file (`config.json`) to configure various operations.\n- **Video Editing Pipeline:** Supports a sequence of operations (e.g., trim by silence, add subtitles, set orientation) to edit videos.\n- **Audio Processing:** Extracts, separates, and denoises audio from video files.\n- **Voice Operations:** Utilizes AI models (e.g., Whisper, Bark) for video translation and audio generation.\n- **Short Video Generation:** Creates a video base with a blurred background and overlays content or titles.\n- **Utility Functions:** Includes tools to concatenate source files and handle subtitle splitting.\n\n## Installation\n\n### Prerequisites\n\n- **Python 3.10+**  \n- Required libraries (installable via `pip`):\n  - `moviepy`\n  - `numpy`\n  - `scipy`\n  - `whisper`\n  - `torch`\n  - `torchaudio`\n  - `pydub`\n  - `librosa`\n  - `bark` (for audio generation)\n  - _...and any additional dependencies as noted in individual modules._\n\n### Setup\n\n1. Clone the repository:\n   ```bash\n   git clone \u003crepository_url\u003e\n   cd \u003crepository_directory\u003e\n   ```\n\n2. Create and activate a virtual environment (recommended):\n   ```bash\n   python -m venv venv\n   source venv/bin/activate   # On Windows: venv\\Scripts\\activate\n   ```\n\n3. Install the required packages:\n   ```bash\n   pip install -r requirements.txt\n   ```\n   *(Ensure your `requirements.txt` lists all necessary dependencies.)*\n\n4. Configure the project by editing the `config.json` file to adjust settings such as subtitle and title clip configurations.\n\n## Usage\n\nThe main entry point is `main.py`, which provides several subcommands for different tasks. Run the following command to see available options:\n\n```bash\npython main.py --help\n```\n\n## Subcommands Overview\n\nThe CLI tool uses subcommands to select the desired functionality. You invoke the tool using one of the following subcommands:\n\n1. **video_edit** – For processing video files with a customizable pipeline of functions.\n2. **separate_audio** – To extract audio from video files.\n3. **split_str** – To split SRT subtitle files based on a specified number of words per subtitle.\n4. **voice** – To perform voice operations such as video translation or audio generation.\n5. **generator** – To generate a base video or add titles for short video production.\n\nEach subcommand has its own required and optional arguments. Use the `--help` flag with any subcommand to see detailed usage information.\n\n---\n\n## 1. Video Editing (`video_edit`)\n\n**Description:**  \nThis subcommand processes video files by applying a sequence (pipeline) of editing functions.\n\n### Usage\n```bash\npython main.py video_edit \u003cinput_file1\u003e [\u003cinput_file2\u003e ...] --pipeline \u003cfunction1\u003e [\u003cfunction2\u003e ...] [options]\n```\n\n### Arguments\n\n- **input_file** (required):  \n  One or more video file paths to process.\n\n- **--pipeline** (required):  \n  List of functions to apply to each video file.  \n  **Available functions:**\n  - `trim_by_silence`\n  - `denoise`\n  - `transcript`\n  - `subtitles`\n  - `save_separated_video`\n  - `save_join`\n  - `save_video`\n  - `set_vertical`\n  - `set_horizontal`\n\n### Options\n\n- **-c, --clip_interval**:  \n  *Type:* float, *Default:* 2  \n  *Description:* Clipping precision.\n\n- **-s, --sound_threshold**:  \n  *Type:* float, *Default:* 0.01  \n  *Description:* Maximum volume threshold to consider silence.\n\n- **-d, --discard_silence**:  \n  *Type:* boolean flag (uses a string-to-boolean converter), *Default:* False  \n  *Description:* Discard silent clips.\n\n### Example\n```bash\npython main.py video_edit video1.mp4 video2.mp4 --pipeline trim_by_silence subtitles -c 3 -s 0.02 -d True\n```\n*This applies the `trim_by_silence` and `subtitles` functions to `video1.mp4` and `video2.mp4` with a clip interval of 3 seconds and a sound threshold of 0.02, discarding silent clips.*\n\n---\n\n## 2. Separate Audio (`separate_audio`)\n\n**Description:**  \nExtracts audio from the given video files.\n\n### Usage\n```bash\npython main.py separate_audio \u003cvideo_file1\u003e [\u003cvideo_file2\u003e ...]\n```\n\n### Arguments\n\n- **files** (required):  \n  One or more video files from which to extract audio.\n\n### Example\n```bash\npython main.py separate_audio video1.mp4 video2.mp4\n```\n*This command will extract the audio from `video1.mp4` and `video2.mp4` and save them accordingly.*\n\n---\n\n## 3. Split SRT (`split_str`)\n\n**Description:**  \nSplits SRT subtitle files into smaller segments based on a specified number of words per subtitle.\n\n### Usage\n```bash\npython main.py split_str \u003csrt_file1\u003e [\u003csrt_file2\u003e ...] \u003cwords_per_subtitle\u003e\n```\n\n### Arguments\n\n- **files** (required):  \n  One or more SRT files to split.\n\n- **words_per_subtitle** (required):  \n  *Type:* integer  \n  *Description:* The number of words per subtitle segment.\n\n### Example\n```bash\npython main.py split_str subtitles.srt 5\n```\n*This will split the subtitles in `subtitles.srt` so that each subtitle contains approximately 5 words.*\n\n---\n\n## 4. Voice Operations (`voice`)\n\n**Description:**  \nPerforms voice operations such as video translation or audio generation.\n\n### Usage\n```bash\npython main.py voice \u003coperation\u003e \u003cvideo_path\u003e [options]\n```\n\n### Arguments\n\n- **operation** (required):  \n  Operation to perform. Choose between:\n  - `video_translation`\n  - `audio_generator`\n\n- **video_path** (required):  \n  The path to the video file to process.\n\n### Options\n\n- **-t, --translate**:  \n  *Type:* Model to use for translation, *Default:* `\"Helsinki-NLP/opus-mt-es-en\"`\n  *Description:* Translate the video to English or transcribe in the same language.\n\n- **--voice**:  \n  *Type:* string, *Default:* `\"en-us/af_heart\"`  \n  *Description:* Voice model to use for translation.\n\n### Example\n```bash\npython main.py voice video_translation video1.mp4 -t Helsinki-NLP/opus-mt-es-en --voice en-us/af_heart\n```\n*This translates `video1.mp4` using the specified voice model, with translation turned off (if you only want transcription).*\n\n---\n\n## 5. Short Video Generator (`generator`)\n\n**Description:**  \nGenerates a base video or adds titles to a short video.\n\n### Usage\n```bash\npython main.py generator \u003cfile1\u003e [\u003cfile2\u003e ...] \u003ctool\u003e\n```\n\n### Arguments\n\n- **files** (required):  \n  One or more files to process.\n\n- **tool** (required):  \n  The tool to use. Available options:\n  - `base` – to generate a base video.\n  - `add_titles` – to add titles to the video.\n\n### Example\n```bash\npython main.py generator video1.mp4 base\n```\n*This command uses the `base` tool on `video1.mp4` to generate a base video.*\n\n---\n\n## General Help\n\nTo display the help information for the CLI tool or a specific subcommand, use the `--help` flag. For example:\n```bash\npython main.py --help\npython main.py video_edit --help\n```\n\nThis will display all available options and arguments for that command.\n\n\n## Project Structure\n\n- **config_loader.py:** Loads configuration from `config.json` and makes it available throughout the project.\n- **main.py:** The central entry point that defines and handles multiple subcommands for video processing.\n- **automatic_short_generator.py:** A script to generate short videos using predefined tools.\n- **get_data.py:** A utility to traverse directories and concatenate files.\n- **utils/**\n  - **utils.py:** Contains helper functions (e.g., converting strings to booleans, audio extraction, video metadata extraction).\n- **operations/**\n  - **save.py:** Functions to save edited or joined video clips.\n  - **set_orientation.py:** Adjusts video orientation (vertical/horizontal).\n  - **subtitles.py:** Adds subtitles to videos.\n  - **shorts.py:** Generates base videos with effects (e.g., blurred background) and adds title clips.\n  - **transcript.py:** Generates transcripts using the Whisper model.\n  - **trim.py:** Implements silence detection and video trimming.\n  - **translation.py:** Handles video translation and audio generation.\n  - **denoise.py:** Applies denoising filters using deep learning models.\n\n## Configuration\n\nThe toolkit uses a JSON configuration file (`config.json`) to define parameters such as:\n- Subtitle and title clip settings (e.g., font, size, position).\n- Other customizable options for processing operations.\n\nAdjust these settings according to your needs before running any commands.\n\n## Contributing\n\nContributions are welcome! If you have suggestions or improvements, feel free to open an issue or submit a pull request.\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n\n\u003cdiv align=\"center\"\u003e\n\u003ch3 align=\"center\"\u003eLet's connect 😋\u003c/h3\u003e\n\u003c/div\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://www.linkedin.com/in/hector-pulido-17547369/\" target=\"blank\"\u003e\n\u003cimg align=\"center\" width=\"30px\" alt=\"Hector's LinkedIn\" src=\"https://www.vectorlogo.zone/logos/linkedin/linkedin-icon.svg\"/\u003e\u003c/a\u003e \u0026nbsp; \u0026nbsp;\n\u003ca href=\"https://twitter.com/Hector_Pulido_\" target=\"blank\"\u003e\n\u003cimg align=\"center\" width=\"30px\" alt=\"Hector's Twitter\" src=\"https://www.vectorlogo.zone/logos/twitter/twitter-official.svg\"/\u003e\u003c/a\u003e \u0026nbsp; \u0026nbsp;\n\u003ca href=\"https://www.twitch.tv/hector_pulido_\" target=\"blank\"\u003e\n\u003cimg align=\"center\" width=\"30px\" alt=\"Hector's Twitch\" src=\"https://www.vectorlogo.zone/logos/twitch/twitch-icon.svg\"/\u003e\u003c/a\u003e \u0026nbsp; \u0026nbsp;\n\u003ca href=\"https://www.youtube.com/channel/UCS_iMeH0P0nsIDPvBaJckOw\" target=\"blank\"\u003e\n\u003cimg align=\"center\" width=\"30px\" alt=\"Hector's Youtube\" src=\"https://www.vectorlogo.zone/logos/youtube/youtube-icon.svg\"/\u003e\u003c/a\u003e \u0026nbsp; \u0026nbsp;\n\u003ca href=\"https://pequesoft.net/\" target=\"blank\"\u003e\n\u003cimg align=\"center\" width=\"30px\" alt=\"Pequesoft website\" src=\"https://github.com/HectorPulido/HectorPulido/blob/master/img/pequesoft-favicon.png?raw=true\"/\u003e\u003c/a\u003e \u0026nbsp; \u0026nbsp;\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhectorpulido%2Fyoutubers-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhectorpulido%2Fyoutubers-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhectorpulido%2Fyoutubers-toolkit/lists"}