added a transcoding function to shell
This commit is contained in:
1
.zshrc
1
.zshrc
@@ -32,3 +32,4 @@ alias vinix="nvim --cmd 'cd ~/.dotfiles/.nixos'"
|
||||
alias man='man -P "bat -p"'
|
||||
|
||||
source ~/.zshrc-local
|
||||
source ~/.zshrc-functions
|
||||
|
||||
17
.zshrc-functions
Normal file
17
.zshrc-functions
Normal 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"
|
||||
}
|
||||
Reference in New Issue
Block a user