From 291ac85d22819884dab40f61d4a2d77d8984d0e1 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Wed, 12 Oct 2022 19:18:46 +0200 Subject: Add working notes on new ffmpeg incantation for prerec --- 2022/organizers-notebook/index.org | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to '2022/organizers-notebook') diff --git a/2022/organizers-notebook/index.org b/2022/organizers-notebook/index.org index 74d72100..55b0df94 100644 --- a/2022/organizers-notebook/index.org +++ b/2022/organizers-notebook/index.org @@ -243,6 +243,33 @@ DEADLINE: <2022-10-28 Fri> :END: *** TODO Optimize ffmpeg incantation Remember to update [[file:../prepare.md::Compression]] with the new incantation. + +**** Incantation from last year +#+begin_src sh +Q=32 +ffmpeg -y -i "$1" -c:v libvpx-vp9 -b:v 0 -crf $Q -aq-mode 2 -an -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 -threads 8 /dev/null && +ffmpeg -y -i "$1" -c:v libvpx-vp9 -b:v 0 -crf $Q -c:a copy -tile-columns 2 -tile-rows 2 -frame-parallel 0 -cpu-used -5 -auto-alt-ref 1 -lag-in-frames 25 -pass 2 -g 240 -threads 8 "$2" +#+end_src + +**** New candidate +Changelog: +- Disable adaptive quantization by setting aq-mode to 0 (TODO: compare samples) +- Add ~-row-mt 1~ needed to support ~tile-rows~ (2×2 is enough for 720p) +- Also use tiles for first pass +- Remove ~-frame-parallel 0~ because it’s disabled by default (see [[https://github.com/Kagami/webm.py/wiki/Notes-on-encoding-settings][Notes on encoding settings · Kagami/webm.py Wiki]]) +- Put number of CPU in variable and use it for ~cpu-used~ and ~threads~ +- Stick to default for ~auto-alt-ref~ +- Stick to default for ~lag-in-frames~ +#+begin_src sh +Q=32 +CPU=8 +ffmpeg -y -i "$1" -c:v libvpx-vp9 -b:v 0 -crf $Q -an -row-mt 1 -tile-columns 2 -tile-rows 2 -cpu-used $CPU -g 240 -pass 1 -f webm -threads $CPU /dev/null && + ffmpeg -y -i "$1" -c:v libvpx-vp9 -b:v 0 -crf $Q -c:a copy -row-mt 1 -tile-columns 2 -tile-rows 2 -cpu-used $CPU -pass 2 -g 240 -threads $CPU "$2" +#+end_src + +Other considerations: +- We might want to tweak the time before keyframes (~-g~). + *** TODO Figure out workflow for handling submitted prerecs We need time after the prerecs get submitted to: - convert the videos and check that they've been reencoded properly by watching the re-encoded ones all the way to the end -- cgit v1.2.3