diff --git a/bin/compress-video-with-crf b/bin/compress-video-with-crf index 13b3219..a28e13b 100644 --- a/bin/compress-video-with-crf +++ b/bin/compress-video-with-crf @@ -52,14 +52,7 @@ function encode() { 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. - - #ffmpeg version N-103152-gef54590f83-20210806 - # This version of ffmpeg results in larger files than version 4.3.1 command below. - #ffmpeg -y -stats -loglevel level+error $timing_args -vsync 0 -hwaccel_output_format cuda -c:v h264_cuvid -i "$filename.$extension" -c:a copy -c:v h264_nvenc -profile:v high -rc:v vbr -cq:v $crf -b:v 5M -maxrate 5M -max_muxing_queue_size 9999 "$output" - - #ffmpeg version 4.3.1-2020-11-08 - ffmpeg -y -stats -loglevel level+error $timing_args -vsync 0 -hwaccel cuvid -c:v h264_cuvid -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" - + 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" else ffmpeg $timing_args -i "$filename.$extension" -c:v libx264 -crf $crf -preset veryfast -profile:v baseline -level 3.0 -strict -2 "$output" fi diff --git a/bin/join-video b/bin/join-video new file mode 100644 index 0000000..45daf02 --- /dev/null +++ b/bin/join-video @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +if which tput >/dev/null 2>&1; then + ncolors=$(tput colors) +fi +if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then + RED="$(tput setaf 1)" + GREEN="$(tput setaf 2)" + YELLOW="$(tput setaf 3)" + BLUE="$(tput setaf 4)" + MAGENTA="$(tput setaf 5)" + CYAN="$(tput setaf 6)" + BOLD="$(tput bold)" + NORMAL="$(tput sgr0)" +else + RED="" + GREEN="" + YELLOW="" + BLUE="" + MAGENTA="" + CYAN="" + BOLD="" + NORMAL="" +fi + +filename=$(basename -- "$1") +output_name="$2" + +if [[ $filename == "" || $output_name == "" ]]; then + printf "${BOLD}${RED}Usage: create a text file that lists the input video paths on separate lines using the format: file '/path/to/video'. Then call:\n\n$0 ${NORMAL}\n" + exit 1 +fi + +output="${output_name}.mp4" + +printf "\n${YELLOW}${BOLD}Joining contents of '$filename'| output: $output${NORMAL}\n" + +ffmpeg -f concat -safe 0 -i "$filename" -c copy "$output" + +printf "\n${GREEN}${BOLD}Finished joining${NORMAL}\n\n" + diff --git a/bin/vim-pull b/bin/vim-pull index 8ef3bc7..4fc9de9 100644 --- a/bin/vim-pull +++ b/bin/vim-pull @@ -12,4 +12,5 @@ if [ -d $src ]; then [ -d "$src/colors" ] && echo "Syncing user colors" && cp -r "$src/colors" $dest [ -d "$src/after" ] && echo "Syncing after directory" && cp -r "$src/after" $dest [ -d "$src/ftdetect" ] && echo "Syncing ftdetect" && cp -r "$src/ftdetect" $dest + [ -d "$src/autoload" ] && echo "Syncing autoload" && cp -r "$src/autoload" $dest fi diff --git a/bin/vim-push b/bin/vim-push index a858095..f0061af 100644 --- a/bin/vim-push +++ b/bin/vim-push @@ -12,4 +12,5 @@ if [ -d $src ]; then [ -d "$src/colors" ] && echo "Syncing user colors" && cp -r "$src/colors" $dest [ -d "$src/after" ] && echo "Syncing after directory" && cp -r "$src/after" $dest [ -d "$src/ftdetect" ] && echo "Syncing ftdetect" && cp -r "$src/ftdetect" $dest + [ -d "$src/autoload" ] && echo "Syncing autoload" && cp -r "$src/autoload" $dest fi