.bash_aliases
· 1.3 KiB · Bash
Eredeti
# Compress a video with CUDA acceleration (GPU from NVIDIA is required)
function reducevideo {
ffmpeg -hwaccel cuda -i "$1" -c:v libx265 -vtag hvc1 -c:a copy "$2"
}
alias reducevideo="reducevideo"
# Download videos from YouTube in full HD. Creates an JSON file with all the information about the video, includes the chapters, and more.
function ytdl {
yt-dlp --check-formats --progress -f "bv*[height<1080][ext=mp4]+ba" --write-info-json --embed-metadata --convert-thumbnail jpg --embed-thumbnail --embed-chapters --embed-info-json --sponsorblock-mark all -o "/mnt/Storage/YouTube/videos/%(channel)s/%(upload_date>%Y-%m-%d)>
}
alias ytdl="ytdl"
# Download a video from YouTube and convert it to a MP3 file. Embed the cover to the file.
function ytdla {
yt-dlp --no-call-home --no-part --add-metadata --embed-thumbnail --audio-format "mp3" --extract-audio --format bestaudio/best -x -w -o "/mnt/Storage/YouTube/audio/%(uploader)s/%(upload_date>%Y-%m-%d)s - %(title)s (%(id)s).%(ext)s" "$1"
}
alias ytdla="ytdla"
# Compress an image by reducing size and quality and remove all metadata. Inspired from Telegram.
function reduceimage {
convert -resize 2000x2000 -quality 70 "$1" "$1".r && exiftool -all= "$1".r && exiftool -delete_original "$1".r
}
alias reduceimage="reduceimage"
| 1 | # Compress a video with CUDA acceleration (GPU from NVIDIA is required) |
| 2 | function reducevideo { |
| 3 | ffmpeg -hwaccel cuda -i "$1" -c:v libx265 -vtag hvc1 -c:a copy "$2" |
| 4 | } |
| 5 | |
| 6 | alias reducevideo="reducevideo" |
| 7 | |
| 8 | |
| 9 | # Download videos from YouTube in full HD. Creates an JSON file with all the information about the video, includes the chapters, and more. |
| 10 | function ytdl { |
| 11 | yt-dlp --check-formats --progress -f "bv*[height<1080][ext=mp4]+ba" --write-info-json --embed-metadata --convert-thumbnail jpg --embed-thumbnail --embed-chapters --embed-info-json --sponsorblock-mark all -o "/mnt/Storage/YouTube/videos/%(channel)s/%(upload_date>%Y-%m-%d)> |
| 12 | } |
| 13 | |
| 14 | alias ytdl="ytdl" |
| 15 | |
| 16 | |
| 17 | # Download a video from YouTube and convert it to a MP3 file. Embed the cover to the file. |
| 18 | function ytdla { |
| 19 | yt-dlp --no-call-home --no-part --add-metadata --embed-thumbnail --audio-format "mp3" --extract-audio --format bestaudio/best -x -w -o "/mnt/Storage/YouTube/audio/%(uploader)s/%(upload_date>%Y-%m-%d)s - %(title)s (%(id)s).%(ext)s" "$1" |
| 20 | } |
| 21 | |
| 22 | alias ytdla="ytdla" |
| 23 | |
| 24 | |
| 25 | # Compress an image by reducing size and quality and remove all metadata. Inspired from Telegram. |
| 26 | function reduceimage { |
| 27 | convert -resize 2000x2000 -quality 70 "$1" "$1".r && exiftool -all= "$1".r && exiftool -delete_original "$1".r |
| 28 | } |
| 29 | |
| 30 | alias reduceimage="reduceimage" |