added a transcoding function to shell

This commit is contained in:
2026-06-23 16:16:50 +01:00
parent 44fb4e1bc1
commit e103f51ef3
2 changed files with 18 additions and 0 deletions

1
.zshrc
View File

@@ -32,3 +32,4 @@ alias vinix="nvim --cmd 'cd ~/.dotfiles/.nixos'"
alias man='man -P "bat -p"' alias man='man -P "bat -p"'
source ~/.zshrc-local source ~/.zshrc-local
source ~/.zshrc-functions

17
.zshrc-functions Normal file
View File

@@ -0,0 +1,17 @@
transcode-youtube() {
# Check if both input and output files are provided
if [ "$#" -ne 1 ]; then
echo "Usage: transcode-youtube <video number>"
return 1
fi
ffmpeg -vaapi_device /dev/dri/renderD128 -i "youtube-raw/vid$1.mov" \
-vf "format=nv12,hwupload" \
-c:v h264_vaapi -profile:v high -level 4.2 \
-rc_mode VBR -b:v 50M -maxrate 70M -bufsize 100M \
-g 120 -bf 2 \
-color_primaries bt709 -color_trc bt709 -colorspace bt709 \
-c:a aac -b:a 384k -ar 48000 \
-movflags +faststart \
"youtube-archive/vid-$1.mp4"
}