Compare commits

..

No commits in common. "78fd8f6d454f34b982952e7451718a54df496b95" and "c0dd5208a050ea421cb8b824e08ebf761c14aace" have entirely different histories.

6 changed files with 74 additions and 42 deletions

View File

@ -23,25 +23,20 @@ else
NORMAL="" NORMAL=""
fi fi
use_gpu=0 use_gpu=$1
filename=$(basename -- "$2")
output_name="$3"
if [[ $# < 2 || $# > 3 ]]; then if [[ $use_gpu == "" || $2 == "" || $output_name == "" ]]; then
printf "${BOLD}${RED}Usage: $0 <filename> <output name> <optional: use-gpu (1|0), defaults to $use_gpu> ${NORMAL}\n" printf "${BOLD}${RED}Usage: $0 <use-gpu (1|0)> <filename> <output name>${NORMAL}\n"
exit 1 exit 1
fi fi
filename=$(basename -- "$1")
output_name="$2"
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): 25 for CPU encoding and 27 for GPU.
use_crf=21 use_crf=21
if [[ $use_gpu -eq 1 ]]; then if [[ $use_gpu -eq 1 ]]; then
use_crf=25 use_crf=25
fi fi
compress-video-with-crf $use_crf "$filename" "$output_name" $use_gpu compress-video-with-crf $use_gpu $use_crf "$filename" "$output_name"

View File

@ -0,0 +1,44 @@
#!/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
use_gpu=$1
filename=$(basename -- "$2")
output_name="$3"
start_time="$4"
end_time="$5"
if [[ $use_gpu == "" || $2 == "" || $output_name == "" || $start_time == "" || $end_time == "" ]]; then
printf "${BOLD}${RED}Usage: $0 <use-gpu (1|0)> <filename> <output name> <start time HH:MM:SS> <end time HH:MM:SS>${NORMAL}\n"
exit 1
fi
# Found the following to work best with vids containing text (e.g. programming vid): 25 for CPU encoding and 27 for GPU.
use_crf=25
if [[ $use_gpu -eq 1 ]]; then
use_crf=27
fi
compress-video-with-crf $use_gpu $use_crf "$filename" "$output_name" "$start_time" "$end_time"

View File

@ -23,36 +23,22 @@ else
NORMAL="" NORMAL=""
fi fi
use_gpu=0 use_gpu=$1
use_crf=$2
output_name="$4"
start_time="$5"
end_time="$6"
if [[ "$#" < 3 || "$#" > 6 ]]; then if [[ $use_gpu == "" || $use_crf == "" || $3 == "" || $output_name == "" || ($start_time != "" && $end_time == "") ]]; then
printf "${BOLD}${RED}Usage: $0 <crf value> <filename> <output name> <optional: use-gpu (1|0), defaults to $use_gpu> <optional: start time HH:MM:SS> <optional: end time HH:MM:SS>\n\nIf you want to encode a range of CRF values then use -1 as the crf value.${NORMAL}\n" printf "${BOLD}${RED}Usage: $0 <use-gpu (1|0)> <crf value> <filename> <output name> <optional start time HH:MM:SS> <optional end time HH:MM:SS>\n\nIf you want to encode a range of CRF values then use -1 as the crf value.${NORMAL}\n"
exit 1 exit 1
fi fi
use_crf=$1
filename=$(basename -- "$2") filename=$(basename -- "$3")
extension="${filename##*.}" extension="${filename##*.}"
filename="${filename%.*}" filename="${filename%.*}"
output_name="$3"
if [[ "$#" > 3 ]]; then
use_gpu=$4
if [[ "$#" > 4 ]]; then
start_time="$5"
if [[ "$#" > 5 ]]; then
end_time="$6"
fi
fi
fi
if [[ $use_gpu -ne 0 && $use_gpu -ne 1 ]]; then
printf "${BOLD}${RED}Invalid use_gpu value. Got $use_gpu, but expected either 0 or 1${NORMAL}\n"
exit 1
fi
function encode() { function encode() {
crf=$1 crf=$1
output="${output_name}.$extension" output="${output_name}.$extension"

16
vimrc
View File

@ -221,16 +221,16 @@ Plug 'dracula/vim', { 'as': 'dracula' }
" SYNTAX HIGHLIGHTING " SYNTAX HIGHLIGHTING
"////////////////////////////// "//////////////////////////////
Plug 'rluba/jai.vim' " Jai Plug 'tpope/vim-markdown' " Markdown
Plug 'bfrg/vim-cpp-modern' " C/C++ Plug 'bfrg/vim-cpp-modern' " C/C++
Plug 'rluba/jai.vim' " Jai
Plug 'vim-ruby/vim-ruby' " Ruby
Plug 'fatih/vim-go' " Go
Plug 'rust-lang/rust.vim' " Rust
Plug 'jdonaldson/vaxe' " Haxe
Plug 'pprovost/vim-ps1' " PowerShell
Plug 'fedorenchik/fasm.vim' " Flat Assembler Plug 'fedorenchik/fasm.vim' " Flat Assembler
Plug 'elixir-editors/vim-elixir' " Elixir Plug 'elixir-editors/vim-elixir' " Elixir
Plug 'pprovost/vim-ps1' " PowerShell
Plug 'tpope/vim-markdown' " Markdown
"Plug 'vim-ruby/vim-ruby' " Ruby
"Plug 'fatih/vim-go' " Go
"Plug 'rust-lang/rust.vim' " Rust
"Plug 'jdonaldson/vaxe' " Haxe
"////////////////////////////// "//////////////////////////////
@ -394,7 +394,7 @@ augroup campoCmds
autocmd FileType gitcommit setlocal colorcolumn=72 autocmd FileType gitcommit setlocal colorcolumn=72
" @flagged for removal. It's a bit annoying. autocmd BufRead,BufNewFile *.{md,txt,plan} exec "setlocal textwidth=".g:campo_max_line_length " @flagged for removal. It's a bit annoying. autocmd BufRead,BufNewFile *.{md,txt,plan} exec "setlocal textwidth=".g:campo_max_line_length
" Enable spell checking by default. " Spell checking.
autocmd FileType gitcommit,markdown,text setlocal spell autocmd FileType gitcommit,markdown,text setlocal spell
" Jump to last cursor position unless it's invalid or in an event handler. " Jump to last cursor position unless it's invalid or in an event handler.

6
vm/virtualbox-setup.md Normal file
View File

@ -0,0 +1,6 @@
# Linux Mint
* uninstall guest utils that comes with the install: `sudo apt-get remove virtualbox-guest-utils`
* Click `Devices / Insert Guest Additions CD image`
* Navigate to it in `/media`
* Run `sudo ./VBoxLinuxAdditions.run`

View File

@ -103,8 +103,9 @@ processor time and is generally useless.
* Enable/disable various Window features: * Enable/disable various Window features:
* Go to Add/Remove Programs -> Turn Windows features on or off * Go to Add/Remove Programs -> Turn Windows features on or off
* Enable:
* Windows hypervisor platform
* Disable: * Disable:
* Windows hypervisor platform (can break Virtualbox)
* Internet Explorer 11 * Internet Explorer 11
* Legacy Components - DirectPlay * Legacy Components - DirectPlay
* Media Features - Windows Media Player * Media Features - Windows Media Player