Jafner.net/dotfiles/utility-scripts/ffmpeg/quick-ffmpeg
Joey Hafner 97e4cc547a
Init Jafner.net monorepo from constituent repos:
1. homelab [Gitea](https://gitea.jafner.tools/Jafner/homelab), [Github (docker_config)](https://github.com/Jafner/docker_config), [Github (wiki)](https://github.com/Jafner/wiki), [Github (cloud_tools)](https://github.com/Jafner/cloud_tools), [Github (self-hosting)](https://github.com/Jafner/self-hosting).
   - Rename? Jafner.net? Wouldn't that be `Jafner/Jafner.net/Jafner.net`?
2. Jafner.dev [Github](https://github.com/Jafner/Jafner.dev).
3. dotfiles [Gitea](https://gitea.jafner.tools/Jafner/dotfiles), [Github](https://github.com/Jafner/dotfiles).
4. nvgm [Gitea](https://gitea.jafner.tools/Jafner/nvgm)
5. pamidi [Gitea](https://gitea.jafner.tools/Jafner/pamidi), [Github](https://github.com/Jafner/pamidi)
6. docker-llm-amd [Gitea](https://gitea.jafner.tools/Jafner/docker-llm-amd)
7. doradash [Gitea](https://gitea.jafner.tools/Jafner/doradash)
8. clip-it-and-ship-it [Gitea (PyClipIt)](https://gitea.jafner.tools/Jafner/PyClipIt), [Github](https://github.com/Jafner/clip-it-and-ship-it).
9. razer battery led [Github](https://github.com/Jafner/Razer-BatteryLevelRGB)
10. 5etools-docker [Github](https://github.com/Jafner/5etools-docker)
11. jafner-homebrew [Github](https://github.com/Jafner/jafner-homebrew)
2024-07-15 15:35:16 -07:00

43 lines
1.6 KiB
Bash

#!/bin/bash
# The purpose of this script is to provide a quick graphical interface
# for post-processing video recordings with sensibly-constrained options
# Is is built initially to be called by a Dolphin Servicemenu onto a specific
# file. Not intended for batch processing.
# 1. Parse input filename into parts.
# - Presumes: '[YYYY-MM-DD] HH-mm-ss.ext' format
# - Presumes the user wants to name the file without losing the date information
# 2. Figure out what the user wants to do with the file.
# 2.1. Rename the video? If so, how?
# 2.1.1. Set name? (Leave blank for HH-mm-ss).
# 2.1.2. Keep date?
# 2.2. Transcode the video? If so, how?
# 2.2.1. AV1
# 2.2.1.1. CRF [15-28]
# 2.2.1.2. ABR [2-100 Mbps]
# 2.2.2. x264
# 2.2.2.1. CQP [15-28]
# 2.2.2.2. CBR [2-100 Mbps]
# 2.2.3. x265
# 2.2.3.1. CQP [15-28]
# 2.2.3.2. CBR [2-100 Mbps]
# 2.3. Remux the video? If so, how?
# 2.3.1. To mp4 (default)
# 2.4. Upload the video? If so, how to format resulting share link?
# 2.4.1 Markdown (default): [$FILE_NAME]($LINK_TO_FILE)
# 2.4.2 Plain link: $LINK_TO_FILE
INPUT_FILE="$1"
INPUT_FILE=$(realpath "$INPUT_FILE")
FILE_PATH=$(dirname "$INPUT_FILE")
FILE_NAME=$(basename "$INPUT_FILE")
FILE_EXT="${FILE_NAME##*.}"
FILE_NAME="${FILE_NAME%.*}"
OUTFILE=$(echo "$FILE_PATH/$FILE_NAME.av1.$FILE_EXT")
notify-send -t 2000 "Transcode starting" "$FILE_NAME"
ffmpeg -hide_banner -vaapi_device /dev/dri/renderD128 -i "$INPUT_FILE" -map 0 -vf 'format=nv12,hwupload' -c:v av1_vaapi -crf 18 -b:v 6000k "$OUTFILE" > /dev/null
notify-send -t 4000 "Transcode complete" "$FILE_NAME"