summaryrefslogtreecommitdiffstats
path: root/2022
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2022-10-12 13:01:03 -0400
committerSacha Chua <sacha@sachachua.com>2022-10-12 13:01:03 -0400
commit592fd3caff408914a97f2669b86ee49f7271b488 (patch)
treefc26eb01d4666c8390e248cdc980b31b523cd867 /2022
parent195d699d70d47f5298c279d00682be657a0ccf13 (diff)
downloademacsconf-wiki-592fd3caff408914a97f2669b86ee49f7271b488.tar.xz
emacsconf-wiki-592fd3caff408914a97f2669b86ee49f7271b488.zip
Add scripts for compression
Diffstat (limited to '')
-rw-r--r--2022/organizers-notebook/index.org44
1 files changed, 44 insertions, 0 deletions
diff --git a/2022/organizers-notebook/index.org b/2022/organizers-notebook/index.org
index b7a53b9f..74d72100 100644
--- a/2022/organizers-notebook/index.org
+++ b/2022/organizers-notebook/index.org
@@ -929,7 +929,51 @@ ffmpeg -y -i "$1" -c:v libvpx-vp9 -b:v 0 -crf $Q -c:a copy -tile-columns 2 -tile
We tried using q56 before, but it was a little too aggressive. Q=32 is the default and is probably a reasonable space vs. quality compromise.
+2020 version used with parallel
+
+#+begin_src sh :tangle get-and-compress.sh :eval no
+Q=$1
+WIDTH=1280
+HEIGHT=720
+AUDIO_RATE=48000
+VIDEO_FILTER="scale=w=${WIDTH}:h=${HEIGHT}:force_original_aspect_ratio=1,pad=${WIDTH}:${HEIGHT}:(ow-iw)/2:(oh-ih)/2,fps=25,colorspace=all=bt709:iall=bt601-6-625:fast=1"
+FILE=$2
+SUFFIX=$Q
+shift
+shift
+if [ ! -f $FILE ]; then
+ wget https://mirror.csclub.uwaterloo.ca/emacsconf/2020/$FILE
+fi
+ffmpeg -y -i "$FILE" -pixel_format yuv420p -vf $VIDEO_FILTER -colorspace 1 -color_primaries 1 -color_trc 1 -c:v libvpx-vp9 -b:v 0 -crf $Q -aq-mode 2 -tile-columns 0 -tile-rows 0 -frame-parallel 0 -cpu-used 8 -auto-alt-ref 1 -lag-in-frames 25 -g 240 -pass 1 -f webm -an -threads 8 /dev/null &&
+if [[ $FILE =~ "webm" ]]; then
+ ffmpeg -y -i "$FILE" $* -pixel_format yuv420p -vf $VIDEO_FILTER -colorspace 1 -color_primaries 1 -color_trc 1 -c:v libvpx-vp9 -b:v 0 -crf $Q -tile-columns 2 -tile-rows 2 -frame-parallel 0 -cpu-used -5 -auto-alt-ref 1 -lag-in-frames 25 -pass 2 -g 240 -ac 2 -threads 8 -c:a copy "${FILE%.*}--compressed$SUFFIX.webm"
+else
+ ffmpeg -y -i "$FILE" $* -pixel_format yuv420p -vf $VIDEO_FILTER -colorspace 1 -color_primaries 1 -color_trc 1 -c:v libvpx-vp9 -b:v 0 -crf $Q -tile-columns 2 -tile-rows 2 -frame-parallel 0 -cpu-used -5 -auto-alt-ref 1 -lag-in-frames 25 -pass 2 -g 240 -ac 2 -threads 8 -c:a libvorbis "${FILE%.*}--compressed$SUFFIX.webm"
+fi
+rm $FILE
+#+end_src
+
+2022 version used with parallel to compress low version
+
+#+begin_src sh :eval no :tangle "compress-video-low.sh"
+Q=$1
+WIDTH=1280
+HEIGHT=720
+AUDIO_RATE=48000
+VIDEO_FILTER="scale=w=${WIDTH}:h=${HEIGHT}:force_original_aspect_ratio=1,pad=${WIDTH}:${HEIGHT}:(ow-iw)/2:(oh-ih)/2,fps=25,colorspace=all=bt709:iall=bt601-6-625:fast=1"
+FILE=$2
+SUFFIX=$Q
+shift
+shift
+ffmpeg -y -i "$FILE" -pixel_format yuv420p -vf $VIDEO_FILTER -colorspace 1 -color_primaries 1 -color_trc 1 -c:v libvpx-vp9 -b:v 0 -crf $Q -aq-mode 2 -tile-columns 0 -tile-rows 0 -frame-parallel 0 -cpu-used 8 -auto-alt-ref 1 -lag-in-frames 25 -g 240 -pass 1 -f webm -an -threads 8 /dev/null &&
+if [[ $FILE =~ "webm" ]]; then
+ ffmpeg -y -i "$FILE" $* -pixel_format yuv420p -vf $VIDEO_FILTER -colorspace 1 -color_primaries 1 -color_trc 1 -c:v libvpx-vp9 -b:v 0 -crf $Q -tile-columns 2 -tile-rows 2 -frame-parallel 0 -cpu-used -5 -auto-alt-ref 1 -lag-in-frames 25 -pass 2 -g 240 -ac 2 -threads 8 -c:a copy "${FILE%.*}--compressed$SUFFIX.webm"
+else
+ ffmpeg -y -i "$FILE" $* -pixel_format yuv420p -vf $VIDEO_FILTER -colorspace 1 -color_primaries 1 -color_trc 1 -c:v libvpx-vp9 -b:v 0 -crf $Q -tile-columns 2 -tile-rows 2 -frame-parallel 0 -cpu-used -5 -auto-alt-ref 1 -lag-in-frames 25 -pass 2 -g 240 -ac 2 -threads 8 -c:a libvorbis "${FILE%.*}--compressed$SUFFIX.webm"
+fi
+
+#+end_src
** When a talk is captioned
:PROPERTIES:
:CUSTOM_ID: when-captioned