diff --git a/scripts/ds2013-resources.js b/scripts/ds2013-resources.js index 8a674a9a7..41e5578be 100644 --- a/scripts/ds2013-resources.js +++ b/scripts/ds2013-resources.js @@ -6,8 +6,8 @@ var url = require('url'); var running = 0, queue = []; -var SUFFIXES = ["_hq.mp4", ".mp4", ".webm"]; -var WEB_SUFFIXES = [".mp4", ".webm"]; +var SUFFIXES = ["_hq.mp4", ".mp4", ".webm", ".mp3"]; +var WEB_SUFFIXES = [".mp4", ".webm", ".mp3"]; function resolveSizes(urls, cb) { if (running > 0) { @@ -62,6 +62,7 @@ function resolveSizes(urls, cb) { function mimeByExt(url) { var ext = url.split('.').pop(); var type = ({ avi: 'video/avi', + mp3: 'audio/mpeg', mp4: 'video/mp4', webm: 'video/webm', ogv: 'video/ogg', diff --git a/scripts/encode_gif.sh b/scripts/encode_gif.sh index cba22f943..a5c7f1dcb 100755 --- a/scripts/encode_gif.sh +++ b/scripts/encode_gif.sh @@ -3,5 +3,9 @@ if=$1 of=$2 -ffmpeg -i "$if" -ss 10 -r 0.002 -b 100k -bt 100M -s 320x180 "$of.%05d.jpg" && \ -convert -delay 50 -loop 0 "$of.?????.jpg" "$of.gif" +ffmpeg -i "$if" -r 0.01 -b:v 100k -bt:v 10M -s 320x180 "$of.%05d.jpg" && \ +rm -v $of.0000[01234].jpg && \ +convert -delay 50 -loop 0 "$of.?????.jpg" "$of.gif" && \ +mv $of.00005.jpg $of.jpg && \ +rm -v $of.0*.jpg + diff --git a/scripts/encode_mp3.sh b/scripts/encode_mp3.sh new file mode 100755 index 000000000..3ff096c41 --- /dev/null +++ b/scripts/encode_mp3.sh @@ -0,0 +1,16 @@ +#!/bin/sh -e + +if=$1 +of=$2 + +# No. CPU cores: +threads=8 +# Audio bitrate: +ab=96k + +ffmpeg -i "$if" \ + -f mp3 \ + -ab $ab \ + -threads $threads \ + -y "$of" + diff --git a/scripts/encode_mp4.sh b/scripts/encode_mp4.sh index 6ed8eb1af..c730d1bf8 100755 --- a/scripts/encode_mp4.sh +++ b/scripts/encode_mp4.sh @@ -8,7 +8,7 @@ threads=8 # Video bitrate: vb=400k # Audio bitrate: -ab=64k +ab=128k ffmpeg -i "$if" \ -f mp4 \ @@ -18,7 +18,6 @@ ffmpeg -i "$if" \ -vcodec libx264 \ -vpre libx264-ipod640 \ -b:v $vb \ - -s 640x360 \ -passlogfile "$of.ffmpeg2pass" \ -y "$of" diff --git a/scripts/encode_webm.sh b/scripts/encode_webm.sh index 216213caa..9e0d85a45 100755 --- a/scripts/encode_webm.sh +++ b/scripts/encode_webm.sh @@ -9,7 +9,7 @@ threads=8 # Video bitrate: vb=400k # Audio bitrate: -ab=96k +ab=128k ffmpeg -i "$if" \ -threads $threads \ @@ -17,7 +17,6 @@ ffmpeg -i "$if" \ -an \ -vcodec libvpx \ -b:v $vb \ - -s 640x360 \ -pass 1 \ -passlogfile "$of.ffmpeg2pass" \ -y /dev/null @@ -28,7 +27,6 @@ ffmpeg -i "$if" \ -ab $ab \ -vcodec libvpx \ -b:v $vb \ - -s 640x360 \ -pass 2 \ -passlogfile "$of.ffmpeg2pass" \ -y "$of"