{"id":28092441,"url":"https://github.com/ogrew/visp","last_synced_at":"2025-10-25T01:19:58.562Z","repository":{"id":289298303,"uuid":"969190826","full_name":"ogrew/visp","owner":"ogrew","description":"ffmpeg wrapper CLI tool written in Common Lisp","archived":false,"fork":false,"pushed_at":"2025-05-02T14:49:11.000Z","size":109,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-13T13:15:07.173Z","etag":null,"topics":["cli","ffmpeg","gif","video"],"latest_commit_sha":null,"homepage":"","language":"Common Lisp","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/ogrew.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}},"created_at":"2025-04-19T15:41:04.000Z","updated_at":"2025-05-08T06:48:38.000Z","dependencies_parsed_at":"2025-04-22T15:47:27.402Z","dependency_job_id":"1ecc977f-28f4-4d7f-82d6-2f7cf0a280d3","html_url":"https://github.com/ogrew/visp","commit_stats":null,"previous_names":["ogrew/visp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ogrew%2Fvisp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ogrew%2Fvisp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ogrew%2Fvisp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ogrew%2Fvisp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ogrew","download_url":"https://codeload.github.com/ogrew/visp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253948503,"owners_count":21988961,"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":["cli","ffmpeg","gif","video"],"created_at":"2025-05-13T13:15:12.372Z","updated_at":"2025-10-25T01:19:58.553Z","avatar_url":"https://github.com/ogrew.png","language":"Common Lisp","readme":"# Visp\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/22a5fa59-f266-485c-aa3b-e83ddb992c7c\" /\u003e\n\u003c/p\u003e\n\n## Overview\n\n`visp` is a minimal command-line wrapper around [ffmpeg](https://ffmpeg.org), written in [Common Lisp](https://common-lisp.net) for both educational and practical use.  \nIt simplifies repetitive `ffmpeg` operations like resolution conversion, audio stripping, codec switching, and more — all while auto-generating output filenames.\n\nOriginally created as a Lisp learning project, `visp` has grown into a practical tool that automates and streamlines common video encoding tasks.\n\n## Usage Examples\n\n```bash\n# Downscale a 4K video to 1080p and remove audio\nvisp --input sample_4k.mp4 --res fhd --mute\n\n# Specify resolution explicitly with width and height\nvisp --input clip.mp4 --res 1280x720\n\n# Transcode to HAP codec, preserving resolution and audio\nvisp --input sample.mov --codec hap\n\n# Preview the ffmpeg command without running it\nvisp --input sample.mov --res 2k --codec prores --dry-run\n\n# Downscale the input video to half its original resolution\nvisp --input demo.mp4 --half\n\n# Reverse the video (mute implied)\nvisp --input intro.mov --reverse\n\n# Repeat input video 4 times (original + 3 loops)\nvisp --input loopclip.mp4 --loop 3\n\n# Change playback speed to 2x\nvisp --input sample.mp4 --speed 2.0\n\n# Change playback speed to half (0.5x)\nvisp --input sample.mp4 --speed 0.5\n\n# Flip video horizontally (left-right mirror)\nvisp --input sample.mp4 --hflip\n\n# Flip video vertically (upside-down)\nvisp --input sample.mp4 --vflip\n\n# Apply multiple options together\nvisp --input raw.mp4 --res hd --codec h265 --fps 24 --mute\n\n# Specify custom output filename\nvisp --input source.mp4 --res fhd --output final_video.mp4\n\n# Merge multiple mp4 videos into one\nvisp --merge intro.mp4 scene.mp4 outro.mp4\n\n# Merge videos with custom output filename\nvisp --merge intro.mp4 scene.mp4 outro.mp4 --output compilation.mp4\n\n# Convert a video to an animated GIF (fixed size, half fps)\nvisp --gif teaser.mp4\n\n# Convert to GIF with custom output filename\nvisp --gif teaser.mp4 --output animation.gif\n\n# Apply the same options to all videos in a directory (batch processing)\nvisp --input videos/ --mono --fps 24\n```\n\nOutput filenames are automatically determined based on options.\n\nExamples:\n\n- `sample_fhd.mp4`\n- `sample_720p_30fps_noSound.mov`\n- `intro_noSound_Reverse.mp4`\n- `loopclip_x4.mp4`\n- `demo_Half.mp4`\n- `sample_2xSpeed.mp4`\n- `sample_0.5xSpeed.mp4`\n- `sample_HFlip.mp4`\n- `sample_VFlip.mp4`\n- `teaser.gif`\n\n## Options\n\n| Option      | Argument                                      | Description                                                      |\n| ----------- | --------------------------------------------- | ---------------------------------------------------------------- |\n| `--input`   | `\u003cfile or directory\u003e`                         | **Required.** Path to the input video file or directory.         |\n| `--output`  | `\u003cfilename\u003e`                                  | Custom output filename. If not specified, auto-generated based on options. |\n| `--res`     | `hd`, `fhd`, `2k`, `4k`, `8k`, `\u003cWxH\u003e`        | Target resolution (e.g. `fhd` or `1920x1080`).                   |\n| `--codec`   | `h264`, `h265`, `prores`, `hap`, `vp8`, `vp9` | Video codec (also determines container and pixel format).        |\n| `--fps`     | `\u003cnumber\u003e`                                    | Set output framerate (e.g. 24, 30, 60).                          |\n| `--mute`    | _(flag)_                                      | Strip out the audio track.                                       |\n| `--loop`    | `\u003cnumber\u003e`                                    | Loop the input video N times (e.g. `--loop 4` → repeat 3 times). |\n| `--reverse` | _(flag)_                                      | Reverse the input video (audio is automatically muted).          |\n| `--mono`    | _(flag)_                                      | Convert video to grayscale (supported only with `h264`/`h265`).  |\n| `--half`    | _(flag)_                                      | Scale input resolution down by half (e.g. 1920×1080 → 960×540).  |\n| `--speed`   | `\u003cfactor\u003e`                                    | Change playback speed (e.g. `2.0` = 2x speed, `0.5` = half speed). |\n| `--hflip`   | _(flag)_                                      | Flip video horizontally (left-right mirror).                     |\n| `--vflip`   | _(flag)_                                      | Flip video vertically (upside-down).                             |\n| `--dry-run` | _(flag)_                                      | Print the generated `ffmpeg` command without executing it.       |\n| `--help`    | _(flag)_                                      | Show usage information and exit.                                 |\n\n**Note:**  \nIf a directory is specified with `--input`, all video files in the directory will be processed in batch.\nThe generated output files will be saved in the same directory as each input file.\n\n## Merge Mode\n\nYou can also use `visp` to merge multiple `.mp4` videos into one.\n\n```bash\nvisp --merge part1.mp4 part2.mp4 part3.mp4\n```\n\nRequirements:\n\n- All input files must be `.mp4`.\n- At least two files are required.\n- Files must either all have audio, or all be silent (no mix).\n- All videos will be normalized to the **resolution and framerate** of the first file.\n- The output file will be named after the first file with `_merged.mp4` appended, or use `--output` to specify a custom filename.\n- `--dry-run` and `--output` may be combined to preview the command or customize the output filename.\n\nExample:\n\n```bash\nvisp --merge clipA.mp4 clipB.mp4 --dry-run\n```\n\nSample output:\n\n```text\n[WARN] Detected different resolutions across files. All will be scaled to 1920x1080.\n[WARN] Detected different fps values. All will be converted to 60.0fps.\n[INFO] Planned output file: clipA_merged.mp4\n[DRY-RUN] Command: ffmpeg -i clipA.mp4 -i clipB.mp4 -filter_complex \"[0:v:0]scale=1920:1080,fps=60[v0];[1:v:0]scale=1920:1080,fps=60[v1];[0:a:0][1:a:0]concat=n=2:v=1:a=1[outv][outa]\" -map \"[outv]\" -map \"[outa]\" -c:v libx264 -c:a aac -y clipA_merged.mp4\n```\n\n## GIF Mode\n\nYou can convert a single video file into an animated GIF using `visp`.\n\n```bash\nvisp --gif input.mp4\n```\n\nDetails:\n\n- Only one input file is allowed.\n- The output resolution is fixed to **640 pixels wide**, height is auto-scaled to preserve aspect ratio.\n- The output framerate is set to **half of the original video’s fps**.\n- The output file will be named after the input with `.gif` as the extension, or use `--output` to specify a custom filename.\n- Other options (e.g. `--mute`, `--res`, etc.) **cannot be combined** with `--gif`, except `--output` and `--dry-run`.\n- `--dry-run` may be used to preview the ffmpeg command.\n- A high-quality palette is generated with `palettegen`, and dithering is applied using `dither=bayer:bayer_scale=3:diff_mode=rectangle` for optimal compression and visual fidelity.\n\nExample:\n\n```bash\nvisp --gif teaser.mp4 --dry-run\n```\n\nSample output:\n\n```text\n[INFO] Planned output file: teaser.gif\n[DRY-RUN] Command: ffmpeg -i teaser.mp4 -filter_complex [0:v] fps=15.00,scale=640:-1,split [a][b];[a] palettegen=stats_mode=single [p];[b][p] paletteuse=dither=bayer:bayer_scale=3:diff_mode=rectangle:new=1 -y teaser.gif\n```\n\n## Install\n\nThe easiest way to install **visp** is now via Homebrew! 🍻\n\n\u003e **Note:** visp currently supports **Apple Silicon (arm64) Macs** only.\n\n### Install with Homebrew (Recommended)\n\nStep 1. Tap the repository:\n\n```bash\nbrew tap ogrew/visp\n```\n\nStep 2. Install visp:\n\n```bash\nbrew install visp\n```\n\nStep 3. Verify installation:\n\n```bash\nvisp --help\n```\n\nThat's it! Now you can use `visp` from anywhere.\n\n### Build from source (Alternative)\n\nIf you prefer building manually or are not using Homebrew, you can build visp from source.\n\nRequires [Roswell](https://github.com/roswell/roswell) and [SBCL](http://www.sbcl.org).\n\n```bash\ngit clone https://github.com/ogrew/visp.git\ncd visp\nros build visp.ros\n```\n\nMove the generated binary into a directory included in your `$PATH` (e.g., `/usr/local/bin`):\n\n```bash\nsudo mv visp /usr/local/bin/\nsudo chmod +x /usr/local/bin/visp\n```\n\nThen you can use it like this:\n\n```bash\nvisp --help\n```\n\n## TODO\n\nPlanned features and improvements for future versions of `visp`:\n\n- 🖼 Image sequence to video: Support for turning numbered images (e.g., `%04d.png`) into a single video.\n- 🧩 Multi-input tiling: Combine up to 4 videos into a 2×2 tiled layout.\n\n## Requirements\n\n`ffmpeg` must be installed and available in your system `PATH`.\n\nTo confirm:\n\n```bash\nwhich ffmpeg\n# /opt/homebrew/bin/ffmpeg\n\nffmpeg -version\n# ffmpeg version 7.1.1 ...\n```\n\nIf `ffmpeg` is not detected, `visp` will show an error and terminate early.\n\nDeveloper environment used:\n\n```\n$ ffmpeg -version\nffmpeg version 7.1.1 Copyright (c) 2000-2025 the FFmpeg developers\nbuilt with Apple clang version 16.0.0 (clang-1600.0.26.6)\n```\n\n## License\n\n[MIT License](https://github.com/ogrew/visp/blob/main/LICENSE)\n","funding_links":[],"categories":["Applications"],"sub_categories":["Graphics"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fogrew%2Fvisp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fogrew%2Fvisp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fogrew%2Fvisp/lists"}