scripts: ds2013 encoding parameters

This commit is contained in:
Astro 2013-10-08 01:06:02 +02:00
parent 0e6ea7addc
commit 81d41eccb8
5 changed files with 27 additions and 9 deletions

View File

@ -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',

View File

@ -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

16
scripts/encode_mp3.sh Executable file
View File

@ -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"

View File

@ -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"

View File

@ -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"