{"id":32495192,"url":"https://github.com/zebulon75018/videotools","last_synced_at":"2026-05-17T19:34:29.647Z","repository":{"id":318072004,"uuid":"1069894818","full_name":"zebulon75018/videotools","owner":"zebulon75018","description":"some stuff on video to merge with another or with a image , and draw subtitle on video","archived":false,"fork":false,"pushed_at":"2026-04-18T22:09:36.000Z","size":23317,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-18T23:37:23.246Z","etag":null,"topics":["cli","compositing","compositing-software","graphic","merge","opencv","picture","srt-subtitles","video"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zebulon75018.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-04T20:45:04.000Z","updated_at":"2026-04-18T22:09:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"8bb45764-bf16-4a75-959e-df0c073bafa6","html_url":"https://github.com/zebulon75018/videotools","commit_stats":null,"previous_names":["zebulon75018/videotools"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zebulon75018/videotools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zebulon75018%2Fvideotools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zebulon75018%2Fvideotools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zebulon75018%2Fvideotools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zebulon75018%2Fvideotools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zebulon75018","download_url":"https://codeload.github.com/zebulon75018/videotools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zebulon75018%2Fvideotools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33151815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cli","compositing","compositing-software","graphic","merge","opencv","picture","srt-subtitles","video"],"created_at":"2025-10-27T13:01:23.264Z","updated_at":"2026-05-17T19:34:29.630Z","avatar_url":"https://github.com/zebulon75018.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎬 Video Tools\n\nThis project contains tools for manipulating videos, specifically for merging videos together, or with images.\n\nThere're three program : one to blend two video , and one to blend an image to a video , and draw subtitle with word speaking.\n![merge](https://github.com/zebulon75018/videotools/blob/main/img/bigbunny.png?raw=true) \n+ \n![merge](https://github.com/zebulon75018/videotools/blob/main/img/giphy2.gif?raw=true)  \n = \n![merge](https://github.com/zebulon75018/videotools/blob/main/img/mergeimg2video.png?raw=true)\n\n\nSubtitle with soeanking  word\n![](https://github.com/zebulon75018/videotools/blob/main/img/subtitle.gif?raw=true?raw=true)\n\n\nThe crop directory contains a qt/gui to crop a video.\n\n![preview](https://github.com/zebulon75018/videotools/blob/main/crop/preview.gif?raw=true)\n\n\n## ✨ Features\n\n*   ✅ **Merge 2 videos** (main + overlay)\n*   ✅ **Merge a video with an image** (with PNG alpha channel support)\n*   ✅ **Temporal Alignment** : `START` (beginning), `END` (end), `FRAME` (specific frame), `TIMESTAMP` (specific time in seconds)\n*   ✅ **Overlay Positioning** : `top-left`, `top-right`, `bottom-left`, `bottom-right`, `center`, or custom coordinates (`custom`)\n*   ✅ **Chroma Key** : make a specific color transparent (green by default)\n*   ✅ **Resizing** of the overlay video or image\n*   ✅ **Adjustable tolerance** for chroma key\n*   ✅ **Opacity Control** for image overlays (`mergeimagetovideo`)\n*   ✅ **Automatic audio integration** from the main video (via `ffmpeg`)\n*   ✅ **Draw subtitle** from the main video with a srt and a .json specific file.\n  \n\n## 🛠️ Compilation Instructions\n\n### Prerequisites\n\nMake sure you have the following dependencies installed:\n\n**On Ubuntu/Debian:**\n\n```bash\nsudo apt-get install cmake build-essential libopencv-dev ffmpeg\n```\n\n**On macOS (with Homebrew):**\n\n```bash\nbrew install cmake opencv ffmpeg\n```\n\n**On Windows:**\n\n1.  Install [OpenCV](https://opencv.org/releases/) and configure environment variables.\n2.  Download [ffmpeg](https://ffmpeg.org/download.html) and add it to your `PATH`.\n3.  Install [CMake](https://cmake.org/download/).\n4.  Install a C++ compiler (e.g., MinGW or Visual Studio).\n\n### How to hav specific json file for word speaking hightlight\n\n```\ngit clone https://github.com/SYSTRAN/faster-whisper\nor pip faster-whisper\n```\n```\npython  makejsonsubtitle.py exampleaudio.mp3 sample.json\n```\n\n\n### Compilation\n\nGet the 2 include files: \n\nhttps://github.com/saurabhshri/simple-yet-powerful-srt-subtitle-parser-cpp ( srtparser.h )\n\nhttps://github.com/nlohmann/json (single header: json.hpp)\n\n\n1.  **Create a `build` folder and navigate into it:**\n\n    ```bash\n    mkdir build\n    cd build\n    ```\n\n2.  **Configure with CMake:**\n\n    ```bash\n    cmake ..\n    ```\n\n3.  **Compile:**\n\n    ```bash\n    cmake --build .\n    # Or using make if you have it\n    # make\n    ```\n\n    After compilation, you will find two executables in the `build/` folder: `video_merger` and `mergeimagetovideo`.\n\n\n### Integrated Help\n\nYou can always get help on command-line options:\n\n```bash\n./video_merger --help\n\nUsage: ./video_merger [options]\nOptions:\n  -m, --main \u003cfile\u003e          Video principale (requise)\n  -o, --overlay \u003cfile\u003e       Video d'incrustation (requise)\n  -out, --output \u003cfile\u003e      Video de sortie (défaut: output.avi)\n  -p, --position \u003cpos\u003e       Position: topleft|topright|bottomleft|bottomright|center|custom\n  -x \u003cpixels\u003e                Position X personnalisée (avec --position custom)\n  -y \u003cpixels\u003e                Position Y personnalisée (avec --position custom)\n  -a, --align \u003calign\u003e        Alignement temporel: start|end|frame|timestamp (défaut: start)\n  -f, --frame \u003cnumber\u003e       Frame de début pour l'overlay (avec --align frame)\n  -ts, --timestamp \u003csec\u003e     Timestamp de début en secondes (avec --align timestamp)\n  -c, --chroma \u003cr,g,b\u003e       Activer chroma key avec couleur RGB (ex: 0,255,0 pour vert)\n  -t, --tolerance \u003cval\u003e      Tolérance du chroma key (défaut: 40)\n  -s, --scale \u003cfloat\u003e        Échelle de la vidéo overlay (défaut: 1.0)\n  -h, --help                 Afficher cette aide\n\nExemples d'alignement temporel:\n  start       : Overlay commence au début de la vidéo principale\n  end         : Overlay se termine avec la fin de la vidéo principale\n  frame       : Overlay commence à une frame spécifique (-f)\n  timestamp   : Overlay commence à un timestamp spécifique (-ts)\n\n```\n\n\n```bash\n./mergeimagetovideo --help\n\nUsage: ./mergeimagetovideo [options]\n\nDescription:\n  Fusionne une image sur une vidéo avec support de transparence et positionnement.\n\nOptions requises:\n  -v, --video \u003cfile\u003e         Vidéo principale (requise)\n  -i, --image \u003cfile\u003e         Image à incruster (requise)\n\nOptions de sortie:\n  -out, --output \u003cfile\u003e      Vidéo de sortie (défaut: output.avi)\n\nOptions de positionnement:\n  -p, --position \u003cpos\u003e       Position: topleft|topright|bottomleft|bottomright|center|custom\n                             (défaut: topleft)\n  -x \u003cpixels\u003e                Position X personnalisée (avec --position custom)\n  -y \u003cpixels\u003e                Position Y personnalisée (avec --position custom)\n\nOptions temporelles:\n  -a, --align \u003calign\u003e        Alignement: start|end|frame|timestamp (défaut: start)\n  -f, --frame \u003cnumber\u003e       Frame de début (avec --align frame)\n  -ts, --timestamp \u003csec\u003e     Timestamp de début en secondes (avec --align timestamp)\n  -d, --duration \u003cframes\u003e    Durée en frames (-1 = reste de la vidéo)\n\nOptions visuelles:\n  -s, --scale \u003cfloat\u003e        Échelle de l'image (défaut: 1.0)\n  -op, --opacity \u003cfloat\u003e     Opacité de l'image: 0.0 (transparent) à 1.0 (opaque)\n  -c, --chroma \u003cr,g,b\u003e       Activer chroma key avec couleur RGB (ex: 0,255,0)\n  -t, --tolerance \u003cval\u003e      Tolérance du chroma key (défaut: 40)\n  --no-alpha                 Ignorer le canal alpha du PNG\n\nAutres:\n  -h, --help                 Afficher cette aide\n\n```\n\n```bash\n./mergeimagetovideo --help\n\nUsage: ./mergeimagetovideo [options]\n\nDescription:\n  Fusionne une image sur une vidéo avec support de transparence et positionnement.\n\nOptions requises:\n  -v, --video \u003cfile\u003e         Vidéo principale (requise)\n  -i, --image \u003cfile\u003e         Image à incruster (requise)\n\nOptions de sortie:\n  -out, --output \u003cfile\u003e      Vidéo de sortie (défaut: output.avi)\n\nOptions de positionnement:\n  -p, --position \u003cpos\u003e       Position: topleft|topright|bottomleft|bottomright|center|custom\n                             (défaut: topleft)\n  -x \u003cpixels\u003e                Position X personnalisée (avec --position custom)\n  -y \u003cpixels\u003e                Position Y personnalisée (avec --position custom)\n\nOptions temporelles:\n  -a, --align \u003calign\u003e        Alignement: start|end|frame|timestamp (défaut: start)\n  -f, --frame \u003cnumber\u003e       Frame de début (avec --align frame)\n  -ts, --timestamp \u003csec\u003e     Timestamp de début en secondes (avec --align timestamp)\n  -d, --duration \u003cframes\u003e    Durée en frames (-1 = reste de la vidéo)\n\nOptions visuelles:\n  -s, --scale \u003cfloat\u003e        Échelle de l'image (défaut: 1.0)\n  -op, --opacity \u003cfloat\u003e     Opacité de l'image: 0.0 (transparent) à 1.0 (opaque)\n  -c, --chroma \u003cr,g,b\u003e       Activer chroma key avec couleur RGB (ex: 0,255,0)\n  -t, --tolerance \u003cval\u003e      Tolérance du chroma key (défaut: 40)\n  --no-alpha                 Ignorer le canal alpha du PNG\n\nAutres:\n  -h, --help                 Afficher cette aide\n\n```\n\n```bash\nsage:\n  ./videoSubRenderer \u003cinput_video\u003e \u003coutput_video\u003e \u003csubtitles.(srt|json)\u003e\n     [--font-size N] [ --font (path ttf) ] [--thickness T]\n     [--color B,G,R] [--position top|bottom] [--center 0|1]\n     [--margin-x PX] [--margin-y PX] [--line-gap PX]\n     [--keep-html 0|1]\n     [--outline 0|1] [--outline-thickness T] [--outline-color B,G,R]\n     [--bg 0|1] [--bg-color B,G,R] [--bg-alpha A] [--bg-pad-x PX] [--bg-pad-y PX]\n     [--safe-pct P]\n     [--max-width-pct P]\n     [--karaoke 0|1] [--hl-scale F] [--hl-thickness T] [--hl-color B,G,R]\n\nNotes:\n  - .srt via srtparser.h ; .json = tableau d'objets {start,end,text,words:[{word,start,end},...]}\n  - color/outline-color/bg-color en B,G,R (OpenCV). bg-alpha dans [0..1].\n  - safe-pct applique des marges minimales en % (title safe).\n  - max-width-pct: largeur max du bloc sous-titres après marges/safe.\n```\n\u003cimg width=\"777\" height=\"234\" alt=\"image\" src=\"https://github.com/user-attachments/assets/b6a0d1a9-7d15-4bb9-8344-66506803b68e\" /\u003e\n\n![](https://github.com/zebulon75018/videotools/blob/main/img/subtitle2.png?raw=true)\n\n\n\n\n## 🚀 Usage Examples\n\n### 1. `video_merger` (Video + Video / Image Merging)\n\nThis tool is designed to merge one video onto another video, or an image onto a video.\n\n```bash\n# Basic example - top-left video overlay\n./video_merger -m main_video.mp4 -o overlay.mp4 -out result.avi\n\n# With green chroma key (transparent green background)\n./video_merger -m main.mp4 -o green_screen.mp4 -out result.avi -c 0,255,0\n\n# Bottom-right position, end alignment\n./video_merger -m main.mp4 -o overlay.mp4 -out result.avi \\\n  -p bottomright -a end\n\n# Custom position with coordinates\n./video_merger -m main.mp4 -o overlay.mp4 -out result.avi \\\n  -p custom -x 100 -y 50\n\n# With resizing (50% of the original size)\n./video_merger -m main.mp4 -o overlay.mp4 -out result.avi \\\n  -s 0.5 -p topright\n\n# Blue chroma key with high tolerance\n./video_merger -m main.mp4 -o blue_screen.mp4 -out result.avi \\\n  -c 0,0,255 -t 60\n\n# New temporal parameters for overlay:\n\n# 1. By frame (-a frame -f \u003cnumber\u003e)\n# Starts the overlay at a specific frame\n./video_merger -m main.mp4 -o overlay.mp4 -a frame -f 150 -out result.avi\n\n# 2. By timestamp (-a timestamp -ts \u003cseconds\u003e)\n# Starts the overlay at a precise time in seconds\n./video_merger -m main.mp4 -o overlay.mp4 -a timestamp -ts 5.5 -out result.avi\n\n# Start at 1 minute 30 seconds\n./video_merger -m main.mp4 -o overlay.mp4 -ts 90 -out result.avi\n\n# 3. At the beginning (-a start - default)\n# The overlay starts from the beginning\n./video_merger -m main.mp4 -o overlay.mp4 -a start -out result.avi\n\n# 4. At the end (-a end)\n# The overlay ends at the same time as the main video\n./video_merger -m main.mp4 -o overlay.mp4 -a end -out result.avi\n\n# Complete examples:\n\n# Overlay with green background, starts at 10 seconds, bottom-right\n./video_merger -m main.mp4 -o green_screen.mp4 \\\n  -c 0,255,0 -ts 10 -p bottomright -out result.avi\n\n# Overlay at 50% size, starts at frame 200, custom position\n./video_merger -m main.mp4 -o overlay.mp4 \\\n  -s 0.5 -f 200 -p custom -x 100 -y 50 -out result.avi\n\n# Centered overlay that ends with the main video\n./video_merger -m main.mp4 -o overlay.mp4 \\\n  -a end -p center -out result.avi\n\n# Combine everything: chroma key + timestamp + position\n./video_merger -m main.mp4 -o overlay.mp4 \\\n  -c 0,255,0 -t 50 -ts 15.5 -p topright -s 0.75 -out result.avi\n\n# Audio from the main video is automatically included!\n# If ffmpeg is installed: Audio is integrated automatically\n# If ffmpeg is not installed: The program will display a command to run manually\n```\n\n### 2. `mergeimagetovideo` (Video + Image Merging only)\n\nThis application is specifically optimized for merging an image (with or without PNG transparency) onto a video, with precise opacity and duration controls.\n\n```bash\n# Logo / Watermark\n\n# PNG with native transparency\n./mergeimagetovideo -v video.mp4 -i logo_transparent.png -p topright\n\n# Ignore alpha channel if needed\n./mergeimagetovideo -v video.mp4 -i image.png --no-alpha\n\n# Semi-transparent watermark (50%)\n./mergeimagetovideo -v video.mp4 -i watermark.png -op 0.5 -p center\n\n# Very subtle logo (20%)\n./mergeimagetovideo -v video.mp4 -i logo.png -op 0.2 -p bottomright\n\n# Top-right logo, 30% size\n./mergeimagetovideo -v video.mp4 -i logo.png -p topright -s 0.3\n\n# Centered watermark with 30% transparency\n./mergeimagetovideo -v video.mp4 -i watermark.png -p center -op 0.3\n\n# Bottom-left logo for the entire video\n./mergeimagetovideo -v video.mp4 -i brand.png -p bottomleft -s 0.2\n\n\n# Temporary Image\n\n# Image from 5s to 15s (300 frames at 30fps)\n./mergeimagetovideo -v video.mp4 -i overlay.jpg -ts 5 -d 300 -p center\n\n# Image at frame 100, duration 200 frames\n./mergeimagetovideo -v video.mp4 -i image.png -f 100 -d 200\n\n# Image that appears at the end (last 5 seconds)\n./mergeimagetovideo -v video.mp4 -i end_screen.jpg -a end -d 150\n\n\n# Chroma Key\n\n# Image with transparent green background\n./mergeimagetovideo -v video.mp4 -i image_green.jpg \\\n  -c 0,255,0 -t 40 -p center\n\n# Image with blue background, semi-transparent\n./mergeimagetovideo -v video.mp4 -i blue_bg.png \\\n  -c 0,0,255 -op 0.7 -p topright\n\n\n# Advanced Combinations\n\n# Transparent PNG logo, custom position, 80% opacity\n./mergeimagetovideo -v video.mp4 -i logo.png \\\n  -p custom -x 50 -y 50 -op 0.8 -s 0.5\n\n# Watermark with chroma key + opacity\n./mergeimagetovideo -v video.mp4 -i watermark.jpg \\\n  -c 255,255,255 -t 30 -op 0.4 -p bottomright\n\n# Image that appears gradually (simulated by opacity)\n./mergeimagetovideo -v video.mp4 -i overlay.png \\\n  -ts 10 -d 90 -p center -op 0.6\n```\n\n### 3. `videoSubRenderer` (Video + subtitle (srt) or json )\n\nFond semi-opaque + outline + safe area 10% :\n```\n./video_sub in.mp4 out.mp4 subs.srt \\\n  --bg 1 --bg-color 0,0,0 --bg-alpha 0.45 --bg-pad-x 28 --bg-pad-y 16 \\\n  --outline 1 --outline-thickness 4 --outline-color 0,0,0 \\\n  --safe-pct 10 --thickness 2 --color 255,255,255 --position bottom --center 1\n```\n\nFond seul (barre en haut) :\n\n```\n./video_sub in.mp4 out.mp4 subs.srt \\\n  --position top --center 0 --margin-x 60 --bg 1 --bg-alpha 0.35 --bg-color 0,0,0\n```\n\n```\n./video_sub in.mp4 out.mp4 subs.srt \\\n  --bg 1 --bg-color 0,0,0 --bg-alpha 0.4 --bg-pad-x 28 --bg-pad-y 16 \\\n  --outline 1 --outline-thickness 4 --outline-color 0,0,0 \\\n  --safe-pct 10 --max-width-pct 85\n```\n\n\n\n## 📂 Project Structure\n\n```\nvideo-merger/\n├── CMakeLists.txt\n├── main.cpp                    # Source code for 'video_merger' (video + video/image)\n├── mergeimagetovideo.cpp       # Source code for 'mergeimagetovideo' (video + image only)\n└── build/\n    ├── video_merger            # Executable after compilation\n    └── mergeimagetovideo       # Executable after compilation\n```\n\nThe program displays real-time progress and saves the result in AVI format (MJPEG codec). You can change the codec in the code if needed!\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzebulon75018%2Fvideotools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzebulon75018%2Fvideotools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzebulon75018%2Fvideotools/lists"}