-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtranscode-to-webm
More file actions
executable file
·21 lines (16 loc) · 951 Bytes
/
transcode-to-webm
File metadata and controls
executable file
·21 lines (16 loc) · 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /bin/bash
INPUT=$1
OUTPUT=${INPUT%%.*}.webm
TMPDIR=$(basename $(mktemp -u))
BITRATE=1000K && [[ $2 != "" ]] && BITRATE=$2
mkdir $TMPDIR
cd $TMPDIR
echo bitrate: $BITRATE
# ffmpeg -i "$INPUT" -threads 8 -c:v libvpx -quality best -cpu-used 0 -b:v 3M -maxrate 4M -bufsize 8M -pass 1 -an -threads 8 -y -f webm /dev/null
# ffmpeg -i "$INPUT" -threads 1 -c:v libvpx -quality best -b:v 3M -maxrate 4M -bufsize 8M -pass 2 -c:a libvorbis -threads 14 -y -f webm $OUTPUT
ffmpeg -i "../$INPUT" -c:v libvpx-vp9 -c:v libvpx-vp9 -pass 1 -b:v $BITRATE -threads 16 -speed 4 -tile-columns 6 -frame-parallel 1 -auto-alt-ref 1 -lag-in-frames 25 -g 9999 -aq-mode 0 -an -y -f webm /dev/null
ffmpeg -i "../$INPUT" -c:v libvpx-vp9 -pass 2 -b:v $BITRATE -threads 16 -speed 0 -tile-columns 6 -frame-parallel 1 -auto-alt-ref 1 -lag-in-frames 25 -g 9999 -aq-mode 0 -c:a libopus -b:a 64k -y -f webm ../$OUTPUT
say "transcoding finished" &
cd ..
rm $TMPDIR/*
rmdir $TMPDIR