c3d2-web/scripts/encode_webm.sh

34 lines
490 B
Bash
Raw Normal View History

#!/bin/sh -e
2012-04-05 03:23:09 +02:00
if=$1
2011-10-06 23:22:34 +02:00
of=`basename "$1"`".webm"
# No. CPU cores:
threads=2
# Video bitrate:
vb=400k
# Audio bitrate:
ab=96k
ffmpeg -i "$if" \
-threads $threads \
-f webm \
-an \
-vcodec libvpx \
-b:v $vb \
-pass 1 \
-passlogfile "$of.ffmpeg2pass" \
-y /dev/null
ffmpeg -i "$if" \
-threads $threads \
2012-04-05 03:23:09 +02:00
-f webm \
-acodec libvorbis \
-ab $ab \
2012-04-05 03:23:09 +02:00
-vcodec libvpx \
-b:v $vb \
2012-04-05 03:23:09 +02:00
-pass 2 \
-passlogfile "$of.ffmpeg2pass" \
-y "$of"