ytclip is a tiny macOS command line tool for creating video clips from timestamped YouTube URLs.
By default, ytclip optimizes clips for easy sharing in chats and on phones by preferring source video around 480p and producing a compact MP4. Use --hq when you want a higher-quality clip instead.
ytclip exists to make it easy to grab a short clip from a YouTube video without opening a video editor or manually calculating timestamps.
- macOS
- Homebrew
yt-dlpffmpeg
Install dependencies:
brew install yt-dlp ffmpegManual installation:
chmod +x ytclip
sudo cp ytclip /usr/local/bin/ytclipInstall with the included script:
./install.shInstall from the latest public GitHub release:
brew install yt-dlp ffmpeg
curl -LO https://github.com/LaurentPerche/ytclip/releases/download/v0.3.0/ytclip-v0.3.0.zip
unzip ytclip-v0.3.0.zip
chmod +x ytclip install.sh uninstall.sh
./install.shInstall from the latest public GitHub release with GitHub CLI:
brew install gh
brew install yt-dlp ffmpeg
gh release download v0.3.0 -R LaurentPerche/ytclip -p 'ytclip-v0.3.0.zip'
unzip ytclip-v0.3.0.zip
chmod +x ytclip install.sh uninstall.sh
./install.shCommand format:
ytclip [--hq] <duration_seconds_or_end_timestamp> [youtube_url] [output_file]Examples:
ytclip 109
ytclip 42:12
ytclip --hq 109
ytclip --hq 42:12
ytclip 109 "https://youtu.be/HGbA6ze0_3M?si=kULAuwqlZvokp0yJ&t=2423"
ytclip 42:12 "https://youtu.be/HGbA6ze0_3M?si=kULAuwqlZvokp0yJ&t=2423"
ytclip 109 "https://www.youtube.com/watch?v=abc123&t=23m32s" "$HOME/Downloads/my_clip.mp4"ytclip is optimized for compact, shareable clips by default.
- It prefers downloading source video at or below roughly
480pwhen available. - It encodes the final clip as a smaller H.264/AAC MP4 for easier sending in chats and messaging apps.
- It does not upscale lower-resolution source video.
Use high-quality mode when you want the best available source and a less compressed final MP4:
ytclip --hq 109--hqdownloads the highest available source instead of capping around480p.--hquses a higher-quality encode profile instead of the compact default.--hqkeeps the same output format and command flow.
Duration mode treats the first argument as the clip length in seconds:
ytclip 109Endpoint mode treats the first argument as the absolute video timestamp where the clip should end:
ytclip 42:12If the copied YouTube URL starts at 40:23 and you run ytclip 42:12, ytclip calculates the clip duration as 42:12 - 40:23 = 109 seconds.
If no URL is provided, ytclip reads the YouTube URL from the macOS clipboard using pbpaste.
By default, files are saved to:
~/Downloads/The default filename format is:
youtube_clip_YYYYMMDD_HHMMSS.mp4The default output is optimized for shareability rather than archival quality. Use --hq when quality matters more than file size.
yt-dlp: command not found
- Install it with
brew install yt-dlp
ffmpeg: command not found
- Install it with
brew install ffmpeg
no timestamp found
- Make sure the YouTube URL includes a timestamp such as
?t=2423,?t=23m32s, or?start=2423
endpoint must be after the start timestamp
- Use an endpoint that comes later than the timestamp embedded in the YouTube URL
Use this tool only for videos you own, have permission to use, or where clipping is permitted by applicable rights and platform terms.
MIT