From e175fefa18e5939b737aeaa6102e37ae75fd3674 Mon Sep 17 00:00:00 2001 From: Michael Campagnaro Date: Sat, 20 Jan 2024 22:19:57 -0500 Subject: [PATCH] Alias and vid compression tweaks --- .aliases | 18 ++++++++++++------ dotfiles/bin/compress-video | 4 ++-- dotfiles/bin/compress-video-with-crf | 2 -- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.aliases b/.aliases index 52bdf47..3a62593 100644 --- a/.aliases +++ b/.aliases @@ -189,6 +189,11 @@ alias ls='ls -F --color' alias l='ls -lh' alias ll='ls -lha' +mkcd() { + mkdir -p "${1}" + cd "${1}" +} + alias aliases='vim ~/.aliases' alias al='aliases' @@ -993,8 +998,8 @@ alias yt-list-desc='download_youtube_uploads_list 1 ' alias yt='download_youtube_vid "" $SHORTNAME_OFF $TRANSCRIBE_OFF' alias yt-shortname='download_youtube_vid "" $SHORTNAME_ON $TRANSCRIBE_OFF' -alias yt-1440='download_youtube_vid "400+140" $SHORTNAME_OFF $TRANSCRIBE_OFF' -alias yt-1440-shortname='download_youtube_vid "400+140" $SHORTNAME_OFF $TRANSCRIBE_OFF' +alias yt-1440='download_youtube_vid "620+140" $SHORTNAME_OFF $TRANSCRIBE_OFF' +alias yt-1440-shortname='download_youtube_vid "620+140" $SHORTNAME_OFF $TRANSCRIBE_OFF' alias yt-1080='download_youtube_vid "137+140" $SHORTNAME_OFF $TRANSCRIBE_OFF' alias yt-1080-shortname='download_youtube_vid "137+140" $SHORTNAME_ON $TRANSCRIBE_OFF' alias yt-720='download_youtube_vid "136+140" $SHORTNAME_OFF $TRANSCRIBE_OFF' @@ -1002,8 +1007,8 @@ alias yt-720-shortname='download_youtube_vid "136+140" $SHORTNAME_ON $TRANSC #TRANSCRIPTION ON alias ytt='download_youtube_vid "" $SHORTNAME_OFF $TRANSCRIBE_ON' alias yt-shortname-t='download_youtube_vid "" $SHORTNAME_ON $TRANSCRIBE_ON' -alias yt-1440-t='download_youtube_vid "400+140" $SHORTNAME_OFF $TRANSCRIBE_ON' -alias yt-1440-shortname-t='download_youtube_vid "400+140" $SHORTNAME_ON $TRANSCRIBE_ON' +alias yt-1440-t='download_youtube_vid "620+140" $SHORTNAME_OFF $TRANSCRIBE_ON' +alias yt-1440-shortname-t='download_youtube_vid "620+140" $SHORTNAME_ON $TRANSCRIBE_ON' alias yt-1080-t='download_youtube_vid "137+140" $SHORTNAME_OFF $TRANSCRIBE_ON' alias yt-1080-shortname-t='download_youtube_vid "137+140" $SHORTNAME_ON $TRANSCRIBE_ON' alias yt-720-t='download_youtube_vid "136+140" $SHORTNAME_OFF $TRANSCRIBE_ON' @@ -1011,7 +1016,7 @@ alias yt-720-shortname-t='download_youtube_vid "136+140" $SHORTNAME_ON $TRANSC #--------------------------- alias yt-playlist='download_youtube_playlist ""' alias yt-playlist-list='download_youtube_playlist_list ' -alias yt-playlist-1440='download_youtube_playlist "400+140"' +alias yt-playlist-1440='download_youtube_playlist "620+140"' alias yt-playlist-1080='download_youtube_playlist "137+140"' alias yt-playlist-720='download_youtube_playlist "136+140"' alias yt-playlist-tiny='download_youtube_playlist "160+140"' @@ -1136,9 +1141,10 @@ alias compress-video-hard='_compress_video_hard' alias cv='compress-video' alias cvh='compress-video-hard' -alias tv='trim-video' +alias jv='join-video' alias nv='normalize-volume' alias na='normalize-volume' +alias tv='trim-video' #################################################################################################### # Git diff --git a/dotfiles/bin/compress-video b/dotfiles/bin/compress-video index 68c39ee..a671c81 100644 --- a/dotfiles/bin/compress-video +++ b/dotfiles/bin/compress-video @@ -37,10 +37,10 @@ if [[ $# > 2 ]]; then use_gpu=$3 fi -# Found the following to work best with vids containing text (e.g. programming vid): 25 for CPU encoding and 27 for GPU. +# Found the following to work best with vids containing text (e.g. programming vid): 21 for CPU encoding and 28 for GPU (similar bitrates). use_crf=21 if [[ $use_gpu -eq 1 ]]; then - use_crf=25 + use_crf=28 fi compress-video-with-crf $use_crf "$filename" "$output_name" $use_gpu diff --git a/dotfiles/bin/compress-video-with-crf b/dotfiles/bin/compress-video-with-crf index 75b4914..0aef54d 100644 --- a/dotfiles/bin/compress-video-with-crf +++ b/dotfiles/bin/compress-video-with-crf @@ -65,8 +65,6 @@ function encode() { fi if [[ $use_gpu -eq 1 ]]; then - # File will be slightly larger than CPU encoding, but it's much faster to transcode and doesn't max out the CPU cores. - # RTX 3080 ffmpeg -y -stats -loglevel level+error $timing_args -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -i "$filename.$extension" -c:a copy -c:v h264_nvenc -profile:v high -rc:v vbr_hq -cq:v $crf -b:v 5M -maxrate 5M -max_muxing_queue_size 9999 "$output"