~thecashewtrader/cliclip

fix online video subtitle prompt being blocked due to fetching video title
add auto generation of .md file
add usage tips to README.md

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~thecashewtrader/cliclip
read/write
git@git.sr.ht:~thecashewtrader/cliclip

You can also use your local clone with git send-email.

#Introduction

cliclip is a script to create short clips from videos. It has the following features:

  • Process a local video
  • Process an online video (using yt-dlp)
  • Automatically extract and add subtitles (Using OpenAI Whisper or YouTube transcripts)
  • Automatically add intro and outro
  • Generate a .md file with metadata (Can be used as a place to store the description of the clip, if you intend to post to multiple platforms)

#Installation

wget https://git.sr.ht/~thecashewtrader/cliclip/blob/main/cliclip.sh -O ~/.local/bin/cliclip
chmod +x ~/.local/bin/cliclip

#Configuration

All the configuration options are at the top of cliclip.sh. Some things to note:

  • lf is used as the file picker by default, this can be changed in the prompt_file function.
  • By default the h264_nvenc codec is used for hardware acceleration with NVidia GPUs. You should change this codec if you have a different GPU.
  • To get all 3 files (intro, main, outro) to be the same resolution and FPS, you can use this command (Derived from $FILTER_STRING in cliclip.sh. Make sure to substitute the variables.):
ffmpeg -i "input" -vf "scale=$WIDTH:$HEIGHT:force_original_aspect_ratio=decrease,pad=$WIDTH:$HEIGHT:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=$FPS" -c:v h264_nvenc "output"

#Usage

Simply run cliclip and follow the prompts. When prompted for output, don't add any file extension. Example:

#Dependencies